query-ed69d88423589095c498d9a9b3691f59

rq turtle/ttl

Instances and classes. 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: 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 search for all items that are directly instances of “work of art”: Instances and classesUser:TomT0m/Classification and Help:Basic membership propertiesSee also: : is occupation. But sometimes (in fact, frequently), you also need to talk about what something has father, has child, hasEarlier, we noted that most Wikidata properties are “has” relations:  ⟩  (Q838948)work of art ⟨  (P279)subclass of  ⟩  (Q11424)film ⟨   ⟩  (Q11424)film ⟨  (P31)instance of  ⟩  (Q2875)Gone with the Wind ⟨  of work of art: direct instancesWhen we want to search for “all work of art”, it’s not enough search for all items that are

Use at

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. # instance of work of art
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?work"):::projected c2(["wd:Q838948"]):::iri c4(["bd:serviceParam"]):::iri c6(["en"]):::literal v1 --"wdt:P31"--> c2 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c4 --"wikibase:language"--> c6 end