diff --git a/spec/index.html b/spec/index.html index 662137c..e340c97 100644 --- a/spec/index.html +++ b/spec/index.html @@ -812,16 +812,22 @@
A reified triple - may be the subject or - object of an - RDF triple.
- -A reified triple is syntactic sugar for a specific relationship between an
- identifier (reifier) and a triple term.
+ In RDF, triple terms are rarely used directly,
+ as they are generally restricted to be used
+ only as the object of a triple
+ using the `rdf:reifies` predicate.
+ Such a triple is called a reifying triple.
+ Turtle provides a shorthand notation for writing reifying triples
+ using the A Reifying Triples
+
+ reifiedTriple
production.reifiedTriple
+ is syntactic sugar representing a reifying triple,
+ which defines a specific relationship between an
+ identifier (reifier)
+ and a triple term.
The identifier becomes a way to indirectly refer
to a triple term, which
may or may not be asserted within the graph corresponding to this input document.Reified Triples
RDF 1.2 uses the term to identify a triple term
using the `rdf:reifies` predicate.
A reified triple is represented using the +
A reifying triple is represented using the
reifiedTriple
production
starting with <<
,
followed by either a subject
@@ -854,7 +860,7 @@
Reified Triples may be nested, +
reifiedTriples
may be nested,
like
`<< :subject1 :predicate1 << :subject2 :predicate2 :object2 >> ~:IRIREF1 >>`
or
`<< :subject4 :predicate4 << :subject3 :predicate3 :object3 ~:IRIREF3 >> >>`.
After declaring a prefix so that IRIs can be abbreviated,
the first triple in this example asserts that `employee38` has a `familyName` of "Smith".
Note that this graph does not assert that `employee38` has a `jobTitle` of "Assistant Designer";
- it says that `employee22` has made that claim using a reified triple.
+ it says that `employee22` has made that claim using a reifiedTriple
.
In other words, the triple "`employee38` has a `jobTitle` of 'Assistant Designer'"
is not a member of the graph, itself, as "employee38 has a `familyName` of 'Smith'" is above;
- rather, it is known as a reified triple.
A reified triple is syntactic sugar relating one ore more
- reifiers to a tripleTerm
+
A reifiedTriple
is syntactic sugar relating a
+ reifier to a tripleTerm
using the rdf:reifies
predicate.
reifiedTriple
,
the annotation syntax allows the definition of
one or more reifiers as either IRIs
or blank nodes,
@@ -1635,7 +1641,7 @@ The RDF 1.2 Concepts and Abstract Syntax specification [[!RDF12-CONCEPTS]] defines four types of RDF terms: @@ -1659,9 +1665,7 @@
Parsing Turtle requires a state of six items:
- -Describe parser state for tracking reifier to be associated with an annotation block.
+Parsing Turtle requires a state of eight items:
subject
production.subject
,
+ blankNodePropertyList
,
+ collection
,
+ tripleTerm
, and
+ annotationBlock
+ productions.
object
and
ttObject
productions.reifier
and
+ annotationBlock
productions.Term Constructurs can create a stack of these values indicated by + using language such as "records the |curSubject| and |curPredicate|."
blankNodePropertyList
in the next section.collection
in the next section.rdf:nil
. Note the rules for collection
in the next section.iri
production
+ or BlankNode
production, if any.
+ If no such production is matched, term is taken
+ from a fresh RDF blank node.
+ ttObject
productions.
iri
- production or the BlankNode
production,
- if present, otherwise from a fresh RDF blank node.
+ The term is taken from the matched reifier
, if any,
+ or from a fresh RDF blank node.
annotation
production
- defines an RDF term in addition to a triple term.
- The term constructed from this production
- is composed of an identifier from either the iri
- or BlankNode
productions,
- if present, otherwise from a fresh RDF blank node.
- reifier
.Beginning the tripleTerm
production
- records the |curSubject| and |curPredicate|.
- Finishing the tripleTerm
production
- and restores the recorded values of |curSubject| and |curPredicate|.
Beginning the reifier
production,
+ the |curReifier| is taken from the reifier
term constructor.
+ Then yield the the RDF triple |curReifier| rdf:reifies
|curTripleTerm|.
Beginning the reifiedTriple
production
- records the |curSubject| and |curPredicate|.
- |curSubject| is taken from the
- reifiedTriple
term constructor.
- A new tripleTerm
instance |TT|
- is composed from
+ records the |curTripleTerm| as an RDF Triple composed from
the subject
,
- predicate
, and
+ verb
, and
object
productions.
- Finishing the reifier
production
- yields the RDF triple |curSubject| rdf:reifies
|TT|
- and restores the recorded values of |curSubject| and |curPredicate|.
reifiedTriple
production,
+ if the |curReifier| is not set, it is assigned a fresh fresh RDF blank node
+ and yields the the RDF triple |curReifier| rdf:reifies
|curTripleTerm|.
+ The node produced by matching reifiedTriple
+ is the the |curReifier|.
+
+ Beginning the annotation
production
records the |curSubject| and |curPredicate|.
- A new tripleTerm
instance |TT|
- is created using |curSubject| |curPredicate| |curObject|.
- The identifier |TI| is taken from the
- annotation
term constructor.
+ A new tripleTerm
instance |curTripleTerm|
+ is created using the |curSubject| |curPredicate| |curObject|,
+ and the value of the |curReifier| is cleared.
Finishing the annotation
production
- yields the RDF triple |TI| rdf:reifies
|TT|
- and restores the recorded values of |curSubject| and |curPredicate|.
Describe parser state for recording and assigning any reifier.
+ restores the recorded values of the |curSubject| and |curPredicate|. + +Beginning the annotationBlock
production,
+ if the |curReifier| is not set, then the |curReifier| is assigned a fresh RDF blank node
+ and then yields the RDF triple |curReifier| rdf:reifies
|curTripleTerm|.
+ The |curSubject| is taken from the |curReifier|
+ Finishing the annotationBlock
production,
+ clears the value of the |curReifier|.
Beginning the blankNodePropertyList
- production records the |curSubject|
- and |curPredicate|,
- and sets |curSubject|
- to a novel blank node |B|.
+ production records the |curSubject| and |curPredicate|,
+ and sets the |curSubject| to a novel blank node |B|.
Finishing the blankNodePropertyList
- production restores |curSubject|
- and |curPredicate|.
+ production restores the |curSubject| and |curPredicate|.
The node produced by matching blankNodePropertyList
is the blank node |B|.
Beginning the collection
production records the |curSubject| and |curPredicate|.
- Each object
in the collection
production has a |curSubject| set to a novel blank node |B| and a |curPredicate| set to rdf:first
.
+ Each object
in the collection
production has |curSubject| set to a novel blank node |B| and |curPredicate| set to rdf:first
.
For each object objectn after the first produces a triple:objectn-1 rdf:rest
objectn .
- Finishing the collection
production creates an additional triple curSubject rdf:rest rdf:nil
. and restores |curSubject| and |curPredicate|
+ Finishing the collection
production creates an additional triple curSubject rdf:rest rdf:nil
. and restores the |curSubject| and |curPredicate|
The node produced by matching collection
is the first blank node |B| for non-empty lists and rdf:nil
for empty lists.
reifiedTriple
<<
' (
subject |
reifiedTriple)
predicate object reifier*
'>>
'<<
' (
subject |
reifiedTriple)
verb object reifier?
'>>
'annotation
(
reifier |
(
'{|
' predicateObjectList '|}
')
)
*
(
reifier |
annotationBlock)
*
annotationBlock
{|
' predicateObjectList '|}
'PNAME_NS
?
':
'PNAME_LN
BLANK_NODE_LABEL
_:
' (
PN_CHARS_U |
[
0-9
]
)
(
(
PN_CHARS |
'.
')
*
PN_CHARS)
?
LANG_DIR
@
' [
a-zA-Z
]
+
(
'-
' [
a-zA-Z0-9
]
+
)
*
(
'--
' [
a-zA-Z
]
+
)
?
INTEGER
[
+-
]
?
[
0-9
]
+
DECIMAL
[
+-
]
?
(
[
0-9
]
*
'.
' [
0-9
]
+
)
DOUBLE
[
+-
]
?
(
(
[
0-9
]
+
'.
' [
0-9
]
*
EXPONENT)
|
(
'.
' [
0-9
]
+
EXPONENT)
|
(
[
0-9
]
+
EXPONENT)
)
EXPONENT
[
eE
]
[
+-
]
?
[
0-9
]
+
STRING_LITERAL_QUOTE
"
' (
[
^
#x22
#x5C
#x0A
#x0D
]
|
ECHAR |
UCHAR)
*
'"
'STRING_LITERAL_SINGLE_QUOTE
'
" (
[
^
#x27
#x5C
#x0A
#x0D
]
|
ECHAR |
UCHAR)
*
"'
"STRING_LITERAL_LONG_SINGLE_QUOTE
'''
" (
(
"'
" |
"''
")
?
(
[
^'\
]
|
ECHAR |
UCHAR)
)
*
"'''
"STRING_LITERAL_LONG_QUOTE
"""
' (
(
'"
' |
'""
')
?
(
[
^"\
]
|
ECHAR |
UCHAR)
)
*
'"""
'UCHAR
(
'\u
' HEX HEX HEX HEX)
|
(
'\U
' HEX HEX HEX HEX HEX HEX HEX HEX)
ECHAR
\
' [
tbnrf\"'
]
WS
#x20
|
#x09
|
#x0D
|
#x0A
ANON
[
' WS*
']
'PN_CHARS_BASE
[
A-Z
]
[
#x00010000
-
#x000EFFFF
]
PN_CHARS_U
|
'_
'PN_CHARS
|
'-
' |
[
0-9
]
|
#xB7
|
[
#x0300
-
#x036F
]
|
[
#x203F
-
#x2040
]
PN_PREFIX
(
(
PN_CHARS |
'.
')
*
PN_CHARS)
?
PN_LOCAL
(
PN_CHARS_U |
':
' |
[
0-9
]
|
PLX)
(
(
PN_CHARS |
'.
' |
':
' |
PLX)
*
(
PN_CHARS |
':
' |
PLX)
)
?
PLX
|
PN_LOCAL_ESCPERCENT
%
' HEX HEXHEX
[
0-9
]
|
[
A-F
]
|
[
a-f
]
PN_LOCAL_ESC
\
' (
'_
' |
'~
' |
'.
' |
'-
' |
"!
" |
'$
' |
'&
' |
"'
" |
'(
' |
')
' |
'*
' |
'+
' |
',
' |
';
' |
'=
' |
'/
' |
'?
' |
'#
' |
'@
' |
'%
')