query-cfcb2df70d86513831e06105c960a492
. 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
- 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/>
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