query-ccd19aa6b9a89e114e26ba3393124a63
Tilfælde og klasser . But there are in fact two kinds of relations there: is occupation. But sometimes (in fact, frequently), you also need to talk about what something has father, has child, hasEarlier, I said that most Wikidata properties are “has” relations: a work of art.isA film a film.is Gone with the Wind is one particular film. It has a particular director (Victor Fleming), a specific duration (238 minutes), a list of cast members (Clark Gable, Vivien Leigh, …), and so on. Gone with the Wind of this concept do. instances a work of art, and a work of art usually has a creator, the concept of “film” itself does not have a creator – only particular is is a general concept. Films can have directors, durations, and cast members, but the concept “film” as such does not have any particular director, duration, or cast members. And although a film Film is a particular instance of the class “film”; the class “film” is a subclass (more specific class; specialization) of the more general class “work of art”. Gone with the Wind. (P279)subclass of and (P31)instance of This difference is why there are two properties for “is” in Wikidata: . (P31)instance of does not make sense), it indicates that you are talking about a particular instance and you should use Gone with the wind "is a kind of" film. If "is a kind of" does not work (e.g. the sentence (P279)subclass of To help you to figure about the difference, you can try to use two different verbs: "is a" and "is a kind of". If "is a kind of" works (e.g. A film "is a kind of" work of art), it indicates that you are talking about a subclass, a specialization of a broader class and you should use So what does this mean for us when we’re writing SPARQL queries? When we want to search for “all works of art”, it’s not enough to search for all items that are directly instances of “work of art”:
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 bd: <http://www.bigdata.com/rdf#>
SELECT ?work ?workLabel
WHERE
{
?work wdt:P31 wd:Q838948. # tilfælde af kunstværk
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
}