Search code examples
sparqlowlendpointvirtuoso

How to create a SPARQL endpoint using Virtuoso?


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?


Solution

  • 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...