query-e6f8c5e6fa3775206e6db13c224839d6

rq turtle/ttl

NFDI4Microbiota

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
# ?p:NFDI4Microbiota, ?w:institution
WHERE
{
  wd:Q99534506 p:P1416 ?statement .
  ?p p:P1416 ?statement .
  ?statement ps:P1416 ?w .

  # 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,de" }
} ORDER BY ASC(?pLabel) ASC(?affiliationTypeLabel) ASC(?wLabel)

Query found at