Jefferson Project Sample Queries

Printer-friendly version

List Jefferson Project-related sample queries here..
Contents:

  1. Explicit queries
  2. Links to query source documents


1. Explicit queries

/* list everything in the KB along with all their attributes*/
SELECT ?s ?p ?o WHERE { ?s ?p ?o. }

/* list everything in the KB along with their types */
SELECT ?s ?o WHERE { ?s a ?o. }

/* list all things of type prov:Agent */
SELECT  ?s WHERE { ?s a  <http://www.w3.org/ns/prov#Agent>. }

/* list all things of type hasneto:Configurator */
SELECT  ?s WHERE { ?s a  <http://jefferson.rpi.edu/ontology/hasneto/0/1#Configurator>. }

/* list all things of type hasneto:Instrument */
SELECT  ?s WHERE { ?s a  <http://jefferson.rpi.edu/ontology/hasneto/0/1#Instrument>. }

/* list all things of type foaf:Organization */
SELECT  ?s WHERE { ?s a  <http://xmlns.com/foaf/0.1/Organization> .}

/* List people and their organizations */
SELECT  ?s ?org WHERE { 
    ?s a <http://xmlns.com/foaf/0.1/Person> .
    ?s <http://www.w3.org/ns/prov#actedOnBehalfOf> ?org.
}

/* List people working for RPI’s DFWI */
SELECT  distinct ?s WHERE { 
?org <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>  <http://xmlns.com/foaf/0.1/Organization> .
?s  <http://www.w3.org/ns/prov#actedOnBehalfOf> <http://jefferson.rpi.edu/kb/0/1#rpi> .
}

/* List organizations with sub-organizations */
SELECT  ?orgname ?suborgname WHERE { 
    ?org a <http://xmlns.com/foaf/0.1/Organization> .
  ?org <http://xmlns.com/foaf/0.1/name> ?orgname.  
    ?suborg a <http://xmlns.com/foaf/0.1/Organization> .
  ?suborg <http://xmlns.com/foaf/0.1/name> ?suborgname.  
    ?suborg <http://www.w3.org/ns/prov#actedOnBehalfOf> ?org.
}

/* Name people working for RPI */
SELECT  ?sname WHERE { 
   ?suborg a <http://xmlns.com/foaf/0.1/Organization> .  
    ?suborg <http://www.w3.org/ns/prov#actedOnBehalfOf> <http://jefferson.rpi.edu/kb/0/1#rpi>.
    ?s a <http://xmlns.com/foaf/0.1/Person> .
    ?s <http://www.w3.org/ns/prov#actedOnBehalfOf> ?suborg.
 ?s  <http://xmlns.com/foaf/0.1/givenName> ?sname.
}

/* Name people working for RPI */
SELECT  ?sname WHERE { 
   ?suborg a <http://xmlns.com/foaf/0.1/Organization> .  
    ?suborg <http://www.w3.org/ns/prov#actedOnBehalfOf> <http://jefferson.rpi.edu/kb/0/1#rpi>.
    ?s a <http://xmlns.com/foaf/0.1/Person> .
    ?s <http://www.w3.org/ns/prov#actedOnBehalfOf> ?suborg.
 ?s  <http://xmlns.com/foaf/0.1/givenName> ?sname.
}

/* List the physical features and the characteristics of these features that are/will be measured in the Jefferson Project */ 
SELECT ?pf ?pfc WHERE {
?pf <http://jefferson.rpi.edu/ontology/hasneto/0/1#hasCharacteristic>
?pfc . }

/* List the physical features, the characteristics of these features, and the sensors used to measure these characteristics in the Jefferson Project */ 
SELECT ?pf ?pfc ?sensor WHERE {
?pf <http://jefferson.rpi.edu/ontology/hasneto/0/1#hasCharacteristic>
?pfc . 
?sensor <http://jefferson.rpi.edu/ontology/hasneto/0/1#hasMeasuredCharacteristic> ?pfc.
}

/* List sodium observations for Finkle Brook that exceed 12 mg/L in the month of April */
PREFIX raw: <http://jefferson.tw.rpi.edu/source/dfwi-rpi-edu/dataset/stream-analytes-and-flows/vocab/raw/>
SELECT distinct ?observation, ?trib_name, ?date, ?time, ?sodium
WHERE {
?observation raw:tributary_name ?trib_name. 
?observation raw:sample_date ?date.
?observation raw:sample_acquired_time ?time.
?observation raw:na_mg_l ?sodium.
FILTER (?trib_name = "Finkle Brook" && xsd:double(?sodium) > "12"^^xsd:double && regex(?date, "-Apr-", "i")).
} 


2. Links to query source documents

  1. Laura Kinkead's "Thesis Notes" containing queries (untested)
  2. Laura Kinkead's Salt Query Demo