@prefix ex: <https://sparql.metanetx.org/.well-known/sparql-examples/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema: <https://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .

ex:12 a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "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."@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """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 )
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""" ;
    schema:target <https://rdf.metanetx.org/sparql/> .

