Skip to content

Instantly share code, notes, and snippets.

@dbellettini
Created December 6, 2013 16:43
Show Gist options
  • Save dbellettini/7827980 to your computer and use it in GitHub Desktop.
Save dbellettini/7827980 to your computer and use it in GitHub Desktop.
SPARQL Subscription Queries
createQuery="""
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl:<http://www.w3.org/2002/07/owl#>
PREFIX xsd:<http://www.w3.org/2001/XMLSchema#>
PREFIX locateme:<http://www.semanticweb.org/CalcolatoriM/LocateMeOntology.owl#>
SELECT ?label ?user
WHERE {
locateme:MainCommandInterface locateme:HasCommand ?command .
?command locateme:HasCommandType locateme:Create .
?command rdf:label ?label .
?command locateme:HasIssuer ?user
}
"""
joinQuery="""
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl:<http://www.w3.org/2002/07/owl#>
PREFIX xsd:<http://www.w3.org/2001/XMLSchema#>
PREFIX locateme:<http://www.semanticweb.org/CalcolatoriM/LocateMeOntology.owl#>
SELECT ?group ?user
WHERE {
locateme:MainCommandInterface locateme:HasCommand ?command .
?command locateme:HasCommandType locateme:Join .
command locateme:HasGroup ?group .
?command locateme:HasIssuer ?user
}
"""
leaveQuery="""
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl:<http://www.w3.org/2002/07/owl#>
PREFIX xsd:<http://www.w3.org/2001/XMLSchema#>
PREFIX locateme:<http://www.semanticweb.org/CalcolatoriM/LocateMeOntology.owl#>
SELECT ?group ?user
WHERE {
locateme:MainCommandInterface locateme:HasCommand ?command .
?command locateme:HasCommandType locateme:Leave .
command locateme:HasGroup ?group .
?command locateme:HasIssuer ?user
}
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment