Semantics: Andy's proposal - w3c/rdf-star-wg GitHub Wiki
graph ::= (triple)*
triple ::= subject predicate object
subject ::= iri | BlankNode | tripleOccurrence
predicate ::= iri
object ::= term
term ::= iri | BlankNode | literal | tripleOccurrence
tripleOccurrence ::= identifier triple
identifier ::= iri | BlankNode
Note:
A term is denoted by r, a triple by t, and a graph by g.
Given a tripleOccurrence r, we denote the identifier of r as r.id, and the subject, predicate, object of r as r.s, r.p, r.o, respectively.
Given a triple t, we denote the subject, predicate, object of t as t.s, t.p, t.o, respectively.
RDF 1.1 syntax is the above without the tripleOccurrence category.
An RDF-star simple interpretation I is a structure <IR, IP, IS, IL, IEXT, IT, IO> consisting of:
- A non-empty set
IRof resources, called the domain or universe ofI. - A set
IP, called the set of properties ofI. - A mapping
ISfrom IRIs intoIR ⋃ IP, called the interpretation of IRIs. - A partial mapping
ILfrom literal intoIR, called the interpretation of literals. - A mapping
IEXTfromIPinto2IR x IR, called the extension of properties. - A binary relation
IOoverIR x (IR x IP x IR), called the occurrence of a triple term.
A is a mapping from BlankNode to IR.
Given I and A, the function [I+A](.) is defined over terms, triples, and graphs as follows.
-
[I+A](r) = IL(r)ifris a literal
-
[I+A](r) = IS(r)ifris a iri
-
[I+A](r) = A(r)ifris a BlankNode
-
[I+A](r) = [I+A](r.id)ifris a tripleOccurrence
-
[I+A](t) = TRUEif and only if<[I+A](t.s),[I+A](t.o)> ∈ IEXT([I+A](t.p))and-
<[I+A](ts.id), <[I+A](ts.s),[I+A](ts.p),[I+A](ts.o)>> ∈ IO
ift.sis a tripleOccurrencets -
<[I+A](to.id), <[I+A](to.s),[I+A](to.p),[I+A](to.o)>> ∈ IO
ift.ois a tripleOccurrenceto
-
-
[I+A](g) = TRUEif and only if∀ t ∈ g . [I+A](t) = TRUE
An interpretation I is called a model of a graph g if there exists A such that [I+A](g) = TRUE.
The set of all models of a graph g is called models(g).
Simple entailment: g ⊨ g' if and only if models(g) ⊆ models(g').
Note:
RDF 1.1 semantics is the above without the IO binary relation in the interpretation.
A review of the standard semantics of RDF 1.0: semantics of RDF.pdf.
<< :wed-1 | :liz :spouse :richard >>
:starts 1964 ;
:ends 1974 .
<< :wed-1 | :richard :spouse :liz >>
:location :montreal .
<< :wed-2 | :liz :spouse :richard >>
:starts 1975 ;
:ends 1976 .
<< :wed-2 | :liz a :wife >>
:location :botswana .
The above entails:
:wed-1 :starts 1964 .
<< [] | _:x a :wife >>
:starts 1975 .
More examples:
<< _:bp1-23 | :book1 :datePublished 2023 >>
a :PublicationEvent .
<< _:bp1-23 | :book1 :publisher :p1 >>
:location :London .
:john :believes
<< :s1 | << [] | :liz :spouse :richard >>
:starts 1964 >> .
:s1 :certified-by :us-census .
:paul :believes
<< :s2 | << [] | :liz :spouse :richard >>
:starts 1965 >> .
- Triple term shortcut:
<< :s :p :o >>➡️
<< [] | :s :p :o >> - Annotation shortcut:
:s :p :o {| :id | :p1 o1; :p2 o2 |} .➡️
<< :id | :s :p :o >> :p1 o1; :p2 o2 .
:s :p :o .