sparql-examples

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

View the Project on GitHub BiGCAT-UM/sparql-examples

096

rq turtle/ttl

Gene aspect: orthologs

Use at

PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://wikidata.org/entity/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX target: <http://www.wikidata.org/entity/Q14860818>

SELECT
  ?ortholog ?orthologLabel ?orthologDescription
  ?taxon ?taxonLabel ?taxonDescription
WITH {
  SELECT ?ortholog ?taxon
  WHERE {
    target: wdt:P31 wd:Q7187;
         wdt:P684 ?ortholog .
    ?ortholog wdt:P703 ?taxon .
  }
} AS %result 
WHERE {
  INCLUDE %result
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". }
}
graph TD