sparql-examples

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

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

123

rq turtle/ttl

Pathway aspect: participants

Use at

PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
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/Q28031254>

SELECT ?part ?partLabel ?partDescription ?type
WITH {
  SELECT ?part (GROUP_CONCAT(DISTINCT ?type_label; separator=", ") AS ?type)
  WHERE {
    VALUES ?process { wd:Q4915012 wd:Q2996394 }
    target: wdt:P31 ?process ;
             wdt:P527 ?part .
    OPTIONAL { 
      ?part wdt:P31 ?type_ .
      ?type_ rdfs:label ?type_label .
      FILTER (LANG(?type_label) = 'en')
    }
  } GROUP BY ?part
} AS %result
WHERE {
  INCLUDE %result
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en" . }
} ORDER BY ASC(?partLabel)

graph TD