query-baedd74697b09f59586eecc58f92fe01
Licenses1. Return a graph of the class/subclass relationships for software licenses: ?licenseLabel ORDER BY } } "en" language:wikibase serviceParam:bd { label:wikibase SERVICE . } ?subclassOf P279:wdt ?license { OPTIONAL . Q207621:wd P279:wdt ?license { WHERE ?subclassOf ?licenseLabel ?license DISTINCT SELECT #defaultView:Graph DISTINCT %3Flicense %3FlicenseLabel %3FsubclassOf WHERE {%0A %3Flicense wdt%3AP279 wd%3AQ207621 .%0A OPTIONAL { %3Flicense wdt%3AP279 %3FsubclassOf } .%0A SERVICE wikibase%3Alabel { bd%3AserviceParam wikibase%3Alanguage "en" }%0A}%0AORDER BY %3FlicenseLabel Try it!2. Return a list of software titles, their licenses, and the superclass of licenses to which they belong: } } ."en" language:wikibase serviceParam:bd { label:wikibase SERVICE ?class P279:wdt ?license .?license P275:wdt ?app .Q7397:wd )*P279:wdt/P31:ps/P31:p( ?app { WHERE ?classLabel ?licenseLabel ?appLabel ?app DISTINCT SELECT 3. Create a bubble chart showing the license superclasses with the most software titles assigned to them.
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/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:BubbleChart
SELECT DISTINCT ?license ?licenseLabel (COUNT(?app) AS ?count)
WHERE {
?app (p:P31/ps:P31/wdt:P279*) wd:Q7397.
?app wdt:P275 ?license.
?license wdt:P279 ?class
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
GROUP BY ?license ?licenseLabel
ORDER BY DESC(?count)