axiothOntology Hub

オントロジーとは何かを学ぶ / 第 2 部 データの表現と接続 · レッスン 8 / 16

選択した言語の翻訳がないため、Englishの内容を表示しています。

Who said so: named graphs and statements about statements

Ways to attach source and time to a triple: named graphs, intermediate nodes, RDF 1.2.

A triple says "Minji keeps Nabi" and stops there. In practice you soon need "who said that?" and "since when?". A triple has no fourth slot, so three techniques are used.

Technique 1. Name a bundle of triples

Group some triples and give the group an IRI, and you have a named graph. You can then record source and collection time per group. A triple written with its graph name as a fourth element is called a quad.

@prefix ex: <https://example.org/> .

ex:shelterRecords {            # what the shelter said
  ex:nabi a ex:Cat .
}
ex:minjiNotes {                # what Minji said
  ex:minji ex:keeps ex:nabi .
}
# facts about a graph go in the default graph
ex:minjiNotes ex:recordedOn "2024-03-02" .

Technique 2. Turn the relation into a node

When one relation carries a value, as in "has kept since 2021", make the relation itself a node and hang properties on it. The "qualified" properties in PROV-O, such as qualifiedGeneration, work this way.

# an edge cannot carry a value, so "keeping" becomes a node
ex:keeping1 a ex:Keeping ;
    ex:keeper ex:minji ;
    ex:pet    ex:nabi ;
    ex:since  2021 .

Technique 3. Point at the triple itself (RDF 1.2)

The next version, RDF 1.2, lets a triple be the object of another triple. This is the proposal once known as RDF-star, now on the standards track. It is not yet a Recommendation, so check what each tool supports.

# RDF 1.2 annotation syntax (Candidate Recommendation Draft)
ex:minji ex:keeps ex:nabi {| ex:since 2021 |} .

Nodes without a name: blank nodes

A node written as [ ... ], with no IRI, is a blank node. It works inside the file and cannot be referred to from outside. Use it for things nobody needs to point at, such as the parts of an address, and give an IRI to anything others must reference.

Per-bundle source: named graph. A value that differs per relation: intermediate node. RDF 1.2 is a new option between the two.

実際のオントロジーで確認する

仕様でさらに読む