Skip to content

Proposal: Named Node Expressions

Kurt Cagle edited this page Jun 20, 2024 · 27 revisions

Overview

A named node expression is a proposal made to extend the Turtle language in order to make certain Turtle expressions more compact and referenceable. It is an alternative that is intended to address several critical use cases currently under consideration by the RDF-Start Working Group

Definition

A named node expression is an expression used within Turtle bracket notation ("[]") to provide a URI or "named" blank node for the anonymous node indicated by the bracket notation.

The expression

[:namedNode | :p1 :o1 ; :p2 :o2 ; ...]

is a named Node expression that evaluates to the single node :namedNode.

:namedNode :p1 :o1 .
:namedNode :p2 :o2 .
...
:namedNode :pN :oN .

Such an expression can be used in either the subject, predicate or object position as follows:

As object:

:s :p [:namedNode :p1 :o1 ; :p2 o2 ; ...] .

This evaluates to

:s :p :namedNode .
:namedNode :p1 :o1 .
:namedNode ;p2 :o2 .
...

As predicate:

:s [:namedNode :p1 :o1 ; :p2 o2 ; ...] :o .

This evaluates to

:s :namedNode :o .
:namedNode :p1 :o1 .
:namedNode ;p2 :o2 .
...

As subject:

[:namedNode :p1 :o1 ; :p2 o2 ; ...] :p :o .

This evaluates to

:namedNode :p :o .
:namedNode :p1 :o1 .
:namedNode ;p2 :o2 .
...

Note in the case of a subject replacement of a named node expression, this defaults to the expression:

:namedNode :p1 :o1 ; :p2 o2 ; ... ; :p :o .

Composition

A named node expression can be composed within another named expression. For instance,

Clone this wiki locally