
This slide set was presented at the 4 Feb, 2009 TED conference in San Clara CA.
This work is licensed under a
Creative Commons Attribution 3.0 License,
with attribution to TED.

# Assign convenient prefixes to common for later syntactic shorthand. PREFIX db: <http://www.w3.org/2003/01/21-RDF-RDB-access/ns#SqlDB?properties=..%2Ftest%2F> PREFIX ma: <http://med.example/ma#> PREFIX cs: <http://med.example/cs#> PREFIX up: <http://med.example/up#> PREFIX sa: <http://med.example/sa#> PREFIX mt: <http://med.example/mt#> SELECT ?name ?chemical ?motif ?saProt ?kd50 ?like ?ld FROM NAMED db:MicroArray.prop FROM NAMED db:Uniprot.rdf FROM NAMED db:ScreeningAssay.prop FROM NAMED db:ChemStructure.prop FROM NAMED db:MouseToxicity.prop WHERE { # Get a name and a chemical from the (SQL) MicroArray database. GRAPH db:MicroArray.prop { ?g ma:name ?name . ?g ma:expression "up" . ?g ma:experiment ?kinase . ?kinase ma:against ?chemical } # The uniprot data (in RDF) has motif and pathway information. GRAPH db:Uniprot.rdf { ?p ma:name ?name . # bound to ?ma.ma:name ?p up:motif ?motif . ?p up:pathway "apoptosis" } # Use the (SQL) Kinase databaes to limit to the interesting chemicals. GRAPH db:ScreeningAssay.prop { ?a sa:name "KinaseAssay" . ?a cs:chemical ?chemical . # bound to ?ma.cs:chemical ?a sa:upname ?saProt . ?a ma:kd50 ?kd50 FILTER (?kd50 >= .7 || ?kd50 < .2) } # This (SQL) chemical database indexes like sidechains. GRAPH db:ChemStructure.prop { ?c cs:chemical ?chemical . # bound to ?ma.cs:chemical, ?sa.cs:chemical ?c cs:structure "asdfasdf" . ?c cs:sidechain ?side . ?c2 cs:sidechain ?side . ?c2 cs:chemical ?like } # Limit by toxicity in the (SQL) MouseToxicity experiments. GRAPH db:MouseToxicity.prop { ?t cs:chemical ?like . # bound to ?cs.cs:sidechain ?t mt:toxicity ?ld FILTER (?ld < .35) } }
# Get a name and a chemical from the (SQL) MicroArray database. GRAPH db:MicroArray.prop { ?g ma:name ?name . ?g ma:expression "up" . ?g ma:experiment ?kinase . ?kinase ma:against ?chemical } }
gives me:
| g | name | kinase | chemical |
|---|---|---|---|
| g1 | Q9NY61 | kin:PIGF | sugar |
| g2 | Q8WTP8 | kin:FGFR1 | salt |
| g3 | O95831 | kin:FGFR1 | sweat |
| g | name | kinase | agin | chemical |
|---|---|---|---|---|
| g1 | Q9NY61 | kin:PIGF | agin1 | sugar |
| g2 | Q8WTP8 | kin:FGFR1 | agin2 | salt |
| g3 | O95831 | kin:FGFR1 | agin2 | sweat |
The next graph query
# The uniprot data (in RDF) has motif and pathway information. GRAPH db:Uniprot.rdf { ?p ma:name ?name . # bound to ?ma.ma:name ?p up:motif ?motif . ?p up:pathway "apoptosis" }
is constrained by the variable name.
# The uniprot data (in RDF) has motif and pathway information. GRAPH db:Uniprot.rdf { ?p ma:name ?span . # bound to ?ma.ma:name ?p up:motif ?motif . ?p up:pathway "apoptosis" }
Q9NY61, Q8WTP8, O95831) substituted for ?nameGRAPH db:Uniprot.rdf { ?p ma:name "Q9NY61" . # bound to ?ma.ma:name ?p up:motif ?motif . ?p up:pathway "apoptosis" }
GRAPH db:Uniprot.rdf { ?p ma:name "Q8WTP8" . # bound to ?ma.ma:name ?p up:motif ?motif . ?p up:pathway "apoptosis" }
GRAPH db:Uniprot.rdf { ?p ma:name "O95831" . # bound to ?ma.ma:name ?p up:motif ?motif . ?p up:pathway "apoptosis" }
Send current (relevent) bindings with the query:
# The uniprot data (in RDF) has motif and pathway information. GRAPH db:Uniprot.rdf { ?p ma:name ?name . # bound to ?ma.ma:name ?p up:motif ?motif . ?p up:pathway "apoptosis" }
BINDINGS ?name {
("Q9NY61")
("Q8WTP8")
("O95831") }
# The uniprot data (in RDF) has motif and pathway information. GRAPH db:Uniprot.rdf { ?p ma:name ?name . # bound to ?ma.ma:name ?p up:motif ?motif . ?p up:pathway "apoptosis" }
