query-4f85f960d6f2f867610285ed70599eb6

rq turtle/ttl

08:22, 28 April 2020 (UTC) Jurasitelinks would probably be 5 ( about, inLanguage,Name,type,ispartof ) --- I think it's a good idea to count truthy statements separately .. (probably 2). I will have to adjust the numbers per datatype. For references, maybe the above could go a step further.

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX sample: <http://www.wikidata.org/entity/Q30>

SELECT ?type ?count
WHERE
{


  { BIND("basis per item" as ?type)  BIND(6 as ?count) }
  UNION { BIND("labels*1" as ?type)             { SELECT (COUNT(?label) AS ?count) { sample: rdfs:label ?label } } }
  UNION { BIND("description*1" as ?type)  { SELECT (COUNT(?description) AS ?count) { sample: schema:description  ?description } } }
  UNION { BIND("alias*1" as ?type)        { SELECT (COUNT(?alias) AS ?count) { sample: skos:altLabel ?alias } } }

  UNION { BIND("sitelinks*5" as ?type)     { SELECT (COUNT(?sitelink)*5 AS ?count) { ?sitelink schema:about sample: } } }
  UNION { BIND("badge" as ?type)        { SELECT (COUNT(?badge) AS ?count) { ?badge schema:about sample: ; wikibase:badge [] } } }

  UNION { BIND("references" as ?type)   { SELECT (COUNT(*) as ?count) {  sample: ?p ?st . ?st prov:wasDerivedFrom ?a . ?a ?b ?c } } }
  UNION { BIND("qualifiers" as ?type)   { SELECT (COUNT(?qualifier) AS ?count) { sample: ?p ?qualifier . ?qualifier ?pqv [] . [] wikibase:qualifierValue ?pqv . } } }  

  UNION { BIND("best statements*2" as ?type)   { SELECT (COUNT(?truthy)*2 AS ?count) { sample: ?p ?truthy . ?truthy a wikibase:BestRank . } } }
  UNION { SELECT ("statements" as ?type) (SUM(?all) AS ?count) { 
    SELECT ?datatype (COUNT(?c) as ?count0) (SAMPLE(?q) as ?per) (?per * ?count0 as ?all) 
    {

    sample: ?b ?c . 
    ?prop wikibase:claim ?b .
    ?prop wikibase:propertyType ?datatype .
    OPTIONAL { ?typeitem wdt:P856 ?datatype ; p:P2670 
                         [ ps:P2670 wd:Q3539534 ; pq:P1114 ?q ; pq:P1013 wd:Q20950365 ] .}
    }
    GROUP BY ?datatype } } 
} 
ORDER BY DESC(?count)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v10("?a") v5("?alias") v22("?all") v11("?b") v7("?badge") v12("?c") v23("?count"):::projected v20("?count0") v17("?datatype") v4("?description") v3("?label") v8("?p") v21("?per") v14("?pqv") v16("?prop") v19("?q") v13("?qualifier") v6("?sitelink") v9("?st") v15("?truthy") v23("?type"):::projected v18("?typeitem") a1((" ")) a2((" ")) a3((" ")) a4((" ")) c1(["wd:Q30"]):::iri c10(["wikibase:BestRank"]):::iri c15(["wd:Q3539534"]):::iri c18(["wd:Q20950365"]):::iri 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; subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; subgraph union3[" Union "] subgraph union3l[" "] style union3l fill:#abf,stroke-dasharray: 3 3; subgraph union4[" Union "] subgraph union4l[" "] style union4l fill:#abf,stroke-dasharray: 3 3; subgraph union5[" Union "] subgraph union5l[" "] style union5l fill:#abf,stroke-dasharray: 3 3; subgraph union6[" Union "] subgraph union6l[" "] style union6l fill:#abf,stroke-dasharray: 3 3; subgraph union7[" Union "] subgraph union7l[" "] style union7l fill:#abf,stroke-dasharray: 3 3; subgraph union8[" Union "] subgraph union8l[" "] style union8l fill:#abf,stroke-dasharray: 3 3; c1 -->v11--> v12 v16 --"wikibase:claim"--> v11 v16 --"wikibase:propertyType"--> v17 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v18 -."p:direct/P856".-> v17 a4 --"p:statement/P2670"--> c15 a4 --"p:qualifier/P1114"--> v19 a4 --"p:qualifier/P1013"--> c18 v18 --"p:P2670"--> a4 end bind2[/"count(?c)"/] v12 --o bind2 bind2 --as--o v20 bind3[/"sample(?q)"/] v19 --o bind3 bind3 --as--o v21 bind4[/"?per * ?count0"/] v21 --o bind4 v20 --o bind4 bind4 --as--o v22 bind6[/"'statements'"/] bind6 --as--o v23 bind7[/"sum(?all)"/] v22 --o bind7 bind7 --as--o v23 end subgraph union8r[" "] style union8r fill:#abf,stroke-dasharray: 3 3; bind8[/"'best statements*2'"/] bind8 --as--o v23 c1 -->v8--> v15 v15 --"a"--> c10 bind10[/" * '2^^xsd:integer'"/] null --o bind10 bind10 --as--o v23 end union8r <== or ==> union8l end end subgraph union7r[" "] style union7r fill:#abf,stroke-dasharray: 3 3; bind11[/"'qualifiers'"/] bind11 --as--o v23 c1 -->v8--> v13 v13 -->v14--> a2 a3 --"wikibase:qualifierValue"--> v14 bind13[/"count(?qualifier)"/] v13 --o bind13 bind13 --as--o v23 end union7r <== or ==> union7l end end subgraph union6r[" "] style union6r fill:#abf,stroke-dasharray: 3 3; bind14[/"'references'"/] bind14 --as--o v23 c1 -->v8--> v9 v9 --"prov:wasDerivedFrom"--> v10 v10 -->v11--> v12 bind16[/"count(*)"/] bind16 --as--o v23 end union6r <== or ==> union6l end end subgraph union5r[" "] style union5r fill:#abf,stroke-dasharray: 3 3; bind17[/"'badge'"/] bind17 --as--o v23 v7 --"schema:about"--> c1 v7 --"wikibase:badge"--> a1 bind19[/"count(?badge)"/] v7 --o bind19 bind19 --as--o v23 end union5r <== or ==> union5l end end subgraph union4r[" "] style union4r fill:#abf,stroke-dasharray: 3 3; bind20[/"'sitelinks*5'"/] bind20 --as--o v23 v6 --"schema:about"--> c1 bind22[/" * '5^^xsd:integer'"/] null --o bind22 bind22 --as--o v23 end union4r <== or ==> union4l end end subgraph union3r[" "] style union3r fill:#abf,stroke-dasharray: 3 3; bind23[/"'alias*1'"/] bind23 --as--o v23 c1 --"skos:altLabel"--> v5 bind25[/"count(?alias)"/] v5 --o bind25 bind25 --as--o v23 end union3r <== or ==> union3l end end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; bind26[/"'description*1'"/] bind26 --as--o v23 c1 --"schema:description"--> v4 bind28[/"count(?description)"/] v4 --o bind28 bind28 --as--o v23 end union2r <== or ==> union2l end end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; bind29[/"'labels*1'"/] bind29 --as--o v23 c1 --"rdfs:label"--> v3 bind31[/"count(?label)"/] v3 --o bind31 bind31 --as--o v23 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; bind32[/"'basis per item'"/] bind32 --as--o v23 bind33[/"'6^^xsd:integer'"/] bind33 --as--o v23 end union0r <== or ==> union0l end