query-8b5197fc4c83b302c4447a2abec0c04d
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX schema: <http://schema.org/>
SELECT DISTINCT ?item ?itemLabel ?sitelink_final ?Instagram_username WHERE {
values ?item {wd:Q728958 wd:Q2408789 wd:Q1927604}
?item wdt:P2003 ?Instagram_username.
OPTIONAL { ?sitelink schema:about ?item.
?sitelink schema:isPartOf <https://en.wikipedia.org/>. }
OPTIONAL { ?sitelink2 schema:about ?item.
?sitelink2 schema:isPartOf <https://fr.wikipedia.org/>. }
bind(if(bound(?sitelink), ?sitelink, if(bound(?sitelink2),?sitelink2,"nada")) as ?sitelink_final)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?Instagram_username"):::projected
v1("?item"):::projected
v3("?sitelink")
v4("?sitelink2")
v5("?sitelink_final"):::projected
c4([https://en.wikipedia.org/]):::iri
c7(["bd:serviceParam"]):::iri
c5([https://fr.wikipedia.org/]):::iri
c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal
bind0[/VALUES ?item/]
bind0-->v1
bind00(["wd:Q728958"])
bind00 --> bind0
bind01(["wd:Q2408789"])
bind01 --> bind0
bind02(["wd:Q1927604"])
bind02 --> bind0
v1 --"wdt:P2003"--> v2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."schema:about".-> v1
v3 --"schema:isPartOf"--> c4
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v4 -."schema:about".-> v1
v4 --"schema:isPartOf"--> c5
end
bind1[/"if(bound(?sitelink),?sitelink,if(bound(?sitelink2),?sitelink2,'nada'))"/]
v3 --o bind1
v4 --o bind1
bind1 --as--o v5
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end