Koetai SPARQL examples

Community-curated SPARQL example queries for multiple life-science endpoints.

View the Project on GitHub Koetai/sparql-examples

resolve_the_efo_labels_through_a_federated_query

rq turtle/ttl

IDR has annotations using the EFO. This query fetches their label from a remote SPARQL endpoint

Use at

PREFIX ome:  <https://ld.openmicroscopy.org/core/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX efo:  <http://www.ebi.ac.uk/efo/>

SELECT DISTINCT ?value ?term ?label WHERE {
  ?mapEntry ome:key "EFO term" ;
            ome:value ?value .
  BIND(IRI(CONCAT(STR(efo:), ?value)) AS ?term)
  SERVICE <https://sparql.hegroup.org/sparql/> {
    ?term rdfs:label ?label .
  }
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v4("?label"):::projected 
  v1("?mapEntry")
  v3("?term"):::projected 
  v2("?value"):::projected 
  c2(["EFO term"]):::literal 
  v1 --https://ld.openmicroscopy.org/core/key-->  c2
  v1 --https://ld.openmicroscopy.org/core/value-->  v2
  bind0[/"concat(str(http://www.ebi.ac.uk/efo/),?value)"/]
  v2 --o bind0
  bind0 --as--o v3
  subgraph s1["https://sparql.hegroup.org/sparql/"]
    style s1 stroke-width:4px;
    v3 --"rdfs:label"-->  v4
  end