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

 
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

52: Retrieve drugs that target human enzymes involved in sterol metabolism (federated query with Rhea and ChEMBL via IDSM/Elixir czech republic).

xxxxxxxxxx
69
 
1
PREFIX CHEBI: <http://purl.obolibrary.org/obo/CHEBI_>
2
PREFIX cco: <http://rdf.ebi.ac.uk/terms/chembl#>
3
PREFIX chebihash: <http://purl.obolibrary.org/obo/chebi#>
4
PREFIX owl: <http://www.w3.org/2002/07/owl#>
5
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
6
PREFIX rh: <http://rdf.rhea-db.org/>
7
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
8
PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
9
PREFIX up: <http://purl.uniprot.org/core/>
10
SELECT
11
        DISTINCT
12
            ?protein
13
            ?proteinFullName
14
            ?activityType
15
            ?standardActivityValue
16
            ?standardActivityUnit
17
            ?chemblMolecule
18
            ?chemlbMoleculePrefLabel
19
WHERE
20
  {
21
  # ChEBI: retrieve members of the ChEBI class ChEBI:15889 (sterol)
22
  # Rhea: retrieve the reactions involving these ChEBI as participants
23
  SERVICE <https://sparql.rhea-db.org/sparql> {
24
    ?reaction rdfs:subClassOf  rh:Reaction ;
25
          rh:status        rh:Approved ;
26
          rh:side          ?reactionSide .
27
    ?reactionSide
28
          rh:contains      ?participant .
29
    ?participant rh:compound  ?compound
30
    {
31
      ?compound  rh:chebi  ?chebi .
32
      ?chebi (rdfs:subClassOf)+ CHEBI:15889
33
    } UNION {
34
      ?compound  rh:chebi           ?chebi .
35
      ?chebi2   rdfs:subClassOf     ?chebiRestriction .
36
      ?chebiRestriction
37
        a           owl:Restriction ;
38
        owl:onProperty      chebihash:has_major_microspecies_at_pH_7_3 ;
39
        owl:someValuesFrom  ?chebi .
40
      ?chebi2 (rdfs:subClassOf)+ CHEBI:15889
41
    }
42
  }
43
  # UniProt: retrieve the human (taxid:9606) enzymes catalyzing these Rhea reactions
44
  ?ca       up:catalyzedReaction  ?reaction .
45
  ?a        up:catalyticActivity  ?ca .
46
  ?protein  up:annotation         ?a ;
47
        up:organism           taxon:9606 ;
48
        up:recommendedName    ?proteinRecName .
49
  ?proteinRecName
50
        up:fullName           ?proteinFullName .
51
  # Find drugs in wikidata that interact with the UniProt Proteins
52
  # ChEMBL: retrieve the corresponding targets and with drugs in clinical phase 4
53
  # Via https://idsm.elixir-czech.cz/sparql/
54
  SERVICE <https://idsm.elixir-czech.cz/sparql/endpoint/idsm> {
55
    ?activity a cco:Activity ;
56
      cco:hasMolecule ?chemblMolecule ;
57
      cco:hasAssay ?assay ;
58
      cco:standardType ?activityType ;
59
      cco:standardValue ?standardActivityValue ;
60
      cco:standardUnits ?standardActivityUnit .
61
    ?chemblMolecule cco:highestDevelopmentPhase ?highestDevelopmentPhase ;
62
      rdfs:label ?chemblMoleculeLabel ;
63
      skos:prefLabel ?chemlbMoleculePrefLabel .
64
    FILTER (?highestDevelopmentPhase > 3)
65
    ?assay cco:hasTarget ?target .
66
    ?target cco:hasTargetComponent/cco:targetCmptXref ?protein .
67
    ?protein a cco:UniprotRef .
68
  }
69
}
Use

53: Find mouse homologs in OMABrowser of human enzymes that catalyze reactions involving sterols (CHEBI:15889). Federating with Rhea and OMABrowser.

xxxxxxxxxx
37
 
1
PREFIX CHEBI: <http://purl.obolibrary.org/obo/CHEBI_>
2
PREFIX lscr: <http://purl.org/lscr#>
3
PREFIX orth: <http://purl.org/net/orth#>
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
    ?humanProtein
13
    ?mouseProtein
14
    ?cluster 
15
WHERE {
16
  SERVICE <https://sparql.rhea-db.org/sparql> {
17
    ?reaction rdfs:subClassOf rh:Reaction .
18
    ?reaction rh:side/rh:contains/rh:compound ?compound .
19
    ?compound rh:chebi ?chebi .
20
    ?chebi rdfs:subClassOf* CHEBI:15889
21
  }
22
  ?humanProtein up:organism taxon:9606 .
23
  ?humanProtein up:annotation ?a .
24
  ?a a up:Catalytic_Activity_Annotation .
25
  ?a up:catalyticActivity ?ca .
26
  ?ca up:catalyzedReaction ?reaction .
27
  SERVICE  <https://sparql.omabrowser.org/sparql> {
28
    ?cluster a orth:ParalogsCluster .
29
    ?cluster orth:hasHomologousMember ?node1 , ?node2 .
30
    ?node1 orth:hasHomologousMember* ?orthoProtein1 .
31
    ?node2 orth:hasHomologousMember* ?orthoProtein2 .
32
    ?orthoProtein1 lscr:xrefUniprot ?mouseProtein .
33
    ?orthoProtein2 lscr:xrefUniprot ?humanProtein .
34
    # inTaxon mouse
35
    ?orthoProtein1 orth:organism/<http://purl.obolibrary.org/obo/RO_0002162> taxon:10090 . 
36
  }
37
}
Use

54: Proteins with binding sites for ligands similar to heme

xxxxxxxxxx
29
 
1
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
2
PREFIX sachem: <http://bioinfo.uochb.cas.cz/rdf/v1.0/sachem#>
3
PREFIX up: <http://purl.uniprot.org/core/>
4
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
5
SELECT 
6
  ?protein
7
  ?mnemonic
8
  ?proteinName
9
  ?ligandSimilarityScore
10
  ?ligand
11
WHERE {
12
  SERVICE <https://idsm.elixir-czech.cz/sparql/endpoint/chebi> {
13
    ?ssc sachem:compound ?ligand; 
14
      sachem:score ?ligandSimilarityScore ;
15
      sachem:similaritySearch ?sss .
16
        # Smiles of Heme
17
    ?sss    sachem:query "CC1=C(CCC([O-])=O)C2=[N+]3C1=Cc1c(C)c(C=C)c4C=C5C(C)=C(C=C)C6=[N+]5[Fe-]3(n14)n1c(=C6)c(C)c(CCC([O-])=O)c1=C2";
18
      sachem:cutoff "8e-1"^^xsd:double ;
19
      sachem:aromaticityMode sachem:aromaticityDetect ;
20
      sachem:similarityRadius 1 ;
21
      sachem:tautomerMode sachem:ignoreTautomers .
22
  }
23
  ?protein up:mnemonic ?mnemonic ;
24
    up:recommendedName/up:fullName ?proteinName ;
25
    up:annotation ?annotation .
26
  ?annotation a up:Binding_Site_Annotation ;
27
      up:ligand/rdfs:subClassOf ?ligand .
28
}
29
ORDER BY DESC(?ligandSimilarityScore)
Use

55: Number of proteins with binding sites for metals or metal sulfur clusters (and experimental evidence for the binding)

xxxxxxxxxx
24
 
1
PREFIX CHEBI: <http://purl.obolibrary.org/obo/CHEBI_>
2
PREFIX obo: <http://purl.obolibrary.org/obo/>
3
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
4
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
5
PREFIX up: <http://purl.uniprot.org/core/>
6
SELECT
7
  ?ligand
8
  ?ligandName 
9
  (COUNT(DISTINCT ?protein) as ?entries)
10
WHERE {
11
   ?protein up:annotation ?annotation .
12
   
13
   VALUES ?evs { obo:ECO_0000269 obo:ECO_0007744 } .
14
   VALUES ?chebids { CHEBI:25213 CHEBI:25214 } .
15
   ?st rdf:subject ?protein ; 
16
       rdf:predicate up:annotation ; 
17
       rdf:object ?annotation ;
18
       up:attribution/up:evidence ?evs .
19
   ?annotation up:ligand/rdfs:subClassOf ?ligand .
20
   ?ligand rdfs:subClassOf+ ?chebids ;
21
     rdfs:label ?ligandName .
22
}
23
GROUP BY ?ligand ?ligandName
24
ORDER BY DESC(?entries)
Use

56: Select enzymes that have ligands known to have an allosteric effect

xxxxxxxxxx
16
 
1
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
2
PREFIX up: <http://purl.uniprot.org/core/>
3
SELECT
4
  ?protein
5
  ?ligandName 
6
  ?ligandNote
7
  ?chebi
8
WHERE {
9
   ?protein up:annotation ?annotation .
10
   ?annotation a up:Binding_Site_Annotation . 
11
   ?annotation up:ligand ?ligand .
12
   ?ligand rdfs:comment ?ligandNote ;
13
     rdfs:subClassOf ?chebi ;
14
     rdfs:label ?ligandName .
15
   FILTER(REGEX(?ligandNote, "allosteric", "i"))
16
}
Use

57: Map a selection of PDB identifiers plus chains to UniProtKB

xxxxxxxxxx
20
 
1
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
2
PREFIX up: <http://purl.uniprot.org/core/>
3
SELECT
4
  ?pdbId ?chain ?pdbChain ?uniprot
5
WHERE
6
{
7
  # A space separated list of pairs of PDB identifiers and the chain code.
8
  VALUES(?pdbId ?pdbChain) { ('6VXC' 'A') ('1BG3' 'B') }
9
  # Make an IRI out of the pdbId
10
  BIND(iri(concat('http://rdf.wwpdb.org/pdb/', ?pdbId)) AS ?pdb)
11
  # Map to UniProt entries
12
  ?uniprot rdfs:seeAlso ?pdb .
13
  ?pdb up:database <http://purl.uniprot.org/database/PDB> ;
14
       up:chainSequenceMapping ?chainSm .
15
  ?chainSm up:chain ?chainsPlusRange .
16
  # Extract the list of chains from the text representation.
17
  BIND(STRBEFORE(?chainsPlusRange, '=') AS ?chain)
18
  # Filter those that match.
19
  FILTER(CONTAINS(?chain, ?pdbChain))
20
}
Use

58: Map a selection of UniProtKB accession numbers (ACs) to HGNC identifiers and symbols

xxxxxxxxxx
16
 
1
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
2
PREFIX uniprotkb: <http://purl.uniprot.org/uniprot/>
3
PREFIX up: <http://purl.uniprot.org/core/>
4
SELECT
5
  ?uniprot
6
  ?hgnc
7
  ?hgncSymbol
8
WHERE
9
{
10
  # A space separated list of UniProt primary accessions.
11
  VALUES (?acc) {('P05067') ('P00750')}
12
  BIND(iri(concat(str(uniprotkb:), ?acc)) AS ?uniprot)
13
  ?uniprot rdfs:seeAlso ?hgnc .
14
  ?hgnc up:database <http://purl.uniprot.org/database/HGNC> ;
15
       rdfs:comment ?hgncSymbol .
16
}
Use

59: Count all isoforms for a given proteome

xxxxxxxxxx
13
 
1
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
2
PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
3
PREFIX up: <http://purl.uniprot.org/core/>
4
PREFIX proteome:<http://purl.uniprot.org/proteomes/>
5
SELECT
6
  (COUNT(DISTINCT ?sequence) AS ?allIsoforms)
7
WHERE
8
{
9
  ?protein up:reviewed true .
10
  ?protein up:organism taxon:9606 .
11
  ?protein up:sequence ?sequence .
12
  ?protein up:proteome/^skos:narrower proteome:UP000005640 .
13
}
Use

60: Find human proteins that catalyze reactions where substrates or product have a Cholestane skeleton

xxxxxxxxxx
35
 
1
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
2
PREFIX rh: <http://rdf.rhea-db.org/>
3
PREFIX sachem: <http://bioinfo.uochb.cas.cz/rdf/v1.0/sachem#>
4
PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
5
PREFIX up: <http://purl.uniprot.org/core/>
6
SELECT
7
  DISTINCT
8
    ?protein
9
    ?disease
10
    ?rhea
11
    ?chebi
12
    ?omim
13
WHERE {
14
    # Find complete ChEBIs with a Cholestane skeleton, via the Czech Elixir node IDSM Sachem chemical substructure search.
15
    SERVICE <https://idsm.elixir-czech.cz/sparql/endpoint/chebi> {
16
      ?chebi sachem:substructureSearch [
17
        sachem:query
18
"[C@]12(CCC3CCCC[C@]3(C)[C@@]1([H])CC[C@]1(C)[C@@]([H])([C@@](C)([H])CCCC(C)C)CC[C@@]21[H])[H]"
19
].
20
   }
21
   # Use the fact that UniProt catalytic activities are annotated using Rhea 
22
   # Mapping the found ChEBIs to Rhea reactions
23
   SERVICE <https://sparql.rhea-db.org/sparql>{
24
     ?rhea rh:side/rh:contains/rh:compound/rdfs:subClassOf ?chebi .
25
   }
26
   # Match the found Rhea reactions with human UniProtKB proteins
27
   ?protein up:annotation/up:catalyticActivity/up:catalyzedReaction ?rhea .
28
   ?protein up:organism taxon:9606 .
29
   # Find only those human entries that have an annotated related disease, and optionaly map these to OMIM
30
   ?protein up:annotation/up:disease ?disease .
31
   OPTIONAL {
32
     ?disease rdfs:seeAlso ?omim .
33
     ?omim up:database <http://purl.uniprot.org/database/MIM>
34
   }
35
}
Use

61: Select the Gene Protein Reaction sets for Human (Ensembl Gene, Human UniProtKB, Catalyzed Rhea reactions)

xxxxxxxxxx
15
 
1
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
2
PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
3
PREFIX up: <http://purl.uniprot.org/core/>
4
SELECT
5
?ensemblGene ?protein ?rhea
6
WHERE {
7
  ?protein up:reviewed true ;
8
           up:organism taxon:9606 .
9
  ?protein up:annotation ?caa ;
10
           rdfs:seeAlso ?ensemblTranscript .
11
  ?ensemblTranscript up:database <http://purl.uniprot.org/database/Ensembl> .
12
    ?caa up:catalyticActivity ?ca .
13
  ?ca up:catalyzedReaction ?rhea .
14
  ?ensemblTranscript up:transcribedFrom ?ensemblGene 
15
}
Use

100_uniprot_organelles_or_plasmids: List the proteins encoded by a gene that is located in an organelle other than the nucleus, or on a plasmid rather than a chromosome. In these cases the gene location is stored with encodedIn properties. Note that if a plasmid has several names, they are listed as multiple rdfs:label properties.

xxxxxxxxxx
13
 
1
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
2
PREFIX up: <http://purl.uniprot.org/core/>
3
SELECT 
4
    ?protein 
5
    ?plasmidOrOrganelle
6
    ?label
7
WHERE {
8
    ?protein a up:Protein ;
9
      up:encodedIn ?plasmidOrOrganelle .
10
    OPTIONAL {
11
        ?plasmidOrOrganelle rdfs:label ?label .
12
    }
13
}
Use

101_uniprot_potential_isoforms: List all human UniProtKB entries and their computationaly mapped potential isoforms.

xxxxxxxxxx
14
 
1
PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
2
PREFIX up: <http://purl.uniprot.org/core/>
3
SELECT ?entry ?sequence ?isCanonical
4
WHERE {
5
  # We don't want to look into the UniParc graph which will 
6
  # confuse matters
7
  GRAPH <http://sparql.uniprot.org/uniprot> {
8
      # we need the UniProt entries that are human
9
      ?entry a up:Protein ;
10
        up:organism taxon:9606 ;
11
      # and we select the computationally mapped sequences
12
        up:potentialSequence ?sequence .
13
  }
14
}
Use

102_uniprot_primary_accession: Extracting an UniProtKB primary accession from our IRIs. Is done with a bit of string manipulation. While UniProt primary accession are unique within UniProtKB they may be reused by accident or itentionally by other data sources. If we provided them as strings (not IRI) and if you used them in a query that way, you might accidentaly retrieve completely wrong records.

xxxxxxxxxx
9
 
1
PREFIX uniprotkb: <http://purl.uniprot.org/uniprot/>
2
PREFIX up: <http://purl.uniprot.org/core/>
3
SELECT
4
  ?primaryAccession
5
  ?protein
6
WHERE {
7
  ?protein a up:Protein .
8
  BIND(substr(str(?protein), strlen(str(uniprotkb:))+1) AS ?primaryAccession)
9
}
Use

103_uniprot_proteome_location_of_gene: List UniProtKB proteins with genetic replicon that they are encoded on using the Proteome data.

xxxxxxxxxx
16
 
1
PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
2
PREFIX up: <http://purl.uniprot.org/core/>
3
SELECT
4
  DISTINCT
5
    ?proteomeData
6
    ?replicon
7
    ?proteome  
8
WHERE {
9
  # reviewed entries (UniProtKB/Swiss-Prot)
10
  ?protein up:reviewed true . 
11
  # restricted to Human taxid
12
  ?uniprot up:organism taxon:9606 . 
13
  ?uniprot up:proteome ?proteomeData .
14
  BIND( strbefore( str(?proteomeData), "#" ) as ?proteome )
15
  BIND( strafter( str(?proteomeData), "#" ) as ?replicon )
16
}
Use

104_uniprot_recomended_protein_full_name: The recommended protein full names for UniProtKB entries

xxxxxxxxxx
8
 
1
PREFIX up: <http://purl.uniprot.org/core/>
2
SELECT ?protein
3
  ?fullName
4
WHERE {
5
  ?protein a up:Protein ;
6
           up:recommendedName ?recommendedName .
7
  ?recommendedName up:fullName ?fullName .
8
}
Use

105_uniprot_recomended_protein_short_name: The recommended protein short names for UniProtKB entries

xxxxxxxxxx
8
 
1
PREFIX up: <http://purl.uniprot.org/core/>
2
SELECT ?protein 
3
  ?fullName
4
WHERE {
5
  ?protein a up:Protein ;
6
           up:recommendedName ?recommendedName .
7
  ?recommendedName up:shortName ?fullName .
8
}
Use

106_uniprot_reviewed_or_not: List all UniProtKB proteins and if they are reviewed (Swiss-Prot) or unreviewed (TrEMBL)

xxxxxxxxxx
8
 
1
PREFIX up: <http://purl.uniprot.org/core/>
2
SELECT
3
  ?protein
4
  ?reviewed
5
WHERE {
6
  ?protein a up:Protein . 
7
  ?protein up:reviewed ?reviewed . 
8
}
Use

107_uniprot_sequences_and_mark_which_is_cannonical_for_human: List all human UniProtKB entries and their sequences, marking if the sequence listed is the cannonical sequence of the matching entry.

xxxxxxxxxx
29
 
1
PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
2
PREFIX up: <http://purl.uniprot.org/core/>
3
SELECT ?entry ?sequence ?isCanonical
4
WHERE {
5
  # We don't want to look into the UniParc graph which will 
6
  # confuse matters
7
  GRAPH <http://sparql.uniprot.org/uniprot> {
8
      # we need the UniProt entries that are human
9
      ?entry a up:Protein ;
10
    up:organism taxon:9606 ;
11
        up:sequence ?sequence .
12
      # If the sequence is a "Simple_Sequence" it is likely to be the 
13
      # cannonical sequence
14
      OPTIONAL {
15
        ?sequence a up:Simple_Sequence .
16
        BIND(true AS ?likelyIsCanonical)
17
      }
18
      # unless we are dealing with an external isoform
19
      # see https://www.uniprot.org/help/canonical_and_isoforms
20
      OPTIONAL {
21
        FILTER(?likelyIsCanonical)
22
        ?sequence a up:External_Sequence .
23
        BIND(true AS ?isComplicated)
24
      }
25
      # If it is an external isoform it's id would not match the 
26
      # entry primary accession
27
      BIND(IF(?isComplicated, STRENDS(STR(?entry), STRBEFORE(SUBSTR(STR(?sequence), 34),'-')),?likelyIsCanonical) AS ?isCanonical)
28
  }
29
}
Use

108_uniprot_signature_match_start_end: List all InterPro member database signature match start and end for a specific UniProtKB protein.

xxxxxxxxxx
22
 
1
PREFIX faldo: <http://biohackathon.org/resource/faldo#>
2
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
3
PREFIX up: <http://purl.uniprot.org/core/>
4
SELECT 
5
  ?protein ?interproMemberDatabaseXref ?matchStart ?matchEnd
6
WHERE{
7
  GRAPH <http://sparql.uniprot.org/uniprot> {
8
    VALUES ?protein {<http://purl.uniprot.org/uniprot/P05067>} .
9
    ?protein rdfs:seeAlso ?sa .
10
  }
11
  GRAPH <http://sparql.uniprot.org/uniparc> {
12
    ?uniparc up:sequenceFor ?protein ;
13
      rdfs:seeAlso ?interproMemberDatabaseXref .
14
    ?interproDatabaseXref up:signatureSequenceMatch ?sam .
15
    ?sam faldo:begin ?sab ;
16
      faldo:end ?sae .
17
    ?sab faldo:position ?matchStart ;
18
      faldo:reference ?uniparc .
19
    ?sae  faldo:position ?matchEnd ;
20
      faldo:reference ?uniparc .
21
  }
22
}
Use

109_uniprot_transporter_in_liver: Find human transporter proteins in reviewed UniProtKB/Swiss-Prot, that are expressed in the liver (Uses Bgee and UBERON).

xxxxxxxxxx
29
 
1
PREFIX genex: <http://purl.org/genex#>
2
PREFIX lscr: <http://purl.org/lscr#>
3
PREFIX obo: <http://purl.obolibrary.org/obo/>
4
PREFIX orth: <http://purl.org/net/orth#>
5
PREFIX rh: <http://rdf.rhea-db.org/>
6
PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
7
PREFIX uberon: <http://purl.obolibrary.org/obo/uo#>
8
PREFIX up: <http://purl.uniprot.org/core/>
9
SELECT
10
  ?rhea
11
  ?protein
12
  ?anat
13
WHERE
14
{
15
  GRAPH <https://sparql.rhea-db.org/rhea> {
16
    ?rhea rh:isTransport true .
17
  }
18
  ?protein up:annotation ?ann .
19
  ?protein up:organism taxon:9606 .
20
  ?ann up:catalyticActivity ?ca .
21
  ?ca up:catalyzedReaction ?rhea .
22
  BIND(uberon:0002107 AS ?anat)
23
  SERVICE <https://www.bgee.org/sparql> {
24
    ?seq genex:isExpressedIn ?anat .
25
    ?seq lscr:xrefUniprot ?protein .
26
    ?seq orth:organism ?organism .
27
    ?organism obo:RO_0002162 taxon:9606 .
28
  }
29
}
Use

110_uniprot_unamed_plasmids: Sometimes it is known that a gene encoding a protein UniProtKB is located on a plasmid or an organelle, but the name of the plasmid is unknown.

xxxxxxxxxx
13
 
1
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
2
PREFIX up: <http://purl.uniprot.org/core/>
3
SELECT 
4
    ?protein 
5
    ?plasmidOrOrganelle
6
    ?label
7
WHERE {
8
    ?protein a up:Protein ;
9
      up:encodedIn ?plasmidOrOrganelle .
10
    OPTIONAL {
11
        ?plasmidOrOrganelle rdfs:label ?label .
12
    }
13
}
Use

111_uniprot_make_chain_sequence_fasta: Given an UniProt chain identifier, generate the matching sequence as a FASTA

xxxxxxxxxx
12
 
1
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
2
PREFIX up: <http://purl.uniprot.org/core/>
3
PREFIX faldo: <http://biohackathon.org/resource/faldo#>
4
SELECT (CONCAT('>', ?chainSeqId, '\n', (SUBSTR(?iupacAA, ?begin, (?end-?begin+1))))  AS ?chainFasta)
5
WHERE {
6
  BIND("PRO_0000268053" AS ?chainSeqId) 
7
  BIND(IRI(CONCAT("http://purl.uniprot.org/annotation/", ?chainSeqId)) AS ?annId)
8
  ?annId up:range ?range .
9
  ?range faldo:begin [ faldo:reference ?reference ; faldo:position ?begin ] ;
10
     faldo:end [ faldo:position ?end ] .
11
  ?reference rdf:value ?iupacAA .
12
}
Use

62_diseases_involving_enzymes: Find diseases that are thought to be related to enzymes

xxxxxxxxxx
11
 
1
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
2
PREFIX up: <http://purl.uniprot.org/core/>
3
SELECT
4
?disease ?diseaseLabel
5
WHERE {
6
 ?protein up:enzyme|up:annotation/up:catalyticActivity/up:enzymeClass ?enzyme ;
7
                   up:annotation ?diseaseAnnotation .
8
 ?diseaseAnnotation a up:Disease_Annotation ;
9
                    up:disease ?disease .
10
 ?disease skos:prefLabel ?diseaseLabel .
11
}
Use

63_diseases_involving_enzymes_located_in_mitochondrion: Find (Human genetic) diseases that are thought to be related to Enzymes, known to be located in the Mitochondrion

xxxxxxxxxx
22
 
1
PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
2
PREFIX up: <http://purl.uniprot.org/core/>
3
SELECT
4
  DISTINCT
5
    ?disease
6
WHERE {
7
  ?protein a up:Protein ;
8
  up:organism taxon:9606 ;
9
  up:annotation ?disease_annotation ,
10
                ?subcellularLocation .
11
  {
12
    ?protein up:enzyme [] .
13
  } UNION {
14
    ?protein up:annotation/a up:Catalytic_Activity_Annotation .
15
  }
16
  ?disease_annotation a up:Disease_Annotation ;
17
    up:disease ?disease .
18
  ?subcellularLocation a up:Subcellular_Location_Annotation ;
19
    up:locatedIn ?location .
20
  ?location up:cellularComponent ?component .
21
  ?component up:partOf* <http://purl.uniprot.org/locations/173> .
22
}
Use

64_diseases_related_to_mutation_in_active_site: Find (Human Genetic) diseases, that are related to a natural variant on the active site of an enzyme.

xxxxxxxxxx
33
 
1
PREFIX faldo: <http://biohackathon.org/resource/faldo#>
2
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
3
PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
4
PREFIX up: <http://purl.uniprot.org/core/>
5
SELECT
6
  DISTINCT
7
   ?disease
8
WHERE {
9
  ?protein a up:Protein ;
10
    up:organism taxon:9606 ;
11
    up:annotation ?disease_annotation, ?active_site_annotation, ?natural_variant_annotation .
12
  {
13
    ?protein up:enzyme [] .
14
  } UNION {
15
  ?protein up:annotation/a up:Catalytic_Activity_Annotation .
16
  }
17
  ?disease_annotation a up:Disease_Annotation ;
18
  up:disease ?disease .
19
  ?active_site_annotation a up:Active_Site_Annotation ;
20
  up:range ?active_site_range .
21
  ?active_site_range faldo:begin ?active_site_begin .
22
  ?active_site_begin faldo:position ?active_site_position ;
23
                     faldo:reference ?sequence .
24
  ?natural_variant_annotation a up:Natural_Variant_Annotation ;
25
  up:range ?natural_variant_range ;
26
  skos:related ?disease .
27
  ?natural_variant_range faldo:begin ?natural_variant_begin ;
28
                         faldo:end ?natural_variant_end .
29
  ?natural_variant_begin faldo:position ?natural_variant_begin_position .
30
  ?natural_variant_end faldo:position ?natural_variant_end_position ;
31
                       faldo:reference ?sequence .
32
  FILTER(?natural_variant_begin_position >= ?active_site_position && ?active_site_position <= ?natural_variant_end_position)
33
}
Use