query-1bd85034d6dc3b627b15e56635ac29dd

rq turtle/ttl

items with most values of the property P1700

added by User:Infovarius, 2019-07-15

SELECT ?item ?itemLabel ?cnt { { SELECT ?item (COUNT(?value) AS ?cnt) { # ?item wdt:P1700 ?value

      { ?item wdt:P137 wd:Q172771 . }   UNION    #navy hms
      { ?item wdt:P137 wd:Q11220 .  }   UNION    #uss
      { ?item wdt:P137 wd:Q217406 . }            #frenca

    #          { ?item wdt:P793 ?event . }        #evento notavel

            ?item ?propri ?value .

   }
   GROUP BY ?item ORDER BY DESC(?cnt) LIMIT 100

} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } ORDER BY DESC(?cnt)

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#>
# items with most values of the property P1700
# added by User:Infovarius, 2019-07-15
SELECT ?item ?itemLabel ?cnt
{
  {
       SELECT ?item (COUNT(?value) AS ?cnt)
       {
    #      ?item wdt:P1700 ?value  

          { ?item wdt:P137 wd:Q172771 . }   UNION    #navy hms
          { ?item wdt:P137 wd:Q11220 .  }   UNION    #uss
          { ?item wdt:P137 wd:Q217406 . }            #frenca

        #          { ?item wdt:P793 ?event . }        #evento notavel

                ?item ?propri ?value .

       }
       GROUP BY ?item ORDER BY DESC(?cnt) LIMIT 100
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?cnt)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?cnt"):::projected v2("?item"):::projected v3("?propri") v4("?value") c3(["wd:Q11220"]):::iri c6(["bd:serviceParam"]):::iri c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal c4(["wd:Q217406"]):::iri c2(["wd:Q172771"]):::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; v2 --"wdt:P137"--> c4 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P137"--> c3 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P137"--> c2 end union0r <== or ==> union0l end v2 -->v3--> v4 bind1[/"count(?value)"/] v4 --o bind1 bind1 --as--o v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c8 end