How to create a SPARQL endpoint using Virtuoso?

风流意气都作罢 提交于 2020-01-07 00:34:46

问题


I have just setup Virtuoso and I have loaded an OWL file (created with Protege software) present on my local machine in to Virtuoso using the following code:

SQL> DB.DBA.RDF_LOAD_RDFXML_MT (file_to_string_output ('antibiotics.owl'), '', 'http://myexample.com');

Now, my question is how do I access the URI myexample.com ? How do I create a SPARQL endpoint in Virtuoso so that I can query it?


回答1:


No need to create a sparql endpoint, since it's already there. Check the inserted RDF data on your Virtuoso instance sparql endpoint http://cname:port/sparql (usually: http://localhost:8890/sparql). To do some test queries, use the web interface of Virtuoso (the conductor) http://localhost:8890/conductor and go to the 'Linked Data' tab. Enter a query like:

SELECT ?s ?p ?o
FROM <http://myexample.com>
WHERE {?s ?p ?o}
LIMIT 1000

to get started.

You can also query directly from the vsql command line by adding 'SPARQL ' in front of your sparql query. To get results in a specific format directly via html get request:

http://localhost:8890/sparql?query=(YourQueryUriEncodedWithout())&format=json

For a more detailed answer, consult the documentation here: http://docs.openlinksw.com/virtuoso/rdfsparql.html

Points of interest:

16.2.3.15. SPARQL Endpoint with JSON/P Output Option: Curl Example
16.2.5. SPARQL Inline in SQL

If you still want your own endpoint:

16.2.3.4.6. Creating and Using a SPARQL-WebID based Endpoint

Best regards...



来源:https://stackoverflow.com/questions/28953552/how-to-create-a-sparql-endpoint-using-virtuoso

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!