query-b1f8529a2e3460be8eefe01d4820eaae
Datasets
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#>
SELECT
?works_using_dataset
?dataset ?datasetLabel
(CONCAT("#dataset/", SUBSTR(STR(?dataset), 32)) AS ?datasetUrl)
?example_work ?example_workLabel
(CONCAT("#work/", SUBSTR(STR(?example_work), 32)) AS ?example_workUrl)
WHERE {
{
SELECT
(COUNT(DISTINCT ?work) AS ?works_using_dataset)
?dataset
(SAMPLE(?work) AS ?example_work)
WHERE {
?dataset wdt:P31 / wdt:P279? wd:Q1172284 .
OPTIONAL {
?work wdt:P4510 ?dataset .
}
}
GROUP BY ?dataset
} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?works_using_dataset)
LIMIT 500
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?dataset"):::projected
v5("?datasetUrl")
v4("?example_work"):::projected
v6("?example_workUrl")
v3("?work")
v4("?works_using_dataset"):::projected
a1((" "))
c6(["bd:serviceParam"]):::iri
c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c2(["wd:Q1172284"]):::iri
v2 --"wdt:P31"--> a1
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
a1 --"wdt:P279"--> c2
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
end
union0r <== or ==> union0l
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P4510".-> v2
end
bind2[/"count(?work)"/]
v3 --o bind2
bind2 --as--o v4
bind3[/"sample(?work)"/]
v3 --o bind3
bind3 --as--o v4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end
bind4[/"concat('#dataset/',substring(str(?dataset),'32^^xsd:integer'))"/]
v2 --o bind4
bind4 --as--o v5
bind5[/"concat('#work/',substring(str(?example_work),'32^^xsd:integer'))"/]
v4 --o bind5
bind5 --as--o v6