Examples

  1. Select all taxa from the UniProt taxonomyPREFIX up: <http://purl.uniprot.org/core/> SELECT ?taxon FROM <http://sparql.uniprot.org/taxonomy> WHERE { ?taxon a up:Taxon . }
  2. Select all bacterial taxa and their scientific name from the UniProt taxonomyPREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX taxon: <http://purl.uniprot.org/taxonomy/> PREFIX up: <http://purl.uniprot.org/core/> SELECT ?taxon ?name WHERE { ?taxon a up:Taxon . ?taxon up:scientificName ?name . # Taxon subclasses are materialized, do not use rdfs:subClassOf+ ?taxon rdfs:subClassOf taxon:2 . }
  3. Select all UniProt entries, and their organism and amino acid sequences (including isoforms), for E. coli K12 and all its strainsPREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX taxon: <http://purl.uniprot.org/taxonomy/> PREFIX up: <http://purl.uniprot.org/core/> SELECT ?protein ?organism ?isoform ?sequence WHERE { ?protein a up:Protein . ?protein up:organism ?organism . # Taxon subclasses are materialized, do not use rdfs:subClassOf+ ?organism rdfs:subClassOf taxon:83333 . ?protein up:sequence ?isoform . ?isoform rdf:value ?sequence . }
  4. Select all UniProt entries, and their organism and amino acid sequences (including isoforms), for E. coli K12 and all its strainsPREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX taxon: <http://purl.uniprot.org/taxonomy/> PREFIX up: <http://purl.uniprot.org/core/> SELECT ?protein ?organism ?isoform ?sequence WHERE { ?protein a up:Protein . ?protein up:organism ?organism . # Taxon subclasses are materialized, do not use rdfs:subClassOf+ ?organism rdfs:subClassOf taxon:83333 . ?protein up:sequence ?isoform . ?isoform rdf:value ?sequence . }
  5. Select the UniProt entry with the mnemonic 'A4_HUMAN'PREFIX up: <http://purl.uniprot.org/core/> SELECT ?protein WHERE { ?protein a up:Protein . ?protein up:mnemonic 'A4_HUMAN' }
  6. Select a mapping of UniProt to PDB entries using the UniProt cross-references to the PDB databasePREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX up: <http://purl.uniprot.org/core/> SELECT ?protein ?db WHERE { ?protein a up:Protein . ?protein rdfs:seeAlso ?db . ?db up:database <http://purl.uniprot.org/database/PDB> }
  7. Select a mapping of UniProt to PDB entries using the UniProt cross-references to the PDB databasePREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX up: <http://purl.uniprot.org/core/> SELECT ?protein ?db WHERE { ?protein a up:Protein . ?protein rdfs:seeAlso ?db . ?db up:database <http://purl.uniprot.org/database/PDB> }
  8. Select all cross-references to external databases of the category '3D structure databases' of UniProt entries that are classified with the keyword 'Acetoin biosynthesis (KW-0005)'PREFIX keywords: <http://purl.uniprot.org/keywords/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX up: <http://purl.uniprot.org/core/> SELECT DISTINCT ?link WHERE { ?protein a up:Protein . ?protein up:classifiedWith keywords:5 . ?protein rdfs:seeAlso ?link . ?link up:database ?db . ?db up:category '3D structure databases' }
  9. Select reviewed UniProt entries (Swiss-Prot), and their recommended protein name, that have a preferred gene name that contains the text 'DNA'PREFIX skos: <http://www.w3.org/2004/02/skos/core#> PREFIX up: <http://purl.uniprot.org/core/> SELECT ?protein ?name WHERE { ?protein a up:Protein . ?protein up:reviewed true . ?protein up:recommendedName ?recommended . ?recommended up:fullName ?name . ?protein up:encodedBy ?gene . ?gene skos:prefLabel ?text . FILTER CONTAINS(?text, 'DNA') }
  10. Select reviewed UniProt entries (Swiss-Prot), and their recommended protein name, that have a preferred gene name that contains the text 'DNA'PREFIX skos: <http://www.w3.org/2004/02/skos/core#> PREFIX up: <http://purl.uniprot.org/core/> SELECT ?protein ?name WHERE { ?protein a up:Protein . ?protein up:reviewed true . ?protein up:recommendedName ?recommended . ?recommended up:fullName ?name . ?protein up:encodedBy ?gene . ?gene skos:prefLabel ?text . FILTER CONTAINS(?text, 'DNA') }
  11. Select the preferred gene name and disease annotation of all human UniProt entries that are known to be involved in a diseasePREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> PREFIX taxon: <http://purl.uniprot.org/taxonomy/> PREFIX up: <http://purl.uniprot.org/core/> SELECT ?name ?text WHERE { ?protein a up:Protein . ?protein up:organism taxon:9606 . ?protein up:encodedBy ?gene . ?gene skos:prefLabel ?name . ?protein up:annotation ?annotation . ?annotation a up:Disease_Annotation . ?annotation rdfs:comment ?text }
  12. Select the preferred gene name and disease annotation of all human UniProt entries that are known to be involved in a diseasePREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> PREFIX taxon: <http://purl.uniprot.org/taxonomy/> PREFIX up: <http://purl.uniprot.org/core/> SELECT ?name ?text WHERE { ?protein a up:Protein . ?protein up:organism taxon:9606 . ?protein up:encodedBy ?gene . ?gene skos:prefLabel ?name . ?protein up:annotation ?annotation . ?annotation a up:Disease_Annotation . ?annotation rdfs:comment ?text }
  13. Select all human UniProt entries with a sequence variant that leads to a 'loss of function'PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX taxon: <http://purl.uniprot.org/taxonomy/> PREFIX up: <http://purl.uniprot.org/core/> SELECT ?protein ?text WHERE { ?protein a up:Protein . ?protein up:organism taxon:9606 . ?protein up:annotation ?annotation . ?annotation a up:Natural_Variant_Annotation . ?annotation rdfs:comment ?text . FILTER (CONTAINS(?text, 'loss of function')) }
  14. Select all human UniProt entries with a sequence variant that leads to a 'loss of function'PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX taxon: <http://purl.uniprot.org/taxonomy/> PREFIX up: <http://purl.uniprot.org/core/> SELECT ?protein ?text WHERE { ?protein a up:Protein . ?protein up:organism taxon:9606 . ?protein up:annotation ?annotation . ?annotation a up:Natural_Variant_Annotation . ?annotation rdfs:comment ?text . FILTER (CONTAINS(?text, 'loss of function')) }
  15. Select all human UniProt entries with a sequence variant that leads to a tyrosine to phenylalanine substitutionPREFIX faldo: <http://biohackathon.org/resource/faldo#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX taxon: <http://purl.uniprot.org/taxonomy/> PREFIX up: <http://purl.uniprot.org/core/> SELECT ?protein ?annotation ?begin ?text WHERE { ?protein a up:Protein ; up:organism taxon:9606 ; up:annotation ?annotation . ?annotation a up:Natural_Variant_Annotation ; rdfs:comment ?text ; up:substitution ?substitution ; up:range/faldo:begin [ faldo:position ?begin ; faldo:reference ?sequence ] . ?sequence rdf:value ?value . BIND (substr(?value, ?begin, 1) as ?original) . FILTER(?original = 'Y' && ?substitution = 'F') . }
  16. More examples

News

    News archive

    About

    This SPARQL endpoint contains all UniProt data. It is free to access and supports the SPARQL 1.1 Standard.

    There are 190,000,000,000 triples in this release (2024_05). The query timeout is 45 minutes. All triples are available in the default graph. There are 22 named graphs.

    Documentation

    1. Classes and predicates defined by the UniProt consortium
    2. Tutorial on using SPARQL with UniProt
    3. Statistics and diagrams
    4. Example queries