使用 Virtuoso 设置 RDF 本体
过去几个小时我一直在 google 上搜索有关如何使用 virtuoso 服务器(开源版本)配置 RDF 存储的教程或指南。
我有用 Protégé 软件创建的 RDF 文件。如何将此文件添加到 virtuoso 服务器并配置端点以便能够通过 Jena 或其他此类 API 插入/更新或查询数据。
I've googled for last few hours searching for tutorials or guides about how to configure RDF store with virtuoso server (open source version).
I have RDF file which was created with Protégé software. How can I add this file to virtuoso server and configure an end point to be able to insert/update or querying data via Jena or other API of that kind.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最简单的方法可能是这个文档页面
使用内容类型的 HTTP PUT:application/rdf+xml
。该机制基本上运行一个HTTP PUT
将您的文件发送到三元组存储。curl -T your_file.rdf entity_uri_to_store_file -u user:pass
将
entity_uri_to_store_file
想象为您要保存该文件的表。假设您的文件是ontology1.owl,并且您想将其保存在实体
http://myorganise.com/ontologies/ontology1
中,那么您的命令将类似于...curl -T ontology1.owl http://myorganization.com/ontologies/ontology1 -u user:pass
注意:如果您运行的是 Windows 系统,您可以从 此处安装
curl
。之后要查询数据...您也可以使用
curl
来完成。curl -F“query=您的 SPARQL 查询”http://your.virtuososerver.org/sparql
请注意,您必须使用 SPARQL 来访问数据。
对于 Jena,您必须通过命令行使用 Jena ARQ ...
java -cp ... arq.query --service 'hhttp://your.virtuososerver.org/sparql' 'SELECT * WHERE {?s ?p ?o}'
或以编程方式使用 API ...
只需记住将变量
service
指向您的大师所在的位置服务器正在监听。The easiest way to do it might be as explain on point (16.8.3) of this documentation page
HTTP PUT using Content-Type: application/rdf+xml
. This mechanism basically runs aHTTP PUT
sending your file to the triple store.curl -T your_file.rdf entity_uri_to_store_file -u user:pass
Think of
entity_uri_to_store_file
as if was the table where you want to save that file.So lets say that your file is ontology1.owl and you want to save it in the entity
http://myorganisation.com/ontologies/ontology1
your command then would look like ...curl -T ontology1.owl http://myorganisation.com/ontologies/ontology1 -u user:pass
Note: if you're running a Windows box you can install
curl
from here.To query the data afterwards ... you can also do it with
curl
.curl -F "query=YOUR SPARQL QUERY" http://your.virtuososerver.org/sparql
Notice that you have to use SPARQL to access the data.
In the case of Jena, you have to use Jena ARQ, by command line ...
java -cp ... arq.query --service 'hhttp://your.virtuososerver.org/sparql' 'SELECT * WHERE {?s ?p ?o}'
or programatically by using the API ...
Just remember to point the variable
service
to where your virtuoso server is listening.从 Virtuoso Conductor (http:cname:8890/conductor) 中,您可以转到“RDF -> RDF Store Upload”选项卡,您可以在其中从文件系统或 URL 位置上传 RDF 数据集文件。
Virtuoso Jena Provider 可用于使用以下命令查询 Virtuoso Quad Store:耶拿框架。
From the Virtuoso Conductor (http:cname:8890/conductor) you can go to the "RDF -> RDF Store Upload" tab where you can upload RDF datasets file from file system or a URL location.
The Virtuoso Jena Provider can be used for querying the Virtuoso Quad Store using the Jena Franework.