Skip to content

From GSMN to RDF and back

JervenBolleman edited this page Dec 10, 2018 · 8 revisions

For each uniprot entry of the mouse proteome find the catalyzed rhea reactions. Given those reactions retrieve the ChEBI that are involved in those reactions.

PREFIX up:<http://purl.uniprot.org/core/> 
PREFIX taxon:<http://purl.uniprot.org/taxonomy/> 
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX rh:<http://rdf.rhea-db.org/>
SELECT 
  ?protein 
  ?rhea
  ?rheaEquation
WHERE
{
  ?protein up:organism taxon:10090 ;
           up:reviewed true ;
           up:annotation/up:catalyticActivity/up:catalyzedReaction ?rhea .
  SERVICE <https://sparql.rhea-db.org/sparql> {
  	?rhea ?x ?rheaEquation .  
  }
}

PREFIX up:<http://purl.uniprot.org/core/> 
PREFIX taxon:<http://purl.uniprot.org/taxonomy/> 
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX rh:<http://rdf.rhea-db.org/>
SELECT 
  ?protein 
  ?rhea
  (GROUP_CONCAT(?chebi ; separator=',') AS ?chebis)
WHERE
{
  ?protein up:organism taxon:10090 ;
           up:reviewed true ;
           up:annotation/up:catalyticActivity/up:catalyzedReaction ?rhea .
  SERVICE <https://sparql.rhea-db.org/sparql> {
  	?rhea rh:status ?rheaStatus ;
          rh:equation ?rheaEquation ;
          rh:side ?reactionSide .
    ?reactionSide rh:contains ?participant .
    ?participant rh:compound ?compound .
    ?compound rh:chebi ?chebi
  }
} GROUP BY ?protein ?rhea
PREFIX up:<http://purl.uniprot.org/core/> 
PREFIX taxon:<http://purl.uniprot.org/taxonomy/> 
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX rh:<http://rdf.rhea-db.org/>
SELECT 
  ?protein 
  ?rhea
  ?chebi
  ?reactionSide
  ?coefficient
WHERE
{
  <http://purl.uniprot.org/uniprot/P27786> up:organism taxon:10090 ;
           up:reviewed true ;
           up:annotation/up:catalyticActivity/up:catalyzedReaction ?rhea .
  SERVICE <https://sparql.rhea-db.org/sparql> {
  	?rhea rh:status ?rheaStatus ;
          rh:equation ?rheaEquation ;
          rh:side ?reactionSide .
    ?reactionSide ?contains ?participant .
    ?contains rdfs:subPropertyOf rh:contains ;
          rh:coefficient ?coefficient .
    
    ?participant rh:compound ?compound .
                
    ?compound rh:chebi ?chebi .
  }
}

Clone this wiki locally