Skip to content

Useful sparql queries

satra edited this page Mar 23, 2013 · 4 revisions

Virtuoso servers

  1. http://computor.mit.edu:8890/sparql

Example Queries

  1. Return named graphs in a virtuoso server
SELECT DISTINCT ?namedgraph ?label
WHERE {
  GRAPH ?namedgraph { ?s ?p ?o }
  OPTIONAL { ?namedgraph rdfs:label ?label }
}
ORDER BY ?namedgraph
  1. Browse distinct properties
SELECT DISTINCT ?property
WHERE { [] ?property [] }
ORDER BY ?property
  1. Browse distinct classes
SELECT DISTINCT ?class
WHERE { [] a ?class }
ORDER BY ?class
Clone this wiki locally