query-3ab51caeddeded2caf73056eb1550c8a
List of properties linking an item to a book series, ordered by frequency of use SELECT ?property ?propertyLabel ?count WITH { SELECT ?property ?value (COUNT(DISTINCT ?item) AS ?count) WHERE { ?bookseries wdt:P31/wdt:P279* wd:Q277759. ?item ?wdt ?bookseries. ?property a wikibase:Property; wikibase:directClaim ?wdt. FILTER(?property != wd:P31) } GROUP BY ?property ?value ORDER BY DESC(?count) LIMIT 10 } AS %results WHERE { INCLUDE %results. SERVICE wikibase:label { bd:serviceParam wikibase:language "en-US,en,en". } } ORDER BY DESC(?count)
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#>
#List of properties linking an item to a book series, ordered by frequency of use
SELECT ?property ?propertyLabel ?count WHERE {
{
SELECT ?property ?value (COUNT(DISTINCT ?item) AS ?count) WHERE {
?bookseries wdt:P31/wdt:P279* wd:Q277759.
?item ?wdt ?bookseries.
?property a wikibase:Property;
wikibase:directClaim ?wdt.
FILTER(?property != wd:P31)
}
GROUP BY ?property ?value
ORDER BY DESC(?count)
LIMIT 10
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en-US,en,en". }
}
ORDER BY DESC(?count)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?bookseries")
v6("?count"):::projected
v4("?item")
v2("?property"):::projected
v5("?wdt")
a1((" "))
c4(["wd:Q277759"]):::iri
c11(["en-US,en,en"]):::literal
c9(["bd:serviceParam"]):::iri
c6(["wikibase:Property"]):::iri
f0[["?property != 'wd:P31'"]]
f0 --> v2
v3 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c4
v4 -->v5--> v3
v2 --"a"--> c6
v2 --"wikibase:directClaim"--> v5
bind2[/"count(?item)"/]
v4 --o bind2
bind2 --as--o v6
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end