query-c6a37c19732be8a1b25c4f85065b571e
Types of laws, by number of instances
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 ?legal_act_typeLabel (count(?legal_act_typeLabel) as ?count) WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
?legal_act wdt:P31/wdt:P279* wd:Q740464.
{?legal_act wdt:P1001 wd:Q155.}
UNION
{?legal_act wdt:P17 wd:Q155.}
UNION
{?legal_act wdt:P495 wd:Q155.}
?legal_act wdt:P31 ?legal_act_type.
}
GROUP BY ?legal_act_typeLabel
ORDER BY DESC(?count)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?count")
v2("?legal_act")
v3("?legal_act_type")
v4("?legal_act_typeLabel"):::projected
a1((" "))
c2(["bd:serviceParam"]):::iri
c4(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c7(["wd:Q740464"]):::iri
c9(["wd:Q155"]):::iri
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c2 --"wikibase:language"--> c4
end
v2 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c7
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
v2 --"wdt:P495"--> c9
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v2 --"wdt:P17"--> c9
end
union1r <== or ==> union1l
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v2 --"wdt:P1001"--> c9
end
union0r <== or ==> union0l
end
v2 --"wdt:P31"--> v3
bind1[/"count(?legal_act_typeLabel)"/]
v4 --o bind1
bind1 --as--o v5