query-5253c4727061848b61d49c9d10641744

rq turtle/ttl

TODO

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 bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?language ?sitelink ?article
WHERE 
{
  ?item wdt:P17|wdt:P27|wdt:P1532|wdt:P495 wd:Q837.
  OPTIONAL {?sitelink ^schema:name ?article .
            ?article   schema:about ?item ;
                       schema:isPartOf ?schema . 
  BIND(REPLACE(str(?schema),"https://","") as ?l1)
  BIND(REPLACE(str(?l1),".wikipedia.org/","") as ?language) }  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],ne,en". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?article"):::projected v1("?item"):::projected v5("?l1") v6("?language"):::projected v4("?schema") v3("?sitelink"):::projected c10(["bd:serviceParam"]):::iri c2(["wd:Q837"]):::iri c12(["#91;AUTO_LANGUAGE#93;,ne,en"]):::literal subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P495"--> c2 end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P1532"--> c2 end union2r <== or ==> union2l end end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P27"--> c2 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P17"--> c2 end union0r <== or ==> union0l end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."schema:name".-> v3 v2 --"schema:about"--> v1 v2 --"schema:isPartOf"--> v4 bind0[/"replace(str(?schema),'https://','')"/] v4 --o bind0 bind0 --as--o v5 bind1[/"replace(str(?l1),'.wikipedia.org/','')"/] v5 --o bind1 bind1 --as--o v6 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 end