27: Retrieve all protein names, including peptide names, associated with UniProtKB entry P05067.

 
1
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
2
PREFIX up: <http://purl.uniprot.org/core/>
3
SELECT
4
  ?protein
5
  ?anyKindOfName 
6
  ?names 
7
  ?partType
8
WHERE
9
{
10
  BIND(<http://purl.uniprot.org/uniprot/P05067> AS ?protein)
11
  ?protein a up:Protein .
12
  {
13
    ?protein (up:recommendedName|up:alternativeName) ?structuredName .
14
  }
15
    UNION
16
  {
17
    VALUES(?partType){(up:domain) (up:component)}
18
    ?protein ?partType ?part .
19
    ?part (up:recommendedName|up:alternativeName) ?structuredName .
20
  }
21
  ?structuredName ?anyKindOfName  ?names .
22
  ?anyKindOfName rdfs:subPropertyOf up:structuredNameType .
23
}
Use

27: Find all names associated with UniProtKB entry P05067, and if the name is associated with the entry it's domains or its components

xxxxxxxxxx
23
 
1
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
2
PREFIX up: <http://purl.uniprot.org/core/>
3
SELECT
4
  ?protein
5
  ?anyKindOfName 
6
  ?names 
7
  ?partType
8
WHERE
9
{
10
  BIND(<http://purl.uniprot.org/uniprot/P05067> AS ?protein)
11
  ?protein a up:Protein .
12
  {
13
    ?protein (up:recommendedName|up:alternativeName) ?structuredName .
14
  }
15
    UNION
16
  {
17
    VALUES(?partType){(up:domain) (up:component)}
18
    ?protein ?partType ?part .
19
    ?part (up:recommendedName|up:alternativeName) ?structuredName .
20
  }
21
  ?structuredName ?anyKindOfName  ?names .
22
  ?anyKindOfName rdfs:subPropertyOf up:structuredNameType .
23
}
Use

28: Get the list of UniProtKB entries for the chromosome of proteome UP000000625

xxxxxxxxxx
11
 
1
PREFIX up: <http://purl.uniprot.org/core/>
2
SELECT 
3
  ?protein
4
  ?proteome 
5
WHERE
6
{
7
  ?protein a up:Protein ;
8
           up:reviewed true ;
9
           up:proteome ?proteome .
10
  VALUES (?proteome) {(<http://purl.uniprot.org/proteomes/UP000000625#Chromosome>)}
11
}
Use

29: Use ALLIE a service for Abbreviation / Long Form in Japanese and English to search in UniProt using Japanese.

xxxxxxxxxx
23
 
1
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
2
PREFIX up: <http://purl.uniprot.org/core/>
3
SELECT ?protein ?englishLabelStr
4
WHERE {
5
    SERVICE <https://data.allie.dbcls.jp/sparql>{
6
        ?x rdfs:label "アミロイド前駆体タンパク質"@ja ;
7
            rdfs:label ?englishLabel .
8
        FILTER(lang(?englishLabel) = "en")
9
    }
10
    BIND (STR(?englishLabel) AS ?englishLabelStr)
11
    ?protein a up:Protein .
12
    {
13
        ?protein (up:recommendedName|up:alternativeName) ?structuredName .
14
    }
15
    UNION
16
    {
17
        VALUES(?partType){(up:domain) (up:component)}
18
            ?protein ?partType ?part .
19
        ?part (up:recommendedName|up:alternativeName) ?structuredName .
20
    }
21
    ?structuredName ?anyKindOfName  ?englishLabelStr .
22
    ?anyKindOfName rdfs:subPropertyOf up:structuredNameType .
23
}
Use

30: Find UniProtKB entries with merged loci in Bordetella avium

xxxxxxxxxx
14
 
1
PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
2
PREFIX up: <http://purl.uniprot.org/core/>
3
SELECT
4
  ?protein 
5
  (GROUP_CONCAT(?locusName; separator=',') AS ?locusNames)
6
WHERE 
7
{ 
8
  ?protein a up:Protein ;
9
    up:organism taxon:360910 ;
10
    up:encodedBy ?gene .
11
  ?gene up:locusName ?locusName .
12
} 
13
GROUP BY ?protein 
14
HAVING (COUNT(?locusName) > 1)
Use

31: Find UniParc records whose sequence point to the most database entries

xxxxxxxxxx
14
 
1
PREFIX up: <http://purl.uniprot.org/core/>
2
SELECT ?sequence ?entries
3
WHERE
4
{
5
    SELECT 
6
        ?sequence 
7
        (COUNT(?entry) AS ?entries)
8
    WHERE
9
    {
10
        GRAPH <http://sparql.uniprot.org/uniparc> {
11
            ?sequence up:sequenceFor ?entry .
12
        }
13
    } GROUP BY ?sequence
14
} ORDER BY DESC(?entries)
Use

32: Find UniProtKB entries with more than 1 Topological domain annotation

xxxxxxxxxx
15
 
1
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
2
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
3
PREFIX up: <http://purl.uniprot.org/core/>
4
SELECT 
5
    ?protein 
6
    (GROUP_CONCAT(?comment; separator=", ") AS ?comments)
7
WHERE
8
{
9
    ?protein a up:Protein ;
10
            up:annotation ?annotation . 
11
    ?annotation rdf:type up:Topological_Domain_Annotation ;
12
            rdfs:comment ?comment .
13
} 
14
GROUP BY ?protein 
15
HAVING (COUNT(?annotation) > 1)
Use

33: Find longest comment text associated with a UniProtKB natural variant annotation

xxxxxxxxxx
9
 
1
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
2
PREFIX up: <http://purl.uniprot.org/core/>
3
SELECT 
4
    ?annotation ?comment
5
WHERE {
6
    ?annotation a up:Natural_Variant_Annotation ;
7
        rdfs:comment ?comment . 
8
} 
9
ORDER BY DESC(STRLEN(?comment))
Use

34: Find the co-occurence count of topological domain comment text in UniProtKB entries

xxxxxxxxxx
26
 
1
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
2
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
3
PREFIX up: <http://purl.uniprot.org/core/>
4
SELECT 
5
    ?comment1 
6
    ?comment2 
7
    (COUNT(?comment1) AS ?count1)
8
WHERE
9
{
10
    ?protein a up:Protein ;
11
               up:annotation ?annotation1 , 
12
                             ?annotation2 . 
13
    ?annotation1 rdf:type up:Topological_Domain_Annotation ;
14
        rdfs:comment ?rawComment1 .
15
    ?annotation2 rdf:type up:Topological_Domain_Annotation ;
16
        rdfs:comment ?rawComment2 . 
17
    BIND(IF(contains(?rawComment1, ';'), 
18
            STRBEFORE(?rawComment1,';'), 
19
            ?rawComment1) AS ?comment1)
20
    BIND(IF(contains(?rawComment2, ';'), 
21
            STRBEFORE(?rawComment2,';'), 
22
            ?rawComment2) AS ?comment2)
23
    FILTER(?annotation1 != ?annotation2)
24
} 
25
GROUP BY ?comment1 ?comment2 
26
ORDER BY DESC(COUNT(?comment1))
Use

35: Find the similar proteins for UniProtKB entry P05067 sorted by UniRef cluster identity

xxxxxxxxxx
16
 
1
PREFIX uniprotkb: <http://purl.uniprot.org/uniprot/>
2
PREFIX up: <http://purl.uniprot.org/core/>
3
SELECT 
4
    ?similar ?identity
5
FROM <http://sparql.uniprot.org/uniref>
6
FROM <http://sparql.uniprot.org/uniprot>
7
WHERE
8
{
9
    BIND (uniprotkb:P05607 AS ?protein)
10
    ?cluster up:member ?member ;
11
             up:member/up:sequenceFor ?protein;
12
             up:identity ?identity .
13
    ?member up:sequenceFor ?similar .
14
    FILTER(!sameTerm(?similar, ?protein))
15
} 
16
ORDER BY DESC(?identity)
Use

36: Find the orthologous proteins for UniProtKB entry P05067 using the OrthoDB database

xxxxxxxxxx
31
 
1
PREFIX orthodb: <http://purl.orthodb.org/>
2
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
3
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
4
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
5
PREFIX uniprotkb: <http://purl.uniprot.org/uniprot/>
6
PREFIX up: <http://purl.uniprot.org/core/>
7
SELECT
8
  ?protein
9
  ?orthoGroup
10
  ?scientificName
11
  ?functionComment
12
  ?prefferedGeneName
13
  ((STRLEN(?value) - ?medianLength) as ?deviationFromMedianLength)
14
WHERE
15
{
16
  uniprotkb:P05067 a up:Protein ;
17
        up:organism/up:scientificName ?scientificName ;
18
        rdfs:seeAlso ?orthoGroup ;
19
        up:encodedBy/skos:prefLabel ?prefferedGeneName ;
20
          up:sequence/rdf:value ?value .
21
  OPTIONAL {
22
    ?protein up:annotation ?functionAnnotation .
23
    ?functionAnnotation a up:Function_Annotation ;
24
      rdfs:comment ?functionComment .
25
  }
26
  SERVICE <https://sparql.orthodb.org/sparql>{
27
    ?orthoGroup orthodb:ogMedianProteinLength ?medianLength .
28
    ?orthoGroup orthodb:hasMember ?xref .
29
    ?xref orthodb:xref/orthodb:xrefResource uniprotkb:P05067 .
30
  }
31
}
Use

37: Find the human protein which contains an epitope VSTQ, where T is a phosphorylated threonine

xxxxxxxxxx
26
 
1
PREFIX faldo: <http://biohackathon.org/resource/faldo#>
2
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
3
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
4
PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
5
PREFIX up: <http://purl.uniprot.org/core/>
6
SELECT 
7
  ?protein 
8
  ?comment
9
  ?begin
10
  ?end 
11
WHERE
12
{
13
  ?protein a up:Protein ;
14
    up:organism taxon:9606 ; 
15
    up:sequence ?sequence ;
16
    up:annotation ?annotation .
17
  ?annotation a up:Modified_Residue_Annotation ;
18
    rdfs:comment ?comment ;
19
    up:range ?range .
20
  ?range 
21
    faldo:begin [ faldo:position ?begin ; faldo:reference ?sequence ] ;
22
    faldo:end [ faldo:position ?end ; faldo:reference ?sequence ] .
23
  ?sequence rdf:value ?aaSequence .
24
  FILTER (SUBSTR(?aaSequence, ?begin -2 , 4) = "VSTQ")     
25
  FILTER (CONTAINS(?comment, "Phosphothreonine"))
26
}
Use

38: For the human entry P05067 (Amyloid-beta precursor protein) find the gene start ends in WikiData

xxxxxxxxxx
31
 
1
PREFIX p: <http://www.wikidata.org/prop/>
2
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
3
PREFIX ps: <http://www.wikidata.org/prop/statement/>
4
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
5
PREFIX uniprotkb: <http://purl.uniprot.org/uniprot/>
6
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
7
SELECT 
8
    ?protein 
9
    ?begin
10
    ?end
11
    ?chromosome
12
    ?assembly
13
WHERE {
14
    {
15
        BIND(uniprotkb:P05067 AS ?proteinIRI)
16
        BIND (SUBSTR(STR(?proteinIRI), STRLEN(STR(uniprotkb:))+1) AS ?protein)
17
    }
18
    SERVICE <https://query.wikidata.org/sparql> {
19
        ?wp wdt:P352 ?protein ;
20
            wdt:P702 ?wg . 
21
        ?wg p:P644   ?wgss .
22
        ?wgss ps:P644        ?begin ;
23
          pq:P1057/wdt:P1813 ?chromosome ;
24
          pq:P659/rdfs:label ?assembly .
25
        ?wg p:P645 ?wgse .
26
        ?wgse ps:P645        ?end ;
27
          pq:P1057/wdt:P1813 ?chromosome ;
28
          pq:P659/rdfs:label ?assembly .
29
        FILTER(lang(?assembly) = "en")
30
  } 
31
}
Use

39: Retrieve entries and catalytic activities in the reviewed (UniProtKB/Swiss-Prot) section that have experimental evidences,

xxxxxxxxxx
23
 
1
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
2
PREFIX up: <http://purl.uniprot.org/core/>
3
SELECT  
4
  ?protein
5
  ?rhea 
6
WHERE {
7
  # ECO 269 is experimental evidence
8
  BIND (<http://purl.obolibrary.org/obo/ECO_0000269> as ?evidence)
9
  GRAPH <http://sparql.uniprot.org/uniprot> {
10
    ?protein up:reviewed true ;
11
      up:annotation ?a ;
12
      up:attribution ?attribution  .
13
    ?a a up:Catalytic_Activity_Annotation ;
14
      up:catalyticActivity ?ca .
15
    ?ca up:catalyzedReaction ?rhea .
16
  
17
    [] rdf:subject ?a ;
18
      rdf:predicate up:catalyticActivity ;
19
      rdf:object ?ca ;
20
      up:attribution ?attribution .
21
    ?attribution up:evidence ?evidence .
22
  }
23
}
Use

40: Retrieve human enzymes that metabolize sphingolipids and are annotated in ChEMBL

xxxxxxxxxx
17
 
1
PREFIX CHEBI: <http://purl.obolibrary.org/obo/CHEBI_>
2
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
3
PREFIX rh: <http://rdf.rhea-db.org/>
4
PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
5
PREFIX up: <http://purl.uniprot.org/core/>
6
SELECT DISTINCT ?protein ?chemblEntry
7
WHERE {
8
  SERVICE <https://sparql.rhea-db.org/sparql> {
9
    ?rhea rdfs:subClassOf rh:Reaction ;
10
      rh:side/rh:contains/rh:compound/rh:chebi/rdfs:subClassOf+ CHEBI:26739 .
11
  }
12
  ?ca up:catalyzedReaction ?rhea .
13
  ?protein up:annotation/up:catalyticActivity ?ca ;
14
    up:organism taxon:9606 ;
15
    rdfs:seeAlso ?chemblEntry .
16
  ?chemblEntry up:database <http://purl.uniprot.org/database/ChEMBL> .
17
}
Use

41: Retrieve UniProtKB entries with sequences that are composed of fragments

xxxxxxxxxx
8
 
1
PREFIX up: <http://purl.uniprot.org/core/>
2
SELECT DISTINCT 
3
  ?protein
4
WHERE {
5
  ?protein a up:Protein ;
6
    up:sequence ?sequence .
7
  MINUS { ?sequence up:fragment [] }
8
}
Use

42: Connect patents cited in UniProtKB with those in the patent database at EPO via publication number.

xxxxxxxxxx
14
 
1
PREFIX patent: <http://data.epo.org/linked-data/def/patent/>
2
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
3
PREFIX up: <http://purl.uniprot.org/core/>
4
SELECT ?citation ?patent ?application ?applicationNo
5
WHERE
6
{
7
  ?citation a up:Patent_Citation ;
8
    skos:exactMatch ?patent .
9
  FILTER(CONTAINS(STR(?patent), 'EP'))
10
  BIND(SUBSTR(STR(?patent), 35) AS ?applicationNo)
11
  SERVICE <https://data.epo.org/linked-data/query>{
12
    ?application patent:publicationNumber ?applicationNo
13
  }
14
}
Use

43: Connect patents cited in UniProtKB with those in the patent database at EPO via publication number, whose grant date is more than twenty years in the past.

xxxxxxxxxx
19
 
1
PREFIX patent: <http://data.epo.org/linked-data/def/patent/>
2
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
3
PREFIX up: <http://purl.uniprot.org/core/>
4
SELECT ?grantDate ?patent ?application ?applicationNo
5
WHERE
6
{
7
    ?citation a up:Patent_Citation ;
8
  skos:exactMatch ?patent .
9
  BIND(SUBSTR(STR(?patent), 35) AS ?applicationNo)
10
  BIND(SUBSTR(STR(?patent), 33, 2) AS ?countryCode)
11
  SERVICE <https://data.epo.org/linked-data/query>{
12
    ?publication patent:publicationNumber ?applicationNo ;
13
      patent:application ?application .
14
    ?application patent:grantDate ?grantDate .
15
  }
16
  BIND((year(now()) - 20) AS ?thisYearMinusTwenty)
17
  BIND(year(?grantDate) AS ?grantYear)
18
  FILTER(?grantYear < ?thisYearMinusTwenty)
19
} ORDER BY ?grantYear
Use

44: Find the Rhea and InterPro combinations in UniProtKB entries.

xxxxxxxxxx
14
 
1
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
2
PREFIX up: <http://purl.uniprot.org/core/>
3
SELECT 
4
    ?interpro
5
    ?rhea
6
FROM <http://sparql.uniprot.org/uniprot>
7
WHERE 
8
{
9
  ?protein up:reviewed true .
10
  ?protein up:annotation ?annotation .
11
  ?annotation up:catalyticActivity ?rhea .
12
  ?protein rdfs:seeAlso ?interpro .
13
  ?interpro up:database <http://purl.uniprot.org/database/InterPro> .
14
} ORDER BY ?rhea
Use

45: Retrieve drugs that target human enzymes involved in sterol metabolism (federated query with WikiData and Rhea).

xxxxxxxxxx
52
 
1
PREFIX CHEBI: <http://purl.obolibrary.org/obo/CHEBI_>
2
PREFIX chebihash: <http://purl.obolibrary.org/obo/chebi#>
3
PREFIX owl: <http://www.w3.org/2002/07/owl#>
4
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
5
PREFIX rh: <http://rdf.rhea-db.org/>
6
PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
7
PREFIX uniprotkb: <http://purl.uniprot.org/uniprot/>
8
PREFIX up: <http://purl.uniprot.org/core/>
9
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
10
SELECT DISTINCT ?protein ?proteinFullName ?wikiChemical ?wikiChemicalLabel ?medicalConditionTreatedLabel
11
WHERE {
12
  # ChEBI: retrieve members of the ChEBI class ChEBI:15889 (sterol)
13
  # Rhea: retrieve the reactions involving these ChEBI as participants
14
  SERVICE <https://sparql.rhea-db.org/sparql> {
15
    ?reaction rdfs:subClassOf rh:Reaction ;
16
      rh:status rh:Approved ;
17
      rh:side ?reactionSide .
18
    ?reactionSide
19
      rh:contains ?participant .
20
    ?participant rh:compound ?compound
21
    {
22
      ?compound rh:chebi ?chebi .
23
      ?chebi (rdfs:subClassOf)+ CHEBI:15889
24
    } UNION {
25
      ?compound rh:chebi ?chebi .
26
      ?chebi2 rdfs:subClassOf ?chebiRestriction .
27
      ?chebiRestriction
28
        a owl:Restriction ;
29
        owl:onProperty chebihash:has_major_microspecies_at_pH_7_3 ;
30
        owl:someValuesFrom ?chebi .
31
      ?chebi2 (rdfs:subClassOf)+ CHEBI:15889
32
    }
33
  }
34
  # UniProt: retrieve the human (taxid:9606) enzymes catalyzing these Rhea reactions
35
  ?ca up:catalyzedReaction  ?reaction .
36
  ?a up:catalyticActivity  ?ca .
37
  ?proteinIRI  up:annotation ?a ;
38
    up:organism taxon:9606 ;
39
    up:recommendedName ?proteinRecName .
40
  ?proteinRecName up:fullName ?proteinFullName .
41
  # Find drugs in wikidata that interact with the UniProt Proteins
42
  BIND (SUBSTR(STR(?proteinIRI), STRLEN(STR(uniprotkb:))+1) AS ?protein)
43
  SERVICE <https://query.wikidata.org/sparql> {
44
    ?wp wdt:P352  ?protein .
45
    ?wikiChemical wdt:P129 ?wp . # Physically interacts with
46
    ?wikiChemical rdfs:label ?wikiChemicalLabel .
47
    ?wikiChemical wdt:P2175 ?wmc . # Medical conndition treated
48
    ?wmc rdfs:label ?medicalConditionTreatedLabel .
49
    FILTER(lang(?medicalConditionTreatedLabel) = 'en')
50
    FILTER(lang(?wikiChemicalLabel) = 'en')
51
  }
52
}
Use

46: Retrieve images of 'Anas' (Ducks) from the European Environmental Agency databases (federated query).

xxxxxxxxxx
27
 
1
PREFIX eunisSpecies: <http://eunis.eea.europa.eu/rdf/species-schema.rdf#>
2
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
3
PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
4
PREFIX up: <http://purl.uniprot.org/core/>
5
SELECT 
6
    ?taxon
7
    ?ncbiTaxid
8
    ?eunisTaxon
9
    ?eunisName 
10
    ?image
11
WHERE
12
{
13
    GRAPH <http://sparql.uniprot.org/taxonomy>
14
    {
15
        ?taxon a up:Taxon .
16
        # Taxon subclasses are materialized, do not use rdfs:subClassOf+
17
        ?taxon rdfs:subClassOf taxon:8835 .
18
        BIND(strafter(str(?taxon), 'onomy/') AS ?ncbiTaxid)
19
    }
20
    SERVICE <https://semantic.eea.europa.eu/sparql>
21
    {
22
        ?eunisTaxon a eunisSpecies:SpeciesSynonym ;
23
           eunisSpecies:binomialName ?eunisName ;
24
           eunisSpecies:sameSpeciesNCBI ?ncbiTaxid ;
25
           <http://xmlns.com/foaf/0.1/depiction> ?image .
26
    }
27
}
Use

47: Find UniProtKB entries with a transmembrane region, with an alanine in the 15 amino acid region preceding the transmembrane

xxxxxxxxxx
24
 
1
PREFIX faldo: <http://biohackathon.org/resource/faldo#>
2
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
3
PREFIX up: <http://purl.uniprot.org/core/>
4
SELECT ?protein ?from ?interestingRegion
5
WHERE
6
{
7
  ?protein up:annotation ?annotation .
8
  ?annotation a up:Transmembrane_Annotation .
9
  # Get the coordinates of the Transmembrane
10
  ?annotation up:range ?range .
11
  ?range faldo:begin ?beginI .
12
  ?beginI faldo:position ?begin .
13
  ?beginI faldo:reference ?sequence .
14
  # The aas will have the specific IUPAC aminoacids
15
  ?sequence rdf:value ?aas .
16
  # We calculate the start by substracting 10
17
  BIND(?begin - 10 AS ?tenBeforeBegin)
18
  # Can't start before the sequence starts or we might miss some results
19
  BIND(IF(?tenBeforeBegin < 1, 0, ?tenBeforeBegin) AS ?from)
20
  # Substring the IUPAC aminoacids
21
  BIND(SUBSTR(?aas, ?from, 15) AS ?interestingRegion)
22
  # The interestingRegion needds to contain an Alanine
23
  FILTER(CONTAINS(?interestingRegion, 'A'))
24
}
Use

48: Retrieve glycosylation sites and glycans on human enzymes (federated with Glyconnect)

xxxxxxxxxx
23
 
1
PREFIX faldo: <http://biohackathon.org/resource/faldo#>
2
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
3
PREFIX glycan: <http://purl.jp/bio/12/glyco/glycan#>
4
PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
5
PREFIX up: <http://purl.uniprot.org/core/>
6
SELECT
7
        DISTINCT
8
            ?protein ?glycosite ?glycostructure ?glycoimage
9
WHERE{
10
  ?protein up:annotation ?annotation .
11
  ?protein up:organism taxon:9606 .
12
  ?annotation a up:Catalytic_Activity_Annotation .
13
  ?protein up:sequence ?isoform .
14
   
15
  SERVICE <https://glyconnect.expasy.org/sparql> {
16
    ?glycosite faldo:reference ?isoform .
17
    ?glycosite faldo:position ?position .
18
    ?specificglycosite faldo:location ?glycosite .
19
    ?glycoprotein glycan:glycosylated_at ?specificglycosite .
20
    ?glycostructure glycan:glycosylates_at ?specificglycosite .
21
    ?glycostructure foaf:depiction ?glycoimage .
22
  }
23
}
Use

49: Retrieve the UniProtKB proteins, their catalyzed Rhea reactions, their encoding genes (Ensembl) and the anatomic entities where the genes are expressed (UBERON anatomic entites from Bgee expression data resource).

xxxxxxxxxx
38
 
1
PREFIX CHEBI: <http://purl.obolibrary.org/obo/CHEBI_>
2
PREFIX genex: <http://purl.org/genex#>
3
PREFIX lscr: <http://purl.org/lscr#>
4
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
5
PREFIX rh: <http://rdf.rhea-db.org/>
6
PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
7
PREFIX up: <http://purl.uniprot.org/core/>
8
SELECT DISTINCT ?protein ?ensemblGene ?reaction ?anatomicEntityLabel ?anatomicEntity
9
WHERE {
10
  # federated query to Rhea enadpoint
11
  {
12
    SELECT DISTINCT ?reaction WHERE {
13
      SERVICE <https://sparql.rhea-db.org/sparql> {
14
        ?reaction rdfs:subClassOf rh:Reaction ;
15
          rh:equation ?reactionEquation ;
16
          rh:side ?reactionSide .
17
        ?reactionSide rh:contains ?participant .
18
        ?participant rh:compound ?compound .
19
        # compound constraint (CHEBI:16113 == cholesterol)
20
        ?compound rh:chebi CHEBI:16113 .
21
      }
22
    }
23
  }
24
  # taxonomy constraint (taxon:9606 == Homo sapiens)
25
  ?protein up:organism taxon:9606 ;
26
    up:annotation ?a ;
27
    rdfs:seeAlso / up:transcribedFrom ?ensemblGene .
28
  ?a a up:Catalytic_Activity_Annotation ;
29
    up:catalyticActivity ?ca .
30
  ?ca up:catalyzedReaction ?reaction .
31
  # federated query to Bgee (expression data)
32
  BIND(IRI(REPLACE(STR(?ensemblGene), "\\.[0-9]+$", "")) AS ?ensemblGeneNoVersion)
33
  SERVICE <https://www.bgee.org/sparql> {
34
    ?gene lscr:xrefEnsemblGene ?ensemblGeneNoVersion ;
35
      genex:isExpressedIn ?anatomicEntity .
36
    ?anatomicEntity rdfs:label ?anatomicEntityLabel .
37
  }
38
}
Use

50: Where are the human genes encoding enzymes metabolizing N-acyl sphingosines expressed in the human body (federated query, with Rhea and Bgee)

xxxxxxxxxx
36
 
1
PREFIX CHEBI: <http://purl.obolibrary.org/obo/CHEBI_>
2
PREFIX genex: <http://purl.org/genex#>
3
PREFIX lscr: <http://purl.org/lscr#>
4
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
5
PREFIX rh: <http://rdf.rhea-db.org/>
6
PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
7
PREFIX up: <http://purl.uniprot.org/core/>
8
SELECT
9
  DISTINCT
10
    ?chebi
11
    ?reaction
12
    ?protein ?ensemblGene
13
    ?anatomicEntityLabel
14
    ?anatomicEntity
15
WHERE {
16
  SERVICE <https://sparql.rhea-db.org/sparql> {
17
    ?reaction rdfs:subClassOf rh:Reaction .
18
    ?reaction rh:equation ?reactionEquation .
19
    ?reaction rh:side ?reactionSide .
20
    ?reactionSide rh:contains ?participant .
21
    ?participant rh:compound ?compound .
22
    ?compound rh:chebi ?chebi .
23
    ?chebi rdfs:subClassOf* CHEBI:52639
24
}
25
  ?protein up:organism taxon:9606 .
26
  ?protein up:annotation ?a .
27
  ?a a up:Catalytic_Activity_Annotation .
28
  ?a up:catalyticActivity ?ca .
29
  ?ca up:catalyzedReaction ?reaction .
30
  ?protein rdfs:seeAlso / up:transcribedFrom ?ensemblGene .
31
  SERVICE  <https://www.bgee.org/sparql> {
32
    ?gene genex:isExpressedIn ?anatomicEntity .
33
    ?gene lscr:xrefEnsemblGene ?ensemblGene .
34
    ?anatomicEntity rdfs:label ?anatomicEntityLabel .
35
  }
36
}
Use

51: Find all proteins linked to arachidonate (CHEBI:32395)

xxxxxxxxxx
24
 
1
PREFIX CHEBI: <http://purl.obolibrary.org/obo/CHEBI_>
2
PREFIX rh: <http://rdf.rhea-db.org/>
3
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
4
PREFIX up: <http://purl.uniprot.org/core/>
5
SELECT 
6
    DISTINCT
7
        ?uniprot
8
        ?uniprotID
9
        ?recname
10
        ?gene
11
        ?chebi
12
        ?uniprotName
13
WHERE {
14
  SERVICE <https://sparql.rhea-db.org/sparql> {
15
     VALUES (?chebi) { (CHEBI:32395) }
16
     ?rhea rh:side/rh:contains/rh:compound ?compound .
17
     ?compound rh:chebi ?chebi .
18
     ?chebi up:name ?uniprotName .
19
  }
20
  ?uniprot up:annotation/up:catalyticActivity/up:catalyzedReaction ?rhea .
21
  ?uniprot up:mnemonic ?uniprotID .
22
  ?uniprot up:recommendedName/up:fullName ?recname .
23
  OPTIONAL {?uniprot up:encodedBy/skos:prefLabel ?gene .}
24
}
Use