SPARQL example query
166_batch_annotate_gene_list: Given a batch list of UniProt accessions, retrieve one row per entry with its recommended protein name, function description, and reviewed status in a single query. This is the classic 'annotate my differential-expression gene list' BioMart workflow (attributes=c(\"name\",\"description\",\"reviewed\") in one getBM() call)
PREFIX up: <http://purl.uniprot.org/core/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX uniprotkb: <http://purl.uniprot.org/uniprot/> SELECT ?protein ?recommendedName (GROUP_CONCAT(?function; separator='\n') AS ?functions) ?reviewed WHERE { VALUES ?protein { uniprotkb:P04637 uniprotkb:P01308 uniprotkb:Q13613 } ?protein up:reviewed ?reviewed . OPTIONAL { ?protein up:recommendedName ?name . } OPTIONAL { FILTER(!BOUND(?name)) ?protein up:submittedName ?name . } ?name up:fullName ?recommendedName . OPTIONAL { ?protein up:annotation ?functionAnnotation . ?functionAnnotation a up:Function_Annotation ; rdfs:comment ?function . } } GROUP BY ?protein ?recommendedName ?reviewedUse167_batch_canonical_sequence_retrieval: Given a batch list of UniProt accessions, retrieve the amino acid sequence for each in a single query, matching BioMart's classic bulk "peptide" attribute pull
PREFIX up: <http://purl.uniprot.org/core/> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX uniprotkb: <http://purl.uniprot.org/uniprot/> SELECT ?protein ?sequence WHERE { GRAPH <http://sparql.uniprot.org/uniparc> { VALUES ?protein { uniprotkb:P04637 uniprotkb:P01308 uniprotkb:Q13613 } ?uniparc up:sequenceFor ?protein . ?uniparc rdf:value ?sequence . } }Use168_batch_ensembl_transcript_cross_references: Given a batch of UniProt accessions, map each to its cross-referenced Ensembl transcript(s) in one query. This relationship is one-to-many (a protein can have several Ensembl transcripts), which is a recurring biomaRt pain point since getBM() is reported to drop or omit rows for it -- with SPARQL, a one-to-many mapping simply produces more result rows
PREFIX up: <http://purl.uniprot.org/core/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX uniprotkb: <http://purl.uniprot.org/uniprot/> SELECT ?protein ?ensemblTranscript WHERE { VALUES ?protein { uniprotkb:P04637 uniprotkb:P01308 uniprotkb:Q13613 } ?protein rdfs:seeAlso ?ensemblTranscript . ?ensemblTranscript up:database <http://purl.uniprot.org/database/Ensembl> . }Use169_batch_kegg_cross_references: Given a batch of UniProt accessions, retrieve each one's KEGG gene cross-reference in a single query. Note: if building metabolic pathways we recommend looking at how Rhea is used in UniProt.
PREFIX up: <http://purl.uniprot.org/core/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX uniprotkb: <http://purl.uniprot.org/uniprot/> SELECT ?protein ?keggGene WHERE { VALUES ?protein { uniprotkb:P04637 uniprotkb:P01308 uniprotkb:Q13613 } ?protein rdfs:seeAlso ?keggGene . ?keggGene up:database <http://purl.uniprot.org/database/KEGG> . }Use170_batch_ensembl_gene_and_protein_ids: Given a batch of UniProt accessions, resolve each to its Ensembl gene ID and Ensembl protein ID in one query. UniProt's rdfs:seeAlso cross-reference to Ensembl only reaches the transcript level directly; the transcript resource itself links on to the gene it was transcribed from (up:transcribedFrom, an ENSG id) and the protein it was translated to (up:translatedTo, an ENSP id), so no federation with an external Ensembl endpoint is needed to reach gene-level identifiers. Similar pattern appears for the other Ensembl like databases such as EnsemblBacteria
PREFIX up: <http://purl.uniprot.org/core/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX uniprotkb: <http://purl.uniprot.org/uniprot/> SELECT ?protein ?ensemblTranscript ?ensemblGene ?ensemblProtein WHERE { VALUES ?protein { uniprotkb:P04637 uniprotkb:P01308 uniprotkb:Q13613 } ?protein rdfs:seeAlso ?ensemblTranscript . ?ensemblTranscript up:database <http://purl.uniprot.org/database/Ensembl> ; up:transcribedFrom ?ensemblGene ; up:translatedTo ?ensemblProtein . }Use171_batch_id_mapping_style_lookup: Given a batch of UniProt accessions, resolve each to its mnemonic entry name, recommended protein name, and organism in one query -- the SPARQL equivalent of the columns (EntryName, ProteinName, Organism) UniProt's own web-based ID mapping/retrieve service returns
PREFIX up: <http://purl.uniprot.org/core/> PREFIX uniprotkb: <http://purl.uniprot.org/uniprot/> SELECT ?protein ?mnemonic ?recommendedName ?organismName WHERE { VALUES ?protein { uniprotkb:P04637 uniprotkb:P01308 uniprotkb:Q13613 } ?protein up:mnemonic ?mnemonic ; up:organism ?organism . ?protein up:reviewed ?reviewed . OPTIONAL { ?protein up:recommendedName ?name . } OPTIONAL { FILTER(!BOUND(?name)) ?protein up:submittedName ?name . } ?name up:fullName ?recommendedName . ?organism up:scientificName ?organismName . }Use172_reviewed_members_of_a_reference_proteome: For a given taxon (Escherichia coli K12), find its reference proteome and list the reviewed proteins that are members of it. This goes one step further than finding just the proteome resource: a protein's up:proteome value identifies a component (e.g. a chromosome) of a proteome, whose IRI is the proteome's own IRI with a '#' fragment appended. The relation between a component and a proteome is via skos:narrower
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 WHERE { ?proteome a up:Reference_Proteome ; up:organism taxon:83333 . ?protein up:proteome ?component ; up:reviewed true . ?proteome skos:narrower ?component . }Use173_batch_ec_number_lookup: Given a batch of Enzyme Commission (EC) numbers, list the reviewed UniProt entries classified with each one, in a single query. A protein can be linked to an EC number three different ways: directly (up:enzyme), through a catalytic activity annotation's Rhea-linked enzyme classification (up:catalyticActivity/up:enzymeClass), or as a plain string in a structured protein name (up:ecName) -- the ?mappedVia column states which
PREFIX up: <http://purl.uniprot.org/core/> PREFIX enzyme: <http://purl.uniprot.org/enzyme/> SELECT ?ec ?protein ?mappedVia WHERE { VALUES ?ec { "1.1.1.1" "3.5.1.5" } BIND(IRI(CONCAT(STR(enzyme:), ?ec)) AS ?ecIRI) { ?protein up:enzyme ?ecIRI . BIND("direct enzyme classification (up:enzyme)" AS ?mappedVia) } UNION { ?protein up:annotation/up:catalyticActivity/up:enzymeClass ?ecIRI . BIND("catalytic activity annotation (up:catalyticActivity/up:enzymeClass)" AS ?mappedVia) } UNION { ?protein up:recommendedName|up:alternativeName ?name . ?name up:ecName ?ec . BIND("structured name (up:ecName string)" AS ?mappedVia) } ?protein up:reviewed true . }Use174_pdb_structures_via_pdbj_federation: Starting from human tumor suppressor TP53 (P04637), federate live with PDBj/RDF Portal's wwPDB RDF to list the extended, versioned wwPDB identifier (e.g. pdb_00002bq0, not the legacy 4-character code) of every PDB entry that has been experimentally solved for it. This goes through PDBj's own pdbo:link_to_uniprot cross-reference rather than UniProt's local rdfs:seeAlso/database cross-reference, so it is a genuine two-endpoint federated query, not a locally-built PDB identifier
PREFIX up: <http://purl.uniprot.org/core/> PREFIX uniprotkb: <http://purl.uniprot.org/uniprot/> PREFIX pdbo: <http://rdf.wwpdb.org/schema/pdbx-with-vrptx-v50.owl#> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> SELECT ?extendedPdbId #?pdb WHERE { BIND(uniprotkb:P04637 AS ?protein) # Compare with cross-reference stored in UniProtKB #?protein rdfs:seeAlso ?pdb . #?pdb up:database <http://purl.uniprot.org/database/wwPDB> SERVICE <https://rdfportal.org/pdb/sparql> { ?structRef pdbo:link_to_uniprot ?protein . ?pdbEntry pdbo:has_struct_refCategory/pdbo:has_struct_ref ?structRef . # Entries carry both their legacy 4-character code and the newer, # extended/versioned wwPDB identifier as skos:altLabel; the extended # one is the only one starting with "pdb_". ?pdbEntry skos:altLabel ?extendedPdbId . FILTER(STRSTARTS(?extendedPdbId, "pdb_")) } }Use175_uniprot_identity_of_a_pdb_entry_via_pdbj: Starting from PDB entry pdb_00002bq0 (the extended, versioned wwPDB identifier for legacy entry 2BQ0), federate live with PDBj/RDF Portal's wwPDB RDF to retrieve the recommended or submitted protein name and organism of the UniProt entity it was solved from -- the reverse direction of resolving a protein to its PDB structures
PREFIX up: <http://purl.uniprot.org/core/> PREFIX pdbo: <http://rdf.wwpdb.org/schema/pdbx-with-vrptx-v50.owl#> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> SELECT ?protein ?recommendedName ?organismName WHERE { SERVICE <https://rdfportal.org/pdb/sparql> { # The extended, versioned wwPDB identifier is recorded as a # skos:altLabel on the entry, alongside its legacy 4-character code. ?pdbEntry skos:altLabel "pdb_00002bq0" . ?pdbEntry pdbo:has_struct_refCategory/pdbo:has_struct_ref ?structRef . ?structRef pdbo:link_to_uniprot ?protein . } ?protein up:organism ?organism . ?organism up:scientificName ?organismName . OPTIONAL { ?protein up:recommendedName ?name . } OPTIONAL { FILTER(! BOUND(?name)) ?protein up:submittedName ?name . } ?name up:fullName ?recommendedName ; }Use176_taxon_names_not_unique: Find up:scientificName values that label more than one taxon. The same string can genuinely be reused for unrelated nodes in UniProt's taxonomy: a higher-rank name is sometimes also reused at genus rank (e.g. Acanthocephala, a phylum of thorny-headed worms, is also an insect genus elsewhere in the tree); "environmental samples" is a special case, a placeholder reused thousands of times under many different higher taxa for unclassified/metagenomic entries
PREFIX up: <http://purl.uniprot.org/core/> SELECT ?scientificName (COUNT(?taxon) AS ?taxonCount) (GROUP_CONCAT(SUBSTR(STR(?taxon), 34); separator=",") AS ?taxonIds) WHERE { ?taxon up:scientificName ?scientificName . } GROUP BY ?scientificName HAVING (COUNT(?taxon) > 1) ORDER BY ?scientificNameUse177_subcellular_location_go_direct_match: Find UniProt's subcellular-location ontology terms (up:Cellular_Component, the http://purl.uniprot.org/locations/ terms behind section G's per-protein annotations) and the Gene Ontology cellular-component term each one exactly matches, via skos:exactMatch
PREFIX up: <http://purl.uniprot.org/core/> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> SELECT ?location ?locationName ?go WHERE { ?location a up:Cellular_Component ; skos:prefLabel ?locationName ; skos:exactMatch ?go . }Use178_subcellular_location_go_indirect_match: Find Gene Ontology terms that are a looser match to a UniProt subcellular-location term than the direct skos:exactMatch: GO terms reached from the directly-matched term via rdfs:subClassOf+ (is-a), or via a BFO_0000050 (part_of) owl:Restriction on top of it. GO's own part_of axioms are loaded in the UniProt endpoint as an owl:Restriction blank node (a rdfs:subClassOf [ a owl:Restriction ; owl:onProperty obo:BFO_0000050 ; owl:someValuesFrom b ] means a is part_of b), so combining a property path with that restriction pattern is what it takes to follow "is-a-or-part-of" one more step
PREFIX up: <http://purl.uniprot.org/core/> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> PREFIX owl: <http://www.w3.org/2002/07/owl#> PREFIX obo: <http://purl.obolibrary.org/obo/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT DISTINCT ?location ?locationName ?directGo ?relatedGo WHERE { ?location a up:Cellular_Component ; skos:prefLabel ?locationName ; skos:exactMatch ?directGo . { ?relatedGo rdfs:subClassOf+ ?directGo . } UNION { ?relatedGo rdfs:subClassOf [ a owl:Restriction ; owl:onProperty obo:BFO_0000050 ; owl:someValuesFrom ?directGo ] . } }Use179_subcellular_location_names: List every term in UniProt's subcellular-location ontology (up:Cellular_Component) with its preferred name and description
PREFIX up: <http://purl.uniprot.org/core/> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?location ?locationName ?description WHERE { ?location a up:Cellular_Component ; skos:prefLabel ?locationName ; rdfs:comment ?description . }Use180_subcellular_location_ancestors: Find every broader subcellular location reachable from a given one (here, Endosome membrane, locations:100). The location hierarchy mixes rdfs:subClassOf (is-a) and up:partOf (part-of) edges, so both have to be chained together - rdfs:subClassOf*/up:partOf+/rdfs:subClassOf* - to reach the full set of ancestors; using only one of the two misses e.g. Endosome (is-a) or Membrane (part-of, then is-a)
PREFIX up: <http://purl.uniprot.org/core/> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT DISTINCT ?ancestor ?ancestorName WHERE { GRAPH <http://sparql.uniprot.org/locations> { <http://purl.uniprot.org/locations/100> rdfs:subClassOf*/up:partOf+/rdfs:subClassOf* ?ancestor . ?ancestor skos:prefLabel ?ancestorName . } }Use181_subcellular_locations_that_are_membranes: Find every subcellular location that is itself a kind of membrane, by reasoning back to locations:162 ("Membrane") over the same mixed rdfs:subClassOf/up:partOf hierarchy as #180. Nothing states directly that e.g. Endosome membrane "is a membrane" - it has to be derived by following the location hierarchy up to the Membrane term
PREFIX up: <http://purl.uniprot.org/core/> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT DISTINCT ?location ?locationName WHERE { GRAPH <http://sparql.uniprot.org/locations> { ?location rdfs:subClassOf*/up:partOf+/rdfs:subClassOf* <http://purl.uniprot.org/locations/162> ; skos:prefLabel ?locationName . } }Use182_reviewed_proteins_by_ec_class: Count reviewed proteins classified anywhere under EC class 2.7 (transferases that transfer phosphorus-containing groups, e.g. kinases), matched either directly via up:enzyme or through a catalytic-activity annotation's Rhea-linked enzyme classification. EC subclasses are materialized in UniProt's data, so this is done with a plain rdfs:subClassOf join against the whole 2.7.-.- subtree rather than an rdfs:subClassOf+ transitive path or a STRSTARTS string-prefix filter on the EC IRI
PREFIX up: <http://purl.uniprot.org/core/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT (COUNT(DISTINCT ?protein) AS ?count) WHERE { ?protein up:reviewed true ; up:enzyme|up:annotation/up:catalyticActivity/up:enzymeClass ?ecNumber . ?ecNumber rdfs:subClassOf <http://purl.uniprot.org/enzyme/2.7.-.-> }Use183_protein_count_by_clade_single_hop: Compare the number of reviewed proteins in two named taxonomic clades (Primates, Rodentia), using a single-hop ?organism rdfs:subClassOf ?clade rather than the transitive rdfs:subClassOf+ or rdfs:subClassOf* form. UniProt's taxonomy is pre-flattened: every taxon carries a direct rdfs:subClassOf edge to every one of its ancestors, not only its immediate parent (verified live: taxon 9606, Homo sapiens, has 30 direct rdfs:subClassOf triples, one per ancestor up to cellular organisms), so a single hop already reaches every member of a clade at any depth and is far cheaper than the transitive path
PREFIX up: <http://purl.uniprot.org/core/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?clade ?cladeName (COUNT(DISTINCT ?protein) AS ?proteinCount) WHERE { VALUES ?clade { <http://purl.uniprot.org/taxonomy/9443> <http://purl.uniprot.org/taxonomy/9989> } ?clade up:scientificName ?cladeName . ?protein up:reviewed true ; up:organism ?organism . ?organism rdfs:subClassOf ?clade . } GROUP BY ?clade ?cladeNameUse184_multiple_annotation_types_via_faldo: Retrieve several different kinds of positional annotation (modified residues, domains, binding sites) together in one query, each one's sequence range resolved through FALDO in the same WHERE clause, instead of writing one query per annotation type. The candidate types are listed with VALUES rather than bound to a variable and checked with FILTER(?annotType IN (...)): live against sparql.uniprot.org, the FILTER(IN) form was slow and unstable (anywhere from 14s to over a minute, sometimes timing out outright), while VALUES consistently answered in a few seconds
PREFIX up: <http://purl.uniprot.org/core/> PREFIX taxon: <http://purl.uniprot.org/taxonomy/> PREFIX faldo: <http://biohackathon.org/resource/faldo#> SELECT ?protein ?annotType ?begin ?end WHERE { VALUES ?annotType { up:Modified_Residue_Annotation up:Domain_Annotation up:Binding_Site_Annotation } ?protein a up:Protein ; up:organism taxon:9606 ; up:reviewed true ; up:annotation ?annotation . ?annotation a ?annotType ; up:range ?range . ?range faldo:begin/faldo:position ?begin ; faldo:end/faldo:position ?end . } LIMIT 20Use185_proteins_by_keyword_complete_enumeration: Count reviewed proteins classified with the controlled-vocabulary keyword Kinase (keywords:418) via up:classifiedWith. This is the complete route to "every kinase": a free-text search over protein names or comments for the word "kinase" would miss proteins named with the synonym "Phosphotransferase" (keywords:418's own skos:altLabel) instead, while curator-assigned keyword classification catches both consistently
PREFIX up: <http://purl.uniprot.org/core/> PREFIX keywords: <http://purl.uniprot.org/keywords/> SELECT (COUNT(DISTINCT ?protein) AS ?count) WHERE { ?protein up:reviewed true ; up:classifiedWith keywords:418 . }Use186_ensembl_gene_biotype_and_location: Given a UniProt protein (human TP53, P04637), federate out to Ensembl's own RDF at RDF Portal to retrieve its gene's biotype and genomic location (begin/end via FALDO). UniProt only holds the Ensembl gene identifier locally (up:transcribedFrom); the gene's own attributes - biotype, genomic coordinates - only exist in Ensembl's RDF, not UniProt's. Note: up:transcribedFrom's object is a *versioned* Ensembl gene IRI (e.g. .../ENSG00000141510.20), but RDF Portal's Ensembl graph identifies the gene by its *unversioned* IRI, so a direct IRI join between the two silently returns nothing; matching via rdfs:seeAlso from the protein (as done here), filtered to the ensembl:EnsemblGene type to exclude transcripts, avoids that mismatch
PREFIX up: <http://purl.uniprot.org/core/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX ensembl: <http://rdf.ebi.ac.uk/terms/ensembl/> PREFIX faldo: <http://biohackathon.org/resource/faldo#> SELECT ?gene ?biotype ?begin ?end WHERE { BIND(<http://purl.uniprot.org/uniprot/P04637> AS ?protein) SERVICE <https://rdfportal.org/ebi/sparql> { ?gene a ensembl:EnsemblGene ; rdfs:seeAlso ?protein ; ensembl:has_biotype ?biotype ; faldo:location ?location . ?location faldo:begin/faldo:position ?begin ; faldo:end/faldo:position ?end . } }Use187_reactome_pathways_via_ensembl_gene: Given a UniProt protein (human TP53, P04637), list the Reactome pathways it participates in, reached via its Ensembl gene's own rdfs:seeAlso links at RDF Portal. This is a federated alternative to any pathway cross-references UniProt exposes directly: the Ensembl gene resource carries rdfs:seeAlso triples both back to the UniProt protein and out to each Reactome pathway identifier, so matching on the shared gene resource joins the two
PREFIX up: <http://purl.uniprot.org/core/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX ensembl: <http://rdf.ebi.ac.uk/terms/ensembl/> SELECT ?gene ?reactomePathway WHERE { BIND(<http://purl.uniprot.org/uniprot/P04637> AS ?protein) SERVICE <https://rdfportal.org/ebi/sparql> { ?gene a ensembl:EnsemblGene ; rdfs:seeAlso ?protein ; rdfs:seeAlso ?reactomePathway . FILTER(STRSTARTS(STR(?reactomePathway), "http://identifiers.org/reactome/")) } } LIMIT 20Use188_batch_gene_symbol_to_uniprot_and_ensembl: Given a batch of human gene symbols (TP53, BRCA1, EGFR), resolve each to its Ensembl gene ID and reviewed UniProt accession in one federated query - the closest direct analogue to biomaRt's getBM() across two live SPARQL endpoints instead of one local database. Gene symbols and the Ensembl gene resource itself only exist in Ensembl's own RDF, so the symbol-to-gene match happens inside the SERVICE clause; restricting to human (RO_0002162, in-taxon) avoids matching the same symbol used for orthologous genes in other species, and the up:reviewed true filter (evaluated locally, since ?protein is already bound to a UniProt IRI) keeps one canonical accession per gene rather than every isoform
PREFIX up: <http://purl.uniprot.org/core/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX ensembl: <http://rdf.ebi.ac.uk/terms/ensembl/> PREFIX dcterms: <http://purl.org/dc/terms/> PREFIX obo: <http://purl.obolibrary.org/obo/> SELECT DISTINCT ?symbol ?ensemblGeneId ?protein WHERE { SERVICE <https://rdfportal.org/ebi/sparql> { VALUES ?symbol { "TP53" "BRCA1" "EGFR" } ?gene a ensembl:EnsemblGene ; rdfs:label ?symbol ; dcterms:identifier ?ensemblGeneId ; obo:RO_0002162 <http://identifiers.org/taxonomy/9606> ; rdfs:seeAlso ?protein . FILTER(STRSTARTS(STR(?protein), "http://purl.uniprot.org/uniprot/")) } ?protein up:reviewed true . } ORDER BY ?symbolUse189_pseudokinases: Find reviewed human pseudokinases: proteins with an annotated protein kinase domain but no annotated kinase (phosphotransferase) catalytic activity at all - a real, well-known biological category (catalytically-dead kinase domains repurposed for scaffolding/allosteric regulation, e.g. Tribbles homologs). The kinase domain itself is a up:Domain_Extent_Annotation whose rdfs:comment names it ("Protein kinase", sometimes qualified "; inactive" or "; truncated")
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 ?domainComment WHERE { ?protein up:reviewed true ; up:organism taxon:9606 ; up:annotation ?domain . ?domain a up:Domain_Extent_Annotation ; rdfs:comment ?domainComment . FILTER(CONTAINS(?domainComment, "Protein kinase")) FILTER(NOT EXISTS { ?protein up:enzyme|up:annotation/up:catalyticActivity/up:enzymeClass ?ec . ?ec rdfs:subClassOf <http://purl.uniprot.org/enzyme/2.7.-.-> }) }Use190_ion_channels_associated_with_disease: Find reviewed proteins classified with the Ion channel keyword that are also linked to a disease, and name the disease - combining a structural/functional classification with clinical relevance
PREFIX up: <http://purl.uniprot.org/core/> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> PREFIX keywords: <http://purl.uniprot.org/keywords/> SELECT ?protein ?diseaseName WHERE { ?protein up:reviewed true ; up:classifiedWith keywords:407 ; up:annotation ?disease . ?disease a up:Disease_Annotation ; up:disease ?d . ?d skos:prefLabel ?diseaseName . }Use191_calcium_dependent_enzymes_with_binding_site: Find reviewed enzymes that both require Ca(2+) as a cofactor and have an annotated calcium-binding site - two distinct annotation types (a stated cofactor requirement vs. an explicit structural binding-site position) corroborating each other for the same ion. Both sides are matched by the actual ChEBI identity of calcium(2+) (CHEBI:29108), not by name text: up:cofactor points directly at the ChEBI IRI, while a binding site's up:ligand is an instance further typed via rdfs:subClassOf to the ChEBI class
PREFIX up: <http://purl.uniprot.org/core/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX CHEBI: <http://purl.obolibrary.org/obo/CHEBI_> SELECT DISTINCT ?protein WHERE { BIND(CHEBI:29108 AS ?calcium) ?protein up:reviewed true ; up:enzyme ?ec ; up:annotation ?cofactor ; up:annotation ?binding . ?cofactor a up:Cofactor_Annotation ; up:cofactor ?calcium . ?binding a up:Binding_Site_Annotation ; up:ligand ?ligand . ?ligand rdfs:subClassOf ?calcium . }Use