SPARQL example query
130_taxon_any_rhea_annotation_count: List Taxa Identifiers and the number of annotated Rhea reactions for each
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX up: <http://purl.uniprot.org/core/> SELECT ?taxon (COUNT(?rhea) AS ?rheaAnnotated) WHERE { GRAPH <http://sparql.uniprot.org/uniprot> { ?protein up:organism ?taxon ; up:annotation ?catalyticActivityAnnotation . ?catalyticActivityAnnotation up:catalyticActivity ?catalyticActivity . ?catalyticActivity up:catalyzedReaction ?rhea . } } GROUP BY ?taxonUse131_count_panther_experimental_rhea: Count the number of PANTHER families that have an experimentally confirmed catalytic activity
PREFIX ECO: <http://purl.obolibrary.org/obo/ECO_> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX up: <http://purl.uniprot.org/core/> PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> SELECT (COUNT(DISTINCT ?pantherFamily) AS ?pantherFamiliesWithExperimentalCatalyticActivity) WHERE { # Protein has a catalytic activity annotation with a Rhea reaction ?protein up:annotation ?ann . ?ann up:catalyticActivity ?ca . ?ca up:catalyzedReaction ?rhea . # The catalyticActivity statement has experimental evidence and a citation ?reif rdf:subject ?ann ; rdf:predicate up:catalyticActivity ; rdf:object ?ca ; up:attribution ?attr . ?attr up:evidence ECO:0000269 . # Protein is linked to a PANTHER family cross-reference ?protein rdfs:seeAlso ?pantherFamily . ?pantherFamily up:database <http://purl.uniprot.org/database/PANTHER> . }Use131_count_panther_experimental_rhea: Count the number of PANTHER families that have an experimentally confirmed catalytic activity
PREFIX ECO: <http://purl.obolibrary.org/obo/ECO_> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX up: <http://purl.uniprot.org/core/> PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> SELECT (COUNT(DISTINCT ?pantherFamily) AS ?pantherFamiliesWithExperimentalCatalyticActivity) WHERE { # Protein has a catalytic activity annotation with a Rhea reaction ?protein up:annotation ?ann . ?ann up:catalyticActivity ?ca . ?ca up:catalyzedReaction ?rhea . # The catalyticActivity statement has experimental evidence and a citation ?reif rdf:subject ?ann ; rdf:predicate up:catalyticActivity ; rdf:object ?ca ; up:attribution ?attr . ?attr up:evidence ECO:0000269 . # Protein is linked to a PANTHER family cross-reference ?protein rdfs:seeAlso ?pantherFamily . ?pantherFamily up:database <http://purl.uniprot.org/database/PANTHER> . }Use132_experimental_Rhea_per_PANTHER: Count the number of times a Rhea reaction was experimentally annotated in a PANTHER family
PREFIX ECO: <http://purl.obolibrary.org/obo/ECO_> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX up: <http://purl.uniprot.org/core/> PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> SELECT ?pantherFamily (COUNT(?rhea) AS ?experimentalRhea) WHERE { # Protein has a catalytic activity annotation with a Rhea reaction ?protein up:annotation ?ann . ?ann up:catalyticActivity ?ca . ?ca up:catalyzedReaction ?rhea . # The catalyticActivity statement has experimental evidence and a citation ?reif rdf:subject ?ann ; rdf:predicate up:catalyticActivity ; rdf:object ?ca ; up:attribution ?attr . ?attr up:evidence ECO:0000269 . # Protein is linked to a PANTHER family cross-reference ?protein rdfs:seeAlso ?pantherFamily . ?pantherFamily up:database <http://purl.uniprot.org/database/PANTHER> . } GROUP BY ?pantherFamily ORDER BY DESC(?experimentalRhea)Use133_mapping_panther_rhea_uniprot_eco: Generate a mapping table for PANTHER family - Rhea - UniProt Protein - ECO code
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX up: <http://purl.uniprot.org/core/> PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> SELECT ?pantherFamily ?rhea ?protein ?eco WHERE { # Protein has a catalytic activity annotation with a Rhea reaction ?protein up:annotation ?ann . ?ann up:catalyticActivity ?ca . ?ca up:catalyzedReaction ?rhea . # The catalyticActivity statement has experimental evidence and a citation ?reif rdf:subject ?ann ; rdf:predicate up:catalyticActivity ; rdf:object ?ca ; up:attribution ?attr . ?attr up:evidence ?eco . # Protein is linked to a PANTHER family cross-reference ?protein rdfs:seeAlso ?pantherFamily . ?pantherFamily up:database <http://purl.uniprot.org/database/PANTHER> . }Use135_plazi_proteome: Connect a taxonomic treatment collected by Plazi in their synospecies system. We connect by what is called the dwc:id-ENA property which is encoded as a xsd:string which is the naked identifier of an NCBI taxon concept. Which in UniProt is encoded as an IRI starting with `http://purl.uniprot.org/taxonomy/'. After converting the taxon identifier we can query for Proteomes in UniProt for that taxon.
PREFIX up: <http://purl.uniprot.org/core/> PREFIX trt: <http://plazi.org/vocab/treatment#> PREFIX dwc: <http://rs.tdwg.org/dwc/terms/> PREFIX dwcFP: <http://filteredpush.org/ontologies/oa/dwcFP#> SELECT ?proteome ?ncbiTaxon ?treatment WHERE { { SERVICE <https://lindas.admin.ch/query> { ?tc a dwcFP:TaxonConcept ; dwc:ID-ENA ?ena . ?treatment trt:augmentsTaxonConcept|trt:definesTaxonConcept ?tc ; dwc:basisOfRecord ?mc . ?mc trt:gbifOccurrenceId ?occ . } } BIND(IRI(CONCAT('http://purl.uniprot.org/taxonomy/', ?ena)) AS ?ncbiTaxon) ?proteome a up:Proteome ; up:organism ?ncbiTaxon }Use136_self_interacting_reviewed_human_proteins: Find reviewed human proteins that are annotated as self-interacting, i.e. known to form homodimers or homo-oligomers
PREFIX up: <http://purl.uniprot.org/core/> PREFIX taxon: <http://purl.uniprot.org/taxonomy/> SELECT DISTINCT ?protein WHERE { ?protein a up:Protein ; up:organism taxon:9606 ; up:reviewed true ; up:interaction ?interaction . ?interaction a up:Self_Interaction . }Use137_interaction_partners_and_evidence_count: Find the interaction partners of human tumor suppressor TP53 (P04637) and the number of experiments supporting each interaction
PREFIX up: <http://purl.uniprot.org/core/> PREFIX uniprotkb: <http://purl.uniprot.org/uniprot/> PREFIX owl: <http://www.w3.org/2002/07/owl#> SELECT DISTINCT ?partnerProtein ?experiments WHERE { uniprotkb:P04637 up:interaction ?interaction . ?interaction a up:Non_Self_Interaction ; up:participant ?partner ; up:experiments ?experiments . # up:participant identifies the interacting molecule by its IntAct # identifier; owl:sameAs links that identifier back to the UniProt # protein it corresponds to. ?partner owl:sameAs ?partnerProtein . FILTER(?partnerProtein != uniprotkb:P04637) } ORDER BY DESC(?experiments)Use138_unique_taxons_having_an_experimental_chebi: Count distinct taxons linked to ChEBI in different ways via experimental annotations in UniProt
PREFIX ECO: <http://purl.obolibrary.org/obo/ECO_> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rh: <http://rdf.rhea-db.org/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX owl: <http://www.w3.org/2002/07/owl#> PREFIX up: <http://purl.uniprot.org/core/> SELECT (COUNT(DISTINCT ?taxon) AS ?taxonsLinkedToChebi) (COUNT(DISTINCT ?ligandTaxon) AS ?taxonsLinkedToChebiViaLigand) (COUNT(DISTINCT ?cofactorTaxon) AS ?taxonsLinkedToChebiViaCofactor) (COUNT(DISTINCT ?catalyticTaxon) AS ?taxonsLinkedToChebiViaCatalytic) WHERE { { GRAPH <http://sparql.uniprot.org/uniprot> { ?protein up:annotation ?ligandAnnotation . ?ligandAnnotation up:ligand/rdfs:subClassOf ?chebi . ?reif rdf:subject ?protein ; rdf:object ?ligandAnnotation . } } UNION { GRAPH <http://sparql.uniprot.org/uniprot> { ?protein up:annotation ?cofactorAnnotation . ?cofactorAnnotation up:cofactor ?chebi . ?reif rdf:subject ?cofactorAnnotation ; rdf:object ?chebi . } } UNION { GRAPH <http://sparql.uniprot.org/uniprot> { ?protein up:annotation ?catalyticActivityAnnotation . ?catalyticActivityAnnotation a up:Catalytic_Activity_Annotation ; up:catalyticActivity ?catalyticActivity . ?catalyticActivity up:catalyzedReaction ?rhea . ?reif rdf:subject ?catalyticActivityAnnotation ; rdf:object ?catalyticActivity . } GRAPH <https://sparql.rhea-db.org/rhea> { ?rhea rh:side/rh:contains/rh:compound ?compound . ?compound (rh:chebi|(rh:reactivePart/rh:chebi)|rh:underlyingChebi) ?chebi . } } GRAPH <http://sparql.uniprot.org/uniprot> { ?reif up:attribution ?attr . ?attr up:evidence ECO:0000269 . ?protein up:organism ?taxon . BIND(IF(BOUND(?ligandAnnotation),?taxon, ?_) AS ?ligandTaxon) BIND(IF(BOUND(?cofactorAnnotation),?taxon, ?_) AS ?cofactorTaxon) BIND(IF(BOUND(?catalyticActivityAnnotation),?taxon, ?_) AS ?catalyticTaxon) } GRAPH <http://sparql.uniprot.org/chebi> { ?chebi a owl:Class . } }Use139_glycosylation_sites_on_human_proteins: Find glycosylation sites on reviewed human proteins, together with the modified residue position and the kind of glycosylation (e.g. N-linked, O-linked, C-linked)
PREFIX up: <http://purl.uniprot.org/core/> PREFIX taxon: <http://purl.uniprot.org/taxonomy/> PREFIX faldo: <http://biohackathon.org/resource/faldo#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?protein ?position ?glycosylationType WHERE { ?protein a up:Protein ; up:organism taxon:9606 ; up:reviewed true ; up:annotation ?annotation . ?annotation a up:Glycosylation_Annotation ; rdfs:comment ?glycosylationType ; up:range ?range . ?range faldo:begin/faldo:position ?position . }Use140_disulfide_bonds_and_interchain_links: Find the disulfide bonds of human insulin (P01308), the pair of residue positions each one connects, and whether it links two different chains (e.g. the A and B chains of mature insulin) rather than two residues within the same chain
PREFIX up: <http://purl.uniprot.org/core/> PREFIX uniprotkb: <http://purl.uniprot.org/uniprot/> PREFIX faldo: <http://biohackathon.org/resource/faldo#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?annotation (GROUP_CONCAT(STR(?position); separator="-") AS ?positions) (SAMPLE(?rawComment) AS ?interchainNote) WHERE { uniprotkb:P01308 up:annotation ?annotation . ?annotation a up:Disulfide_Bond_Annotation ; up:range ?range . # Each disulfide bond annotation has one up:range per residue it # connects; a plain xsd:int position must be coerced with STR() before # GROUP_CONCAT can aggregate it. ?range faldo:begin/faldo:position ?position . # Absence of a comment means the bond is intra-chain; a comment # mentioning "Interchain" means it links two separate chains. OPTIONAL { ?annotation rdfs:comment ?rawComment } } GROUP BY ?annotationUse141_lipidation_sites_and_lipid_type: Find reviewed human proteins with a covalently attached lipid (e.g. palmitoylation, farnesylation, GPI-anchor) and the residue position and kind of lipid attached
PREFIX up: <http://purl.uniprot.org/core/> PREFIX taxon: <http://purl.uniprot.org/taxonomy/> PREFIX faldo: <http://biohackathon.org/resource/faldo#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?protein ?position ?lipidationType WHERE { ?protein a up:Protein ; up:organism taxon:9606 ; up:reviewed true ; up:annotation ?annotation . ?annotation a up:Lipidation_Annotation ; rdfs:comment ?lipidationType ; up:range ?range . ?range faldo:begin/faldo:position ?position . }Use142_cross_linked_residues: Find reviewed human proteins with a cross-linked residue (e.g. a glycyl lysine isopeptide bond formed by ubiquitin or SUMO conjugation) and the residue position and nature of the cross-link
PREFIX up: <http://purl.uniprot.org/core/> PREFIX taxon: <http://purl.uniprot.org/taxonomy/> PREFIX faldo: <http://biohackathon.org/resource/faldo#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?protein ?position ?crossLinkType WHERE { ?protein a up:Protein ; up:organism taxon:9606 ; up:reviewed true ; up:annotation ?annotation . ?annotation a up:Cross-link_Annotation ; rdfs:comment ?crossLinkType ; up:range ?range . ?range faldo:begin/faldo:position ?position . }Use143_protein_function_description: Retrieve the free-text function description of human tumor suppressor TP53 (P04637), as distinct from its more specific catalytic-activity, disease, or subunit annotations
PREFIX up: <http://purl.uniprot.org/core/> PREFIX uniprotkb: <http://purl.uniprot.org/uniprot/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?functionText WHERE { uniprotkb:P04637 up:annotation ?annotation . ?annotation a up:Function_Annotation ; rdfs:comment ?functionText . }Use144_mature_chain_after_signal_peptide_cleavage: Find reviewed human secreted proteins where the mature chain begins immediately after the signal peptide is cleaved off
PREFIX up: <http://purl.uniprot.org/core/> PREFIX taxon: <http://purl.uniprot.org/taxonomy/> PREFIX faldo: <http://biohackathon.org/resource/faldo#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?protein ?signalPeptideEnd ?chainName ?chainBegin ?chainEnd WHERE { ?protein a up:Protein ; up:organism taxon:9606 ; up:reviewed true ; up:annotation ?signalPeptideAnnotation , ?chainAnnotation . ?signalPeptideAnnotation a up:Signal_Peptide_Annotation ; up:range ?signalPeptideRange . ?signalPeptideRange faldo:end/faldo:position ?signalPeptideEnd . ?chainAnnotation a up:Chain_Annotation ; up:range ?chainRange . OPTIONAL { ?chainAnnotation rdfs:comment ?chainName } ?chainRange faldo:begin/faldo:position ?chainBegin ; faldo:end/faldo:position ?chainEnd . FILTER(?chainBegin = ?signalPeptideEnd + 1) }Use145_mitochondrial_transit_peptides: Find reviewed human proteins with a transit peptide targeting them to the mitochondrion, and the extent of that transit peptide
PREFIX up: <http://purl.uniprot.org/core/> PREFIX taxon: <http://purl.uniprot.org/taxonomy/> PREFIX faldo: <http://biohackathon.org/resource/faldo#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?protein ?destination ?begin ?end WHERE { ?protein a up:Protein ; up:organism taxon:9606 ; up:reviewed true ; up:annotation ?annotation . ?annotation a up:Transit_Peptide_Annotation ; rdfs:comment ?destination ; up:range ?range . ?range faldo:begin/faldo:position ?begin ; faldo:end/faldo:position ?end . FILTER(CONTAINS(?destination, "Mitochondrion")) }Use146_propeptide_regions_removed_during_maturation: Find propeptide regions of reviewed human proteins that are removed during protein maturation, with their extent
PREFIX up: <http://purl.uniprot.org/core/> PREFIX taxon: <http://purl.uniprot.org/taxonomy/> PREFIX faldo: <http://biohackathon.org/resource/faldo#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?protein ?description ?begin ?end WHERE { ?protein a up:Protein ; up:organism taxon:9606 ; up:reviewed true ; up:annotation ?annotation . ?annotation a up:Propeptide_Annotation ; up:range ?range . OPTIONAL { ?annotation rdfs:comment ?description } ?range faldo:begin/faldo:position ?begin ; faldo:end/faldo:position ?end . }Use147_enzymes_with_kinetic_parameters: Find reviewed enzymes with reported kinetic parameters (Michaelis-Menten constant Km and/or maximal velocity Vmax) and their reported values
PREFIX up: <http://purl.uniprot.org/core/> SELECT ?protein ?km ?vmax WHERE { ?protein a up:Protein ; up:reviewed true ; up:annotation ?annotation . ?annotation a up:Kinetics_Annotation . OPTIONAL { ?annotation up:measuredAffinity ?km } OPTIONAL { ?annotation up:measuredActivity ?vmax } }Use148_optimum_ph_for_enzyme_activity: Find the optimum pH reported for the activity of reviewed human enzymes
PREFIX up: <http://purl.uniprot.org/core/> PREFIX taxon: <http://purl.uniprot.org/taxonomy/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?protein ?phDependence WHERE { ?protein a up:Protein ; up:organism taxon:9606 ; up:reviewed true ; up:annotation ?annotation . ?annotation a up:PH_Dependence_Annotation ; rdfs:comment ?phDependence . }Use149_optimum_temperature_for_enzyme_activity: Find the optimum temperature or thermostability reported for the activity of reviewed human enzymes
PREFIX up: <http://purl.uniprot.org/core/> PREFIX taxon: <http://purl.uniprot.org/taxonomy/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?protein ?temperatureDependence WHERE { ?protein a up:Protein ; up:organism taxon:9606 ; up:reviewed true ; up:annotation ?annotation . ?annotation a up:Temperature_Dependence_Annotation ; rdfs:comment ?temperatureDependence . }Use150_redox_potential_measurements: Find redox potential (E0) measurements reported for reviewed electron-transport proteins
PREFIX up: <http://purl.uniprot.org/core/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?protein ?redoxPotential WHERE { ?protein a up:Protein ; up:reviewed true ; up:annotation ?annotation . ?annotation a up:Redox_Potential_Annotation ; rdfs:comment ?redoxPotential . }Use151_membrane_orientation_of_subcellular_location: Find reviewed human proteins with a known membrane orientation (e.g. cytoplasmic side vs. lumenal side) for one of their subcellular locations
PREFIX up: <http://purl.uniprot.org/core/> PREFIX taxon: <http://purl.uniprot.org/taxonomy/> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> SELECT ?protein ?subcellularLocation ?orientation WHERE { ?protein a up:Protein ; up:organism taxon:9606 ; up:reviewed true ; up:annotation ?annotation . ?annotation a up:Subcellular_Location_Annotation ; up:locatedIn ?location . ?location up:cellularComponent ?component ; up:orientation ?orientationResource . ?component skos:prefLabel ?subcellularLocation . ?orientationResource skos:prefLabel ?orientation . }Use152_topology_of_subcellular_location: Find the membrane topology (e.g. peripheral membrane protein, lipid-anchor, multi-pass membrane protein) recorded for a subcellular location of reviewed human proteins
PREFIX up: <http://purl.uniprot.org/core/> PREFIX taxon: <http://purl.uniprot.org/taxonomy/> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> SELECT ?protein ?subcellularLocation ?topology WHERE { ?protein a up:Protein ; up:organism taxon:9606 ; up:reviewed true ; up:annotation ?annotation . ?annotation a up:Subcellular_Location_Annotation ; up:locatedIn ?location . ?location up:cellularComponent ?component ; up:topology ?topologyResource . ?component skos:prefLabel ?subcellularLocation . ?topologyResource skos:prefLabel ?topology . }Use153_protein_domain_extents: Find the extent (start and end position) of annotated protein domains on reviewed human proteins, using UniProt's own domain model rather than an InterPro/Pfam cross-reference
PREFIX up: <http://purl.uniprot.org/core/> PREFIX taxon: <http://purl.uniprot.org/taxonomy/> PREFIX faldo: <http://biohackathon.org/resource/faldo#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?protein ?domainName ?begin ?end WHERE { ?protein a up:Protein ; up:organism taxon:9606 ; up:reviewed true ; up:annotation ?annotation . ?annotation a up:Domain_Extent_Annotation ; rdfs:comment ?domainName ; up:range ?range . ?range faldo:begin/faldo:position ?begin ; faldo:end/faldo:position ?end . }Use154_zinc_finger_regions: Find zinc finger regions in reviewed human DNA-binding proteins, with the zinc finger type and its extent
PREFIX up: <http://purl.uniprot.org/core/> PREFIX taxon: <http://purl.uniprot.org/taxonomy/> PREFIX faldo: <http://biohackathon.org/resource/faldo#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?protein ?zincFingerType ?begin ?end WHERE { ?protein a up:Protein ; up:organism taxon:9606 ; up:reviewed true ; up:annotation ?annotation . ?annotation a up:Zinc_Finger_Annotation ; up:range ?range . OPTIONAL { ?annotation rdfs:comment ?zincFingerType } ?range faldo:begin/faldo:position ?begin ; faldo:end/faldo:position ?end . }Use155_coiled_coil_regions: Find coiled-coil regions annotated on reviewed human proteins and their extent
PREFIX up: <http://purl.uniprot.org/core/> PREFIX taxon: <http://purl.uniprot.org/taxonomy/> PREFIX faldo: <http://biohackathon.org/resource/faldo#> SELECT ?protein ?begin ?end WHERE { ?protein a up:Protein ; up:organism taxon:9606 ; up:reviewed true ; up:annotation ?annotation . ?annotation a up:Coiled_Coil_Annotation ; up:range ?range . ?range faldo:begin/faldo:position ?begin ; faldo:end/faldo:position ?end . }Use