query-0f160a6bd20231b2095159812f39ebf7

rq turtle/ttl

List of properties linking a creative work 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. ?item wdt:P31/wdt:P279 wd:Q17537576. ?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

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 a creative work 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.
    ?item wdt:P31/wdt:P279* wd:Q17537576.
    ?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((" ")) a2((" ")) c4(["wd:Q277759"]):::iri c12(["en-US,en,en"]):::literal c10(["bd:serviceParam"]):::iri c7(["wikibase:Property"]):::iri c5(["wd:Q17537576"]):::iri f0[["?property != 'wd:P31'"]] f0 --> v2 v3 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c4 v4 -->v5--> v3 v4 --"wdt:P31"--> a2 a2 --"wdt:P279"--> c5 v2 --"a"--> c7 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; c10 --"wikibase:language"--> c12 end