query-cfcb2df70d86513831e06105c960a492

rq turtle/ttl

. The result should be grouped by number: X items have 1 value of VIAF members, Y items have 2 values of VIAF members, Z items have 3 values of VIAF members ... (P1006)Nationale Thesaurus voor Auteursnamen ID , (P244)Library of Congress authority ID , (P8189)J9U ID , (P227)GND ID the result would be 4 (1 value each for (Q20002932)Heliodorus and has the ?cod. Just an example: for (Q55586529)Wikidata property for authority control by VIAF member (P31)instance of in the items, i.e. how many items have X (e.g. 3) values of claims using a property which has properties are present in them); what I need is a count of the compresence of these (P396)SBN author ID and how many main values of (P396)SBN author ID in the items (e.g. on how many items have main values of propertiesrecords the uses of all VIAF members; I would need a similar query, which I will try to describe. So, at the moment the query counts the presence of 13:23, 20 July 2020 (UTC) dosisEpìI obviously fear timeout, but maybe it is avoidable in some way. --13:25, 20 July 2020 (UTC) dosisEpì and have the ?cod. Don't know, it may as well be worse for timeout ... --(Q55586529)Wikidata property for authority control by VIAF member (P31)instance of Little idea: an alternative way of approaching the problem would be counting all the values of external-ids present in each item and then considering only the values of properties which are

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?prop_per_item (COUNT(DISTINCT ?item) as ?nb) (SAMPLE(?item) as ?sample)
WHERE
{
  {
    SELECT ?item  (COUNT(DISTINCT ?claim) as ?prop_per_item)
    {


{
 SELECT DISTINCT ?claim { ?id wdt:P31 wd:Q55586529 ; wikibase:claim ?claim }
}      ?item wdt:P27 wd:Q38 . 
      ?item ?claim []
    }
    GROUP BY ?item
  }
}
GROUP BY ?prop_per_item
ORDER BY ?prop_per_item

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?claim") v2("?id") v4("?item"):::projected v5("?nb") v5("?prop_per_item"):::projected v6("?sample") a1((" ")) c2(["wd:Q55586529"]):::iri c5(["wd:Q38"]):::iri v2 --"wdt:P31"--> c2 v2 --"wikibase:claim"--> v3 v4 --"wdt:P27"--> c5 v4 -->v3--> a1 bind1[/"count(?claim)"/] v3 --o bind1 bind1 --as--o v5 bind4[/"count(?item)"/] v4 --o bind4 bind4 --as--o v5 bind5[/"sample(?item)"/] v4 --o bind5 bind5 --as--o v6