Skip to content

Triple‐Edge subgroup proposals

Andy Seaborne edited this page Jan 5, 2024 · 4 revisions

Some inputs:

This page will become a self-contained proposal.

For now some inputs are from

Named Occurrence sketch: https://lists.w3.org/Archives/Public/public-rdf-star-wg/2024Jan/0000.html

Previous tripe term sketch: https://lists.w3.org/Archives/Public/public-rdf-star-wg/2023Dec/0033.html

and the email threads arising.

There is also: semantics description for 2024Jan/0000.html

Intro

Key concepts / new RDF terms

"What's new?"

Motivating factors / technical use case

  • Unasserted triples, quotation - talking about something that is not asserted (not a triple in the graph)

annotation (talking about something asserted) and quoting (talking about something not asserted) — see near the end of https://www.w3.org/2023/11/16-rdf-star-minutes.html

  • Talking about talking about something that is asserted.

Quotation implies??

Motivating example

Based on annotation syntax? Alternative? Assertion and "occurrence" written explicitly

"Unasserted"

RDF Data Model

For a named occurrence approach: https://lists.w3.org/Archives/Public/public-rdf-star-wg/2024Jan/0000.html

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  

Terminology

? Occurrence
? Named Occurrence
? Occurrence of what?

RDF 1.2 Concepts changes

Semantics

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:

  1. A non-empty set IR of resources, called the domain or universe of I.
  2. A set IP, called the set of properties of I.
  3. A mapping IS from IRIs into IR ⋃ IP, called the interpretation of IRIs.
  4. A partial mapping IL from literal into IR, called the interpretation of literals.
  5. A mapping IEXT from IP into 2IR x IR, called the extension of properties.
  6. A binary relation IO over IR 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) if r is a literal
  • [I+A](r) = IS(r) if r is a iri
  • [I+A](r) = A(r) if r is a BlankNode
  • [I+A](r) = [I+A](r.id) if r is a tripleOccurrence

  • [I+A](t) = TRUE if 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
      if t.s is a tripleOccurrence ts
    • <[I+A](to.id), <[I+A](to.s),[I+A](to.p),[I+A](to.o)>> ∈ IO
      if t.o is a tripleOccurrence to

  • [I+A](g) = TRUE if 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').

Concrete Syntax

Turtle

A named occurrence is written in Turtle as an RDF term:

<< occurrenceName | :s :p :o >>

This names an occurrence of the triple s p o.

The triple is not asserted, keeping "assertion" and "occurrence" as orthogonal concepts even if they might commonly be used together.

occurrenceName is a URI or blank node, including [] (the ANON terminal rule 47 in Turtle - no triples inside the []).

The occurrence name can be repeated with it being the same named occurrence term:

It can be used with a predicateObjectList (rule [14] in RDF 1.1 Turtle)

<< _:a | :s :p :o >>
   :starts 1999 ;
   :finishes 2000 .

or using the occurrence name for one of the triples:

<< _:a | :s :p :o >> 
    :starts 1999 .
_:a :finishes 2000 .

The name can be omitted - a blank node is generated by the parser:

<< :s :p :o >> :q 123 .

N-Triples

In N-Triples, reflecting the RDF abstract data model, there is a new syntax form for a named occurrence term:

<< _:a | :s :p :o >> :q 123 .

In N-triples, the name is required. There are no shorthand forms.

RDF Graph Merge

Graph merge happens as before - blank nodes need to be kept apart.

Annotation Syntax

Input material from email:

Annotation syntax is Turtle/TriG syntax that both asserts a triple, and uses an occurrence of that triple.

:liz :spouse :dick {| id:1 | :start 1964; :end 1974 |} . :liz :spouse :dick {| id:2 | :start 1975; :end 1976 |} .

which would generate to 6 triples and there are 5 unique triples - the RDF graph does not have a duplicate asserted triple.

:liz :spouse :dick .
 << id:1 | :liz :spouse :dick >> ;
      :start 1964;
      :end 1974 .
 << id:2 | :liz :spouse :dick >> ;
      :start 1975;
      :end 1976 .

SPARQL

Assumption: The RDF 1.2 features map into SPARQL.

Test: SPARQL syntax "Turtle+variables"

Named occurrences

Syntax

New type of patterns? New functions? Accessors and creators

Consequences on property paths

Evaluation

?? Simple entailment consequences??

Items to discuss

Unordered

  • Graphs, graph terms, named graphs, graph occurrences.
  • Terminology "Edges"? "occurrences"? "usage"?
  • Do occurrences "infer"?
  • Name sharing (one name, two occurrences) Exactly one? Relationship to merge?
  • type, instance, occurrence
Clone this wiki locally