query-7f267431598cc21d1ba47ef0702fccf5

rq turtle/ttl

Wikidata authority control properties related to libraries which are not VIAF source IDs, with number of items using them and number of values of them (only main values with best rank), total number of IDs and Mix'n'match catalog - may sometimes timeout SELECT ?p ?pLabel ?items_with_property ?uses_of_property ?number_of_ids (URI(CONCAT("https://mix-n-match.toolforge.org/#/catalog/",?MnMid)) AS ?MnM) WHERE { { SELECT ?p ?number_of_ids ?MnMid (COUNT(DISTINCT(?item)) as ?items_with_property) (COUNT(?value) as ?uses_of_property) WHERE { ?p wdt:P31 wd:Q96776953 . MINUS { ?p wdt:P31/wdt:P279* wd:Q55586529 . } ?p wikibase:claim ?claim. ?item ?claim ?value. OPTIONAL { ?p wdt:P4876 ?number_of_ids . } OPTIONAL { ?p wdt:P2264 ?MnMid . } } GROUP BY ?p ?number_of_ids ?MnMid } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }

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#>
#Wikidata authority control properties related to libraries which are not VIAF source IDs, with number of items using them and number of values of them (only main values with best rank), total number of IDs and Mix'n'match catalog - may sometimes timeout
SELECT ?p ?pLabel ?items_with_property ?uses_of_property ?number_of_ids (URI(CONCAT("https://mix-n-match.toolforge.org/#/catalog/",?MnMid)) AS ?MnM)
WHERE
{
  {
    SELECT ?p ?number_of_ids ?MnMid
      (COUNT(DISTINCT(?item)) as ?items_with_property)
      (COUNT(?value) as ?uses_of_property)
    WHERE
    {
      ?p wdt:P31 wd:Q96776953 .
      MINUS { ?p wdt:P31/wdt:P279* wd:Q55586529 . }
      ?p wikibase:claim ?claim.
      ?item ?claim ?value.
      OPTIONAL { ?p wdt:P4876 ?number_of_ids . }
      OPTIONAL { ?p wdt:P2264 ?MnMid . }
    }
    GROUP BY ?p ?number_of_ids ?MnMid
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v9("?MnM") v6("?MnMid"):::projected v2("?claim") v3("?item") v7("?items_with_property"):::projected v5("?number_of_ids"):::projected v1("?p"):::projected v8("?uses_of_property"):::projected v4("?value") a1((" ")) c4(["wd:Q55586529"]):::iri c9(["bd:serviceParam"]):::iri c2(["wd:Q96776953"]):::iri c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal v1 --"wdt:P31"--> c2 subgraph minus0["MINUS"] style minus0 stroke-width:6px,fill:pink,stroke:red; v1 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c4 end v1 --"wikibase:claim"--> v2 v3 -->v2--> v4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P4876".-> v5 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P2264".-> v6 end bind3[/"count(?item)"/] v3 --o bind3 bind3 --as--o v7 bind4[/"count(?value)"/] v4 --o bind4 bind4 --as--o v8 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end bind5[/"concat('https://mix-n-match.toolforge.org/#/catalog/',?MnMid)"/] v6 --o bind5 bind5 --as--o v9