query-59cb75a4f6e6a43ebf0f4e3cb8e962d7
I want to list the sitelink to English and German Wikipedia
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?sitelink_de ?sitelink_en ?ATP_Kennung (GROUP_CONCAT(?sitey;SEPARATOR=' ') AS ?sites) {
OPTIONAL { ?item wdt:P536 ?ATP_Kennung. }
?site schema:about ?item .
BIND(STRAFTER(STRBEFORE(STR(?site),'.org'),'//') AS ?sitex)
BIND(STRBEFORE(?sitex,'.') AS ?sitey)
SERVICE wikibase:label { bd:serviceParam wikibase:language "de,en,[AUTO_LANGUAGE]". }
}
GROUP BY ?item ?itemLabel ?sitelink_de ?sitelink_en ?ATP_Kennung ?sitelinks
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?ATP_Kennung"):::projected
v1("?item"):::projected
v3("?site")
v6("?sites")
v4("?sitex")
v5("?sitey"):::projected
c4(["bd:serviceParam"]):::iri
c6(["de,en,#91;AUTO_LANGUAGE#93;"]):::literal
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P536".-> v2
end
v3 --"schema:about"--> v1
bind0[/"substring-after(substring-before(str(?site),'.org'),'//')"/]
v3 --o bind0
bind0 --as--o v4
bind1[/"substring-before(?sitex,'.')"/]
v4 --o bind1
bind1 --as--o v5
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c4 --"wikibase:language"--> c6
end
bind3[/"?sitey"/]
v5 --o bind3
bind3 --as--o v6