query-6a6276d2e2a4731afbb3cde357abfdd5

rq turtle/ttl

实例和类别不久前我说,维基数据的大多数属性“有”的关系,“有”孩子、“有”父亲、“有”职业。但有时(且其实是经常),你需要说的是“是”。但这实际涉及到两种关系。 一件艺术作品。是一部电影 一部电影。是 亂世佳人 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 。亂世佳人是“电影”类别中的一个特定实例,而类别“电影”是“艺术作品”中的一个更具体的专门子类。 (P279)subclass of 和(P31)instance of 这就是为什么维基数据中针对“是”(“is”)有两个属性, . (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 所以这对于编写SPARQL意味着什么?当我们想搜索“所有艺术作品”时,搜索所有直接隶属于“艺术作品”的实例项目是不够的。

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. # “艺术作品”的实例
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
}

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(["#91;AUTO_LANGUAGE#93;"]):::literal v1 --"wdt:P31"--> c2 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c4 --"wikibase:language"--> c6 end