User:MichaelSchoenitzer/FLOSS
Here I list some useful SPARQL-Queries about Free- and OpenSource-Software. If you don't know SPARQL, don't be scared about the source-code, just follow the links and press the 'Execute'-Button.
If you wan't to learn a bit of SPARQL I recommend first watching this video and then reading this page and this tutorial. If you know more good ressources, please let me know.
List all FLOSS
editList all Item with instance of (P31) being anything witch is a subclass of (P279) of free and open-source software (Q506883), free software (Q341) or open-source software (Q1130645).
SELECT ?floss ?flossLabel WHERE {
{
?floss p:P31/ps:P31/wdt:P279* wd:Q506883.
} Union {
?floss p:P31/ps:P31/wdt:P279* wd:Q341.
} Union {
?floss p:P31/ps:P31/wdt:P279* wd:Q1130645.
} Union {
?floss p:P31/ps:P31/wdt:P279* wd:Q19652.
?floss p:P31/ps:P31/wdt:P279* wd:Q7397.
} Union {
?floss p:P31/ps:P31/wdt:P279* wd:Q7397.
?floss wdt:P275 ?licens.
?licens p:P31/ps:P31/(wdt:P31|wdt:P279)* ?kind.
VALUES ?kind { wd:Q196294 wd:Q1156659 }.
}
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en" .
}
}
- software (Q7397) – 2
- free and open-source software (Q506883) – 345
- free software (Q341) – 3361
- open-source software (Q1130645) – 424
- copyright license (P275) – 5956
- free and open-source software (Q506883) ^ free software (Q341) – 345 => 506883 in 341
- free and open-source software (Q506883) ^ open-source software (Q1130645) – 345 => 506883 in 1130645
- free and open-source software (Q506883) ^ copyright license (P275) – 163
- free software (Q341) ^ open-source software (Q1130645) – 376
- free software (Q341) ^ copyright license (P275) – 1833
- open-source software (Q1130645) ^ copyright license (P275) – 216
- free and open-source software (Q506883) ^ free software (Q341) ^ open-source software (Q1130645) – 345
- free and open-source software (Q506883) ^ free software (Q341) ^ copyright license (P275) – 163
- free and open-source software (Q506883) ^ open-source software (Q1130645) ^ copyright license (P275) – 163
- free software (Q341) ^ open-source software (Q1130645) ^ copyright license (P275) – 184
- free and open-source software (Q506883) ^ free software (Q341) ^ open-source software (Q1130645) ^ copyright license (P275) – 163
Statistics
editLicense Statistics
editSELECT ?licenseLabel (COUNT (DISTINCT ?floss) 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.
}
?floss wdt:P275 ?license
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en" .
}
} group by ?licenseLabel order by desc(?count)
Programming Language Statistics
editSELECT ?langLabel (COUNT (DISTINCT ?floss) 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.
}
?floss wdt:P277 ?lang
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en" .
}
} group by ?langLabel order by desc(?count)
OS Statistics
editSELECT ?os ?osLabel (COUNT (DISTINCT ?floss) 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.
}
?floss wdt:P306 ?os
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en" .
}
} group by ?os ?osLabel order by desc(?count)
Type of Software
editSELECT ?typeLabel (count(?typeLabel) 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.
}
?floss p:P31 ?val2.
filter(?val2 != ?val).
?val2 ps:P31 ?type.
SERVICE wikibase:label {
bd:serviceParam wikibase:language "de" .
}
} group by ?typeLabel order by desc(?count)
Missing license
editCreate a List of all FLOSS without a License (P275)-Statement, sorted by the number of language-links. Linux-Distributions are left out.
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)