我在哪里可以测试用SPARQL编写的RDF的查询 [英] Where do I test my queries for my RDF written in SPARQL

查看:84
本文介绍了我在哪里可以测试用SPARQL编写的RDF的查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是语义Web技术的初学者,我的问题可能是一个非常基本的问题,但我真的很想找出答案. 我有一个从XML创建的RDF文件,并已使用w3.org RDF VALIDATOR对其进行了验证.我的问题是如何使用SPARQL在RDF文档上运行查询. 在线资源 http://demo.openlinksw.com/sparql 不起作用,我也不知道该怎么办或如何查找有关此信息.

I am a beginner with Semantic Web technologies, My question might be a very basic one but I am really stuck figuring it out. I have a RDF file I created from an XML and have validated it using w3.org RDF VALIDATOR. My question is how can I run queries on my RDF document using SPARQL. The online resource http://demo.openlinksw.com/sparql does not work and I have no Idea what or how to find information about this.

推荐答案

您可以使用 Apache Jena Project 的一部分,但可以作为独立应用程序下载(在链接处以上).

You could set up your own local SPARQL endpoint using Fuseki. Fuseki is part of the Apache Jena Project but can be downloaded as a standalone application (at the link above).

使用 Fuseki ,您可以(以及其他功能)

With Fuseki you can (amongst other stuff)

  1. 加载本地RDF数据集
  2. 使用该数据集来
    • 通过http://localhost:3030/将此数据公开为 SPARQL端点(默认情况下)
    • 使用http://localhost:3030/sparql.html
    • 上的基于网络的查询表单
  1. load a local RDF dataset
  2. use that dataset to
    • expose this data as a SPARQL endpoint via http://localhost:3030/ (by default)
    • use a web based query form at http://localhost:3030/sparql.html

这意味着您可以使用Fuseki来使用基于Web的表单简单地查询数据集,或者使用通过http查询SPARQL端点的任何应用程序来查询数据集.

That means you can use Fuseki to either simply query your dataset using the web based form or to query your dataset using any application that queries SPARQL endpoints over http.

个人,我目前正在开发一个可通过SPARQL端点分析数据集的应用程序.我使用Fuseki设置了本地SPARQL端点,并提供了示例数据,可以对这些示例数据运行和测试我的应用程序.

Personally, I am currently developing an application that analyses datasets via SPARQL endpoints. I use Fuseki to set up a local SPARQL endpoint with example data that I can run and test my application against.

Fuseki的基本功能非常易于使用.下面的行将启动服务器(SPARQL端点).

Fuseki's basic functionality is rather easy to use. The line below will start the server (SPARQL endpoint).

java -jar fuseki-server.jar --config=yourConfig.ttl

文件yourConfig.ttl是RDF文件(乌龟序列化格式).要设置将RDF文件加载到内存的基本服务器,只需编写(至少替换数据集文件的路径):

The file yourConfig.ttl is a RDF file (in turtle serialization format). To set up a basic server that loads your RDF file to memory just write (replacing at least the path to your dataset file):

# Attention: I have omitted the @prefix declarations

[] rdf:type fuseki:Server ;
   fuseki:services (
 <#yourService>
) .

<#yourService> rdf:type fuseki:Service ;
fuseki:name                     "yourService" ;
fuseki:serviceQuery             "query" ;
fuseki:serviceReadGraphStore    "get" ;
fuseki:dataset                   <#yourDataset> ;
.

<#yourDataset>    rdf:type ja:RDFDataset ;
rdfs:label "a label for your dataset" ;
ja:defaultGraph 
  [ rdfs:label "yourDataset.rdf" ;
    a ja:MemoryModel ;
    ja:content [ja:externalContent <file:Path/To/yourDataset.rdf> ] ;
  ] ;
.

这篇关于我在哪里可以测试用SPARQL编写的RDF的查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆