sparql-examples

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

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

90_uniprot_affected_by_metabolic_diseases_using_MeSH

Find UniProtKB proteins involved in metabolic diseases using the MeSH concept for 'Metabolic Diseases'.

Use at

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX up: <http://purl.uniprot.org/core/>

SELECT
 ?disease ?protein
WHERE {
  SERVICE<https://id.nlm.nih.gov/mesh/sparql> {
    GRAPH <http://id.nlm.nih.gov/mesh> {
      # Mesh M0013493 represents the concept 'Metabolic Diseases'
	  ?mesh <http://id.nlm.nih.gov/mesh/vocab#broaderDescriptor>* ?broader .
      ?broader <http://id.nlm.nih.gov/mesh/vocab#preferredConcept> <http://id.nlm.nih.gov/mesh/M0013493> .
    }
  }
  GRAPH <http://sparql.uniprot.org/diseases>{
    ?disease a up:Disease ;
    	rdfs:seeAlso ?mesh .
    ?mesh up:database <http://purl.uniprot.org/database/MeSH> .
  }
  GRAPH <http://sparql.uniprot.org/uniprot> {
     ?protein up:annotation/up:disease ?disease . 
  }
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v2("?broader")
  v3("?disease"):::projected 
  v1("?mesh")
  v4("?protein"):::projected 
  a1((" "))
  c11([http://purl.uniprot.org/database/MeSH]):::iri 
  c7(["up:Disease"]):::iri 
  c5([http://id.nlm.nih.gov/mesh/M0013493]):::iri 
  subgraph s1["https://id.nlm.nih.gov/mesh/sparql"]
    style s1 stroke-width:4px;
    v1 --http://id.nlm.nih.gov/mesh/vocab#broaderDescriptor-->  v2
    v2 --http://id.nlm.nih.gov/mesh/vocab#preferredConcept-->  c5
  end
  v3 --"a"-->  c7
  v3 --"rdfs:seeAlso"-->  v1
  v1 --"up:database"-->  c11
  v4 --"up:annotation"-->  a1
  a1 --"up:disease"-->  v3