-
Notifications
You must be signed in to change notification settings - Fork 8
Proposal: Named Node Expressions
The named node expression proposal 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-Star Working Group. It should have no impact upon the underlying RDF.
An anonymous node is a node in a graph that is created via notational means (e.g., part of a brace expression "[]", linked list expression "()", reification expression "<<>>" or graph expression "{}"). Anonymous nodes are not directly referenceable even locally, and while they are usually rendered as blank node in RDF, in Turtle there is no way to explicitly name such nodes without losing the appropriate advantages of the notation.
A named blank node is a node in a graph that uses bnode notation to define a name that only has scope within a given Turtle file depiction of a graph, and that typically assigned as a bnode URI by the parser when the Turtle file is parsed. In this respect, named blank nodes are locally scoped. An anonymous node is not synonymous with a named blank node, as anonymous nodes, though most anonymous nodes are representable as blank nodes. An anonymous node is not referenceable at all within Turtle from outside the data structure, while a named blank node can be, so long as it is within the scope of a graph when encoded in Turtle.
A **named node expression ** is a mechanism in Turtle to assign a "name" to an anonymous node, where the name can be either a fully qualified IRI or a named blank node in the EBNF form:
:namedNodeExpression: ::= :op: :namedNode: "=>" :partialExpression: :endOp:
:op: ::= "[" | "(" | "<<" | "{"
:namedNode: ::= :iri" | "blankNode"
:partialExpression ::= # Expression dependent upon :op:, see below
:endOp: ::= "]", ")", ">>", "}"
A named node expression assigns an iri or named blank node to a given data structure in Turtle. It does not change the underlying RDF - there are no changes required to the RDF specification - but it does provide a way to simplify specific data structures and to provide a unifying syntax for working with what had previously been anonymous nodes.
The syntax for a named node expression is an IRI or named blank node followed by the symbol "=>
", usually when applied at the beginning of a brace expression "[]", a linked list expression "()" a reifer expression "<<>>" or a graph expression "{}". In general the syntax indicates that the named URI or blank node provided should be used as a reference to each of these.
An anonymous brace expression resolves as an anonymous node that take the corresponding internal predicates and objects. For instance,
Person:JaneDoe Person:hasName [ Name:firstName "Jane" ; Name:lastName "Doe" ; a Name: ].
This resolves to an anonymous node expression in RDF:
Person:JaneDoe Person:hasName _:a1234.
_:a1234 Name:firstName "Jane" .
_:a1234 Name:lastName "Doe" .
_:a1234 a Name: .
in which _:a1234 is a system-defined anonymous node that is determined at parse time.The anonymous node here, because it is system defined, cannot be referred to by another triple.
A named brace node has a similar structure, but incorporates a specified IRI. For instance,
Person:JaneDoe Person:hasName [Name:JaneDoeName => Name:firstName "Jane" ; Name:lastName "Doe" ; a Name: ].
resolves to
Person:JaneDoe Person:hasName Name:JaneDoeName .
Name:JaneDoeName Name:firstName "Jane" .
Name:JaneDoeName Name:lastName "Doe" .
Name:JaneDoeName a Name: .
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 .
...
Such an expression can be used in either the subject, predicate or object position as follows:
:s :p [:namedNode => :p1 :o1 ; :p2 o2 ; ...] .
This evaluates to
:s :p :namedNode .
:namedNode :p1 :o1 .
:namedNode ;p2 :o2 .
...
As given above, the following named brace expression can be written as follows:
Person:JaneDoe Person:hasName [Name:JaneDoeName => Name:firstName "Jane" ; Name:lastName "Doe"].
Name:JaneDoeName a Name; Entity:dateStart "1998-03-07" ; Entity:dateEnd "2021-11-05".
This creates a named node called Name:JaneDoeName
bound with the first name and last name. This is then referenced in another set of triples indicating a range. This is equivalent to the RDF:
Person:JaneDoe Person:hasName Name:JaneDoeName .
Name:JaneDoeName Name:firstName "Jane" ; Name:lastName "Doe".
Name:JaneDoeName a Name; Entity:dateStart "1998-03-07" ; Entity:dateEnd "2021-11-05".
:s [:namedNode => :p1 :o1 ; :p2 o2 ; ...] :o .
This evaluates to
:s :namedNode :o .
:namedNode :p1 :o1 .
:namedNode ;p2 :o2 .
...
[: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 .
A named node expression can be composed within another named expression. For instance,
Summary of the RDF-star WG wiki.
- Editor's guide
- Meeting minutes
- RDF terminology
- Scribes
- Use Cases collection
- RDF-star syntax and semantics:
- RDF-star "alternative baseline" (VOTED 2024.11.14 - frozen)
- RDF-star "liberal baseline" (current working version)
- RDF-star "minimal baseline" (VOTED 2024.07.18 - frozen - superseded by vote 2024.11.14 - deprecated)
- RDF-star "working baseline" (working version - deprecated)
- RDF‐star baseline examples
- RDF-star and LPGs
- Extending the baseline with "asserted" stuff
- systems and acronyms
- Task forces
- Text Direction considerations
- Text Direction Proposal
- Triple‐Edge-subgroup-proposals