query-b6b521e9589a0f5e8a296091770e794d
title:Literary works in Latin by label count SELECT ?s ?desc (COUNT(DISTINCT ?label) as ?labelcount) WHERE { ?s wdt:P31 wd:Q7725634 . ?s p:P407 ?statement0. ?statement0 (ps:P407) wd:Q397. ?s rdfs:label ?label . OPTIONAL { ?s rdfs:label ?desc FILTER (lang(?desc) = "en"). } } GROUP BY ?s ?desc ORDER BY DESC(?labelcount)
Use at
- https://query.wikidata.org/sparql
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 p: <http://www.wikidata.org/prop/>
#title:Literary works in Latin by label count
SELECT ?s ?desc (COUNT(DISTINCT ?label) as ?labelcount)
WHERE
{
?s wdt:P31 wd:Q7725634 .
?s p:P407 ?statement0.
?statement0 (ps:P407) wd:Q397.
?s rdfs:label ?label .
OPTIONAL {
?s rdfs:label ?desc FILTER (lang(?desc) = "en").
}
} GROUP BY ?s ?desc ORDER BY DESC(?labelcount)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?desc"):::projected
v5("?label"):::projected
v6("?labelcount")
v3("?s"):::projected
v4("?statement0")
c3(["wd:Q7725634"]):::iri
c6(["wd:Q397"]):::iri
v3 --"p:direct/P31"--> c3
v3 --"p:P407"--> v4
v4 --"p:statement/P407"--> c6
v3 --"rdfs:label"--> v5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."rdfs:label".-> v2
end
bind1[/"count(?label)"/]
v5 --o bind1
bind1 --as--o v6