query-0e2c7a07c949e549084abecc31418e23

rq turtle/ttl

Underlying lk

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
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#>
SELECT ?id
  (if(BOUND(?link),
      concat('[[', substr(str(?link),31,500),  '|', ?idLabel, ']]'),
      ?idLabel)
   as ?title)
WHERE {

  ?_ wdt:P131* wd:Q7948 .
  ?locst ps:P131 ?_ .
  ?id p:P131 ?locst  . 
  ?__ wdt:P279* wd:Q1849719 .
  ?id p:P31/ps:P31 ?__ .
  MINUS { ?locst pq:P582 [] }
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language 'en' .
    ?id rdfs:label ?idLabel .
  }
  OPTIONAL {?link schema:about ?id .
  ?link schema:isPartOf <https://en.wikipedia.org/> . }
} GROUP BY ?id ?link ?idLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?_") v4("?__") v3("?id"):::projected v5("?idLabel"):::projected v6("?link"):::projected v2("?locst") v7("?title") a2((" ")) a1((" ")) c2(["wd:Q7948"]):::iri c6(["wd:Q1849719"]):::iri c13(["en"]):::literal c17([https://en.wikipedia.org/]):::iri c11(["bd:serviceParam"]):::iri v1 --"p:direct/P131"--> c2 v2 --"p:statement/P131"--> v1 v3 --"p:P131"--> v2 v4 --"p:direct/P279"--> c6 v3 --"p:P31"--> a1 a1 --"p:statement/P31"--> v4 subgraph minus0["MINUS"] style minus0 stroke-width:6px,fill:pink,stroke:red; v2 --"p:qualifier/P582"--> a2 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 v3 --"rdfs:label"--> v5 end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v6 -."schema:about".-> v3 v6 --"schema:isPartOf"--> c17 end bind1[/"if(bound(?link),concat('#91;#91;',substring(str(?link),'31^^xsd:integer','500^^xsd:integer'),'|',?idLabel,'#93;#93;'),?idLabel)"/] v6 --o bind1 v5 --o bind1 bind1 --as--o v7