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_00288

Biological Process and Molecular Function GO terms related to UniPathway metabolic pathways

Use at

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

SELECT DISTINCT (str(?pathwayname) as ?unipathway) ?related (str(?pathlabel) as ?GO_BP) (str(?pathlabel2) as ?GO_MF) WHERE {
 ?entry :isoform ?iso.
 ?iso :pathway ?pathannot .
 ?pathannot :term ?pathterm; rdfs:comment ?pathwayname.
 ?pathterm :related ?related .
 {?related a :GoBiologicalProcessCv ; rdfs:label ?pathlabel .}
 UNION
 {?related a :GoMolecularFunctionCv ; rdfs:label ?pathlabel2 .}
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v10("?GO_BP")
  v11("?GO_MF")
  v1("?entry")
  v2("?iso")
  v3("?pathannot")
  v7("?pathlabel"):::projected 
  v8("?pathlabel2"):::projected 
  v4("?pathterm")
  v5("?pathwayname"):::projected 
  v6("?related"):::projected 
  v9("?unipathway")
  c9([":GoMolecularFunctionCv"]):::iri 
  c7([":GoBiologicalProcessCv"]):::iri 
  v1 --":isoform"-->  v2
  v2 --":pathway"-->  v3
  v3 --":term"-->  v4
  v3 --"rdfs:comment"-->  v5
  v4 --":related"-->  v6
  subgraph union0[" Union "]
  subgraph union0l[" "]
    style union0l fill:#abf,stroke-dasharray: 3 3;
    v6 --"a"-->  c9
    v6 --"rdfs:label"-->  v8
  end
  subgraph union0r[" "]
    style union0r fill:#abf,stroke-dasharray: 3 3;
    v6 --"a"-->  c7
    v6 --"rdfs:label"-->  v7
  end
  union0r <== or ==> union0l
  end
  bind0[/"str(?pathwayname)"/]
  v5 --o bind0
  bind0 --as--o v9
  bind1[/"str(?pathlabel)"/]
  v7 --o bind1
  bind1 --as--o v10
  bind2[/"str(?pathlabel2)"/]
  v8 --o bind2
  bind2 --as--o v11