Skip to content

Instantly share code, notes, and snippets.

@niclashoyer
Created June 22, 2012 17:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niclashoyer/2974206 to your computer and use it in GitHub Desktop.
Save niclashoyer/2974206 to your computer and use it in GitHub Desktop.
SPARQL Query for Retrieving Classes with Properties
PREFIX dc:<http://purl.org/dc/elements/1.1/>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX time:<http://www.w3.org/2006/time#>
PREFIX geo:<http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX foaf:<http://xmlns.com/foaf/0.1/>
PREFIX event:<http://purl.org/NET/c4dm/event.owl#>
PREFIX owl:<http://www.w3.org/2002/07/owl#>
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX vs:<http://www.w3.org/2003/06/sw-vocab-status/ns#>
select distinct ?class ?property ?label
where {
?class a owl:Class .
?property a owl:ObjectProperty ;
rdfs:domain ?class .
optional {
?property rdfs:label ?label .
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment