sparql-examples

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

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

Query_104

rq turtle/ttl

Cell lines from animals belonging the order 'carnivora'

Use at


PREFIX cello: <https://purl.expasy.org/cellosaurus/rdf/ontology/>
PREFIX db: <https://purl.expasy.org/cellosaurus/rdf/db/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
# All cell lines with a child of TaxID: 33554
select ?cl ?cl_name ?xref_db ?xref_ac ?xref_label where {
  ?cl cello:derivedFromIndividualBelongingToSpecies ?species .
  ?cl cello:recommendedName ?cl_name .
  ?species  cello:isIdentifiedByXref ?xref .
  ?xref cello:more_specific_than+ ?generic_concept .
  ?generic_concept skos:notation "33554" ; skos:inScheme db:NCBI_TaxID . # Carnivore
  ?xref cello:accession ?xref_ac ; cello:database ?xref_db; skos:prefLabel ?xref_label .
}
limit 2000
    
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v1("?cl"):::projected 
  v3("?cl_name"):::projected 
  v5("?generic_concept")
  v2("?species")
  v4("?xref")
  v6("?xref_ac"):::projected 
  v7("?xref_db"):::projected 
  v8("?xref_label"):::projected 
  c6(["33554"]):::literal 
  c8([https://purl.expasy.org/cellosaurus/rdf/db/NCBI_TaxID]):::iri 
  v1 --"cello:derivedFromIndividualBelongingToSpecies"-->  v2
  v1 --"cello:recommendedName"-->  v3
  v2 --"cello:isIdentifiedByXref"-->  v4
  v4 --"cello:more_specific_than"-->  v5
  v5 --"skos:notation"-->  c6
  v5 --"skos:inScheme"-->  c8
  v4 --"cello:accession"-->  v6
  v4 --"cello:database"-->  v7
  v4 --"skos:prefLabel"-->  v8