sparql-examples

A set of SPARQL examples that are used in different SIB resources

View the Project on GitHub sib-swiss/sparql-examples

neXtProt/NXQ_00299

Proteins interacting with small molecules according to DrugBank

Use at

PREFIX : <http://nextprot.org/rdf/>
PREFIX db: <http://nextprot.org/rdf/db/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?entry (group_concat(distinct str(?lbl); SEPARATOR = ";") as ?mol) WHERE {
 ?entry :isoform / :smallMoleculeInteraction / :interactant ?ref .
 ?ref :provenance db:DrugBank.
 ?ref rdfs:label ?lbl.
}
group by ?entry
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v1("?entry"):::projected 
  v3("?lbl"):::projected 
  v4("?mol")
  v2("?ref")
  a1((" "))
  a2((" "))
  c5([":db/DrugBank"]):::iri 
  v1 --":isoform"-->  a1
  a1 --":smallMoleculeInteraction"-->  a2
  a2 --":interactant"-->  v2
  v2 --":provenance"-->  c5
  v2 --"rdfs:label"-->  v3
  bind1[/"str(?lbl)"/]
  v3 --o bind1
  bind1 --as--o v4