sparql-examples

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

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

12

Given the protein with UniProt accession number P42588 (PAT_ECOLI, putrescine aminotransferase, EC 2.6.1.82) retrieve all reactions and models in which this polypeptide appears.

Use at

PREFIX mnx: <https://rdf.metanetx.org/schema/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX uniprot: <http://purl.uniprot.org/uniprot/>

# Given the protein with UniProt accession number *P42588*
# (PAT_ECOLI, putrescine aminotransferase, EC 2.6.1.82)
# retrieve all reactions and models in which this polypeptide
# appears.

SELECT ?mnet_label ?reac_label ?reac_eq ?MNXR (GROUP_CONCAT( ?cata_label; separator=';' ) AS ?complex )
FROM <https://rdf.metanetx.org/> WHERE{
    ?pept mnx:peptXref uniprot:P42588 .
    ?cata mnx:pept ?pept ;
          rdfs:label ?cata_label .
    ?gpr mnx:cata ?cata ;
         mnx:reac ?reac .
    ?reac rdfs:label ?reac_label ;
          rdfs:comment ?reac_eq .
    ?mnet mnx:gpr ?gpr ;
          rdfs:label ?mnet_label.
    OPTIONAL{ ?reac mnx:mnxr ?MNXR }
} GROUP BY ?mnet_label ?reac_label ?reac_eq ?MNXR
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v10("?MNXR"):::projected 
  v2("?cata")
  v3("?cata_label"):::projected 
  v11("?complex")
  v4("?gpr")
  v8("?mnet")
  v9("?mnet_label"):::projected 
  v1("?pept")
  v5("?reac")
  v7("?reac_eq"):::projected 
  v6("?reac_label"):::projected 
  c2([http://purl.uniprot.org/uniprot/P42588]):::iri 
  v1 --"mnx:peptXref"-->  c2
  v2 --"mnx:pept"-->  v1
  v2 --"rdfs:label"-->  v3
  v4 --"mnx:cata"-->  v2
  v4 --"mnx:reac"-->  v5
  v5 --"rdfs:label"-->  v6
  v5 --"rdfs:comment"-->  v7
  v8 --"mnx:gpr"-->  v4
  v8 --"rdfs:label"-->  v9
  subgraph optional0["(optional)"]
  style optional0 fill:#bbf,stroke-dasharray: 5 5;
    v5 -."mnx:mnxr".->  v10
  end
  bind1[/"?cata_label"/]
  v3 --o bind1
  bind1 --as--o v11