query-7fb2b5754e5c318f474587c2b2673d03
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: Propertiessubclass of (P279)copyright license (P275)instance of (P31) Software titles by license name and license type:
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#>
SELECT DISTINCT ?app ?appLabel ?licenseLabel ?classLabel
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". }
}
Query found at
- https://www.wikidata.org/wiki/User:Charles_Matthews/Queries
- https://www.wikidata.org/wiki/User:YULdigitalpreservation/SPARQL
- https://www.wikidata.org/wiki/User:YULdigitalpreservation/SPARQLsoftware