query-24155581f470ba00fbb21b9461ae0b10
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 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 DISTINCT (?item AS ?QNumber) ?P220 ?LanguageLabel ?P1098 ?Qualifier_P585
WHERE
{
VALUES ?instance_of { wd:Q34770 wd:Q33384 } # Language or dialect
?item wdt:P31 ?instance_of .
OPTIONAL { ?item wdt:P220 ?P220 . } # ISO 639 3 code
?item p:P1098 ?no_of_speakers_statement .
?no_of_speakers_statement wikibase:rank wikibase:PreferredRank . # Has preferred rank
?no_of_speakers_statement pq:P518 wd:Q36870 . # Has the qualifier applies to part = first language
?no_of_speakers_statement ps:P1098 ?P1098 . # No of speakers
OPTIONAL { ?no_of_speakers_statement pq:P585 ?Qualifier_P585 . } # Optional timestamp
SERVICE wikibase:label
{
bd:serviceParam wikibase:language "en" .
?item rdfs:label ?LanguageLabel .
}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v7("?LanguageLabel"):::projected
v5("?P1098"):::projected
v3("?P220"):::projected
v8("?QNumber")
v6("?Qualifier_P585"):::projected
v1("?instance_of")
v2("?item"):::projected
v4("?no_of_speakers_statement")
c5(["wikibase:PreferredRank"]):::iri
c13(["en"]):::literal
c11(["bd:serviceParam"]):::iri
c7(["wd:Q36870"]):::iri
bind0[/VALUES ?instance_of/]
bind0-->v1
bind00(["wd:Q34770"])
bind00 --> bind0
bind01(["wd:Q33384"])
bind01 --> bind0
v2 --"p:direct/P31"--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P220".-> v3
end
v2 --"p:P1098"--> v4
v4 --"wikibase:rank"--> c5
v4 --"p:qualifier/P518"--> c7
v4 --"p:statement/P1098"--> v5
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v4 -."p:qualifier/P585".-> v6
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c11 --"wikibase:language"--> c13
v2 --"rdfs:label"--> v7
end
bind1[/"?item"/]
v2 --o bind1
bind1 --as--o v8