query-c9bc7e78564dd355ca21d801845963e2

rq turtle/ttl

test a map of NFDI in NRW

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Map
SELECT DISTINCT ?p ?pLabel ?affiliationType ?affiliationTypeLabel ?w ?wLabel ?geoLoc ?geoHead
# ?p:consortium, ?w:institution
WHERE
{
  ?p wdt:P31 wd:Q98270496 ;
  p:P1416 ?statement .
  ?statement ps:P1416 ?w .
  # check out NRW only map reading four layers
  # ?w (wdt:P131|wdt:P131/wdt:P131|wdt:P131/wdt:P131/wdt:P131|wdt:P131/wdt:P131/wdt:P131/wdt:P131) wd:Q1198
  # check out NRW only map reading three layers
  ?w (wdt:P131|wdt:P131/wdt:P131|wdt:P131/wdt:P131/wdt:P131) wd:Q1198

  # check out NRW only map reading two layers (spoiler: Münster is still missing!)
  # ?w (wdt:P131|wdt:P131/wdt:P131) wd:Q1198 
  # check out NRW only map reading one layer (spoiler: Münster is missing!)
  #?w wdt:P131 wd:Q1198

  # type of affiliation
  OPTIONAL { ?statement pq:P3831 ?affiliationType }
  # location of institution
  OPTIONAL { ?w wdt:P625 ?geoLoc }
  # location of headquarters of institution
  OPTIONAL { ?w (wdt:P159/wdt:P625) ?geoHead }
  # coalesce locations of institution and headquarters
  BIND(COALESCE(?geoLoc, ?geoHead) AS ?geoLoc)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,[AUTO_LANGUAGE]" }
} ORDER BY (?pLabel) (?affiliationTypeLabel) (?wLabel)

Query found at