sparql-examples

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

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

098

rq turtle/ttl

Gene aspect: transcripts

Use at

PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
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
  ?transcript_ID
  ?reference ?referenceLabel ?referenceDescription
WITH {
  SELECT ?transcript_ID ?reference
  WHERE {
      target: wdt:P31 wd:Q7187;
                 p:P704 ?transcriptid_statement .
    ?transcriptid_statement ps:P704 ?transcript_ID ;
                            prov:wasDerivedFrom/pr:P248 ?reference .
  }
} AS %result 
WHERE {
  INCLUDE %result
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". }
}
graph TD