sparql-examples

A set of SPARQL examples that are used in different SIB resources

View the Project on GitHub sib-swiss/sparql-examples

72_enzymes_mapping_to_PDB

Select a mapping of UniProtKB enzymes to PDB entries using the UniProtKB cross-references to the PDB database.

Use at

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX 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> .
  {
    ?protein up:enzyme ?enzyme .
  } UNION {
    ?protein up:annotation/rdf:type up:Catalytic_Activity_Annotation .
  }
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v2("?db"):::projected 
  v3("?enzyme")
  v1("?protein"):::projected 
  a1((" "))
  c5([http://purl.uniprot.org/database/PDB]):::iri 
  c8(["up:Catalytic_Activity_Annotation"]):::iri 
  c2(["up:Protein"]):::iri 
  v1 --"a"-->  c2
  v1 --"rdfs:seeAlso"-->  v2
  v2 --"up:database"-->  c5
  subgraph union0[" Union "]
  subgraph union0l[" "]
    style union0l fill:#abf,stroke-dasharray: 3 3;
    v1 --"up:annotation"-->  a1
    a1 --"a"-->  c8
  end
  subgraph union0r[" "]
    style union0r fill:#abf,stroke-dasharray: 3 3;
    v1 --"up:enzyme"-->  v3
  end
  union0r <== or ==> union0l
  end