query-187ae3286440138a1c8f25a707c0d586
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?id (SAMPLE(?owner) as ?owner) (SAMPLE(?ownerLabel) as ?ownerLabel)
WHERE
{
?item wdt:P31 wd:Q14296.
OPTIONAL { ?item wdt:P127 ?owner. }
OPTIONAL { ?item wdt:P5914 ?id. }
SERVICE wikibase:label {
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
?owner rdfs:label ?ownerLabel.
}
} GROUP BY ?item ?id ORDER BY ?id
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?id"):::projected
v2("?item"):::projected
v5("?owner"):::projected
v5("?ownerLabel"):::projected
c6(["bd:serviceParam"]):::iri
c2(["wd:Q14296"]):::iri
c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v2 --"wdt:P31"--> c2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P127".-> v5
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P5914".-> v1
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
v5 --"rdfs:label"--> v5
end
bind2[/"sample(?owner)"/]
v5 --o bind2
bind2 --as--o v5
bind3[/"sample(?ownerLabel)"/]
v5 --o bind3
bind3 --as--o v5