query-60ae284bda97b6f16592474b3dfd1ade

rq turtle/ttl

Missing licenseCreate a List of all FLOSS without a License (P275)-Statement, sorted by the number of language-links. Linux-Distributions are left out.

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT distinct ?floss ?flossLabel ?count WHERE {
   {
   SELECT ?floss (COUNT (DISTINCT ?labels) as ?count) WHERE {
     {
       ?floss p:P31 ?val.
       ?val ps:P31/wdt:P279* wd:Q506883.
     } Union {
       ?floss p:P31 ?val.
       ?val ps:P31/wdt:P279* wd:Q341.
     } Union {
       ?floss p:P31 ?val.
       ?val ps:P31/wdt:P279* wd:Q1130645.
     } Minus {
       ?floss wdt:P275 ?license
     }

     Filter Not Exists {
       ?floss p:P31 ?val2.
       ?val2 ps:P31 wd:Q131669.
     }

     ?floss rdfs:label ?labels .

     SERVICE wikibase:label {
         bd:serviceParam wikibase:language "en" .
     }  
   } group by ?floss order by desc(?count)
   } .

   SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
   }
} order by DESC(?count)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?count"):::projected v2("?floss"):::projected v6("?labels") v5("?license") v4("?val") v3("?val2") a1((" ")) a2((" ")) a3((" ")) c3(["wd:Q131669"]):::iri c5(["wd:Q506883"]):::iri c7(["wd:Q1130645"]):::iri c13(["en"]):::literal c11(["bd:serviceParam"]):::iri c6(["wd:Q341"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"p:P31"--> e0v2 e0v2 --"p:statement/P31"--> e0c3 e0v1("?floss"):::projected e0v2("?val2"):::projected e0c3(["wd:Q131669"]):::iri end f0--EXISTS--> f0e0 f0 --> v2 f0 --> c1 f0 --> v3 f0 --> c2 f0 --> c3 v2 --"p:P31"--> v3 v3 --"p:statement/P31"--> c3 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 --"p:P31"--> v4 v4 --"p:statement/P31"--> a3 a3 --"p:direct/P279"--> c7 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v2 --"p:P31"--> v4 v4 --"p:statement/P31"--> a2 a2 --"p:direct/P279"--> c6 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"p:P31"--> v4 v4 --"p:statement/P31"--> a1 a1 --"p:direct/P279"--> c5 end union0r <== or ==> union0l end subgraph minus1["MINUS"] style minus1 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P275"--> v5 end v2 --"rdfs:label"--> v6 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 end bind3[/"count(?labels)"/] v6 --o bind3 bind3 --as--o v7 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 end