1

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?

halfer
  • 19,824
  • 17
  • 99
  • 186
user2201650
  • 527
  • 7
  • 13
  • 28

1 Answers1

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

chile
  • 724
  • 1
  • 7
  • 15
  • Thank you for replying. I have one more question. How can I use the the URI in an Android application so that I can query from the app? – user2201650 Mar 11 '15 at 17:20
  • or here: http://stackoverflow.com/questions/9968114/android-sending-https-get-request – chile Mar 11 '15 at 17:35
  • Thanks for those links. What will the URI be for my question? So that I can specify that in the app. – user2201650 Mar 11 '15 at 18:08
  • You know, to access my ontology via a SPARQL query from the app? – user2201650 Mar 11 '15 at 23:13
  • not sure what you mean... sparql endpoint: http://hostname:8890/sparql add ?query=.... + &format=.... The graph you passed into the triple store is query-able by using the FROM statement (FROM) or the GRAPH statement (see SPARQL documentation) How your uri will look like is therefore dependent on your query. – chile Mar 11 '15 at 23:18
  • Here's the idea. I have textfield (call it TF1) where the user enters his SPARQL query. Then I have the 2nd textfield (call it TF2) where the user enters the Graph URI. Then there's a button (call B1) when clicked on it, displays the classes, subclasses, properties, etc. of that ontology. How can I achieve this? I basically want to do what's asked in here: https://stackoverflow.com/questions/28842339/is-it-possible-to-read-an-ontology-from-a-sparql-endpoint – user2201650 Mar 11 '15 at 23:49
  • SELECT ?class FROM WHERE{?class a owl:class} Order By ?class – chile Mar 12 '15 at 00:04
  • SELECT ?property FROM WHERE{?property a rdfs:Propery} Order By ?propery and so on, just start to experiment from here on.. dont forget to mark my answer as correct answer :) – chile Mar 12 '15 at 00:09
  • When I run the query to retrieve the classes, I get nothing. Same with the query to retrieve properties. – user2201650 Mar 12 '15 at 00:10
  • dude, i dont now your actual data, if it is actually an ontology definition, than there should be triples like propxy a rdfs:Property, If not, you would have to query differently (e.g. SELECT DISTINCT ?prop FROM WHERE {?x ?prop ?y). Also, I dont know if your classes are owl or rdf classes. And so on, you have to do this part without me, since it has nothing to do with the original question. When you are stuck, you have to ask a new one with examples of your data... – chile Mar 12 '15 at 07:37