sparql-examples

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

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

39

rq turtle/ttl

Using the SwissLipids to ChEBI, and ChEBI to molmedb links, find Membrane Models and their labels

Use at

PREFIX CHEBI: <http://purl.obolibrary.org/obo/CHEBI_>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX mmdbvoc: <https://rdf.molmedb.upol.cz/vocabulary#>
PREFIX bao: <http://www.bioassayontology.org/bao#BAO_>
SELECT
 ?lipid
 ?chebi
 ?modelLabel
 ?model
WHERE {
  ?lipid owl:equivalentClass ?chebi .
  SERVICE <https://idsm.elixir-czech.cz/sparql/endpoint/molmedb> {
    SELECT
      DISTINCT
        ?chebi
        ?model
        ?modelLabel
    WHERE {
      ?substance skos:closeMatch ?chebi .
      ?interaction bao:0090012 ?model ,
                               ?substance .
      ?model a mmdbvoc:MembraneModel ;
             rdfs:label ?modelLabel .
    }
  }
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v2("?chebi"):::projected 
  v4("?interaction")
  v1("?lipid"):::projected 
  v5("?model"):::projected 
  v6("?modelLabel"):::projected 
  v3("?substance")
  c6(["mmdbvoc:MembraneModel"]):::iri 
  v1 --"owl:equivalentClass"-->  v2
  subgraph s1["https://idsm.elixir-czech.cz/sparql/endpoint/molmedb"]
    style s1 stroke-width:4px;
    v3 --"skos:closeMatch"-->  v2
    v4 --"bao:0090012"-->  v5
    v4 --"bao:0090012"-->  v3
    v5 --"a"-->  c6
    v5 --"rdfs:label"-->  v6
  end