User:YULdigitalpreservation/SoftwareKO
This page is dedicated to software organization by type/category
[edit]Through working with the data relating to resources in the domain of computing I have observed multiple patterns for describing software types/categories.
I will describe each pattern. I will share relevant SPARQL queries and Shape Expressions (Q29377880) schemas to illustrate options and trade-offs.
I hope to start a conversation among Wikidata editors to see if we can identify a preferred pattern.
Why categorize software
[edit]- AlternativeTo
- Faceted search
Genre
[edit]Please see this ShEx schema which expresses this pattern.
Here is a SPARQL query to identify items using genre:
The following query uses these:
- Items: software (Q7397) , video game (Q7889)
- Properties: instance of (P31) , subclass of (P279) , genre (P136)
SELECT ?item ?itemLabel ?genre ?genreLabel WHERE { ?item wdt:P31/wdt:P279* wd:Q7397. ?item wdt:P136 ?genre. MINUS {?item wdt:P31/wdt:P279* wd:Q7889.} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }
Use
[edit]Here is a query that will return a table:
The following query uses these:
- Items: software (Q7397) , video game (Q7889)
- Properties: instance of (P31) , subclass of (P279) , has use (P366)
SELECT DISTINCT ?item ?itemLabel ?use ?useLabel WHERE { ?item wdt:P31/wdt:P279* wd:Q7397. ?item wdt:P366 ?use. MINUS {?item wdt:P31/wdt:P279* wd:Q7889.} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }
This query will allow us to see the different values that are combined with "use" for software:
The following query uses these:
- Items: software (Q7397) , video game (Q7889)
- Properties: instance of (P31) , subclass of (P279) , has use (P366)
SELECT DISTINCT ?use ?useLabel (COUNT (?item) as ?count) WHERE { ?item wdt:P31/wdt:P279* wd:Q7397. ?item wdt:P366 ?use. MINUS {?item wdt:P31/wdt:P279* wd:Q7889.} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } GROUP BY ?use ?useLabel ORDER BY DESC (?count)
P31 type of software
[edit]First we need to collect the types of software from Wikidata:
The following query uses these:
- Properties: instance of (P31)
SELECT ?item ?itemLabel WHERE { ?item wdt:P31 wd:Q28530532. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }
Then we can combine that with software that is said to be an instance of any of those types:
The following query uses these:
- Properties: instance of (P31) , subclass of (P279)
SELECT ?software ?softwareLabel ?item ?itemLabel WHERE { ?item wdt:P31 wd:Q28530532. ?software wdt:P31/wdt:P279* ?item. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }
In Jan 2019 more than 110,000 software items match this pattern.
Subclass of a software title
[edit]The following query uses these:
- Items: software (Q7397)
- Properties: subclass of (P279) , instance of (P31)
SELECT ?item ?itemLabel ?software ?softwareLabel WHERE { ?item wdt:P279 ?software. ?software wdt:P31/wdt:P279* wd:Q7397. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }
Software part of a series
[edit]The following query uses these:
- Items: software (Q7397)
- Properties: instance of (P31) , subclass of (P279) , part of the series (P179)
SELECT ?software ?softwareLabel ?series ?seriesLabel WHERE { ?software wdt:P31/wdt:P279* wd:Q7397. ?software wdt:P179 ?series. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }
Software part of a series (video games removed)
[edit]The following query uses these:
- Items: software (Q7397) , video game (Q7889)
- Properties: instance of (P31) , subclass of (P279) , part of the series (P179)
SELECT ?software ?softwareLabel ?series ?seriesLabel WHERE { ?software wdt:P31/wdt:P279* wd:Q7397. ?software wdt:P179 ?series. MINUS {?software wdt:P31/wdt:P279* wd:Q7889.} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }
Software edition of software title
[edit]The following query uses these:
- Items: software (Q7397)
- Properties: instance of (P31) , subclass of (P279) , edition or translation of (P629)
SELECT ?item ?itemLabel ?software ?softwareLabel WHERE { ?item wdt:P31/wdt:P279* wd:Q7397. ?software wdt:P629 ?item. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }
Subclass of software
[edit]P279
[edit]There are currently 1500 subclasses of software.
P31 one of those subclasses
The following query uses these:
- Items: software (Q7397)
- Properties: instance of (P31) , subclass of (P279)
SELECT DISTINCT ?item WHERE { ?item wdt:P31 ?class. ?class wdt:P279 wd:Q7397. }
2835 using this pattern in early Jan 2019
ShEx schema
[edit]Please consult this github repo to see this schema expressed in Shape Expressions (Q29377880). This diagram was created using the RDFShape tool.