From aea34849d274019af2d2303df984da704985b0df Mon Sep 17 00:00:00 2001
From: Gregg Kellogg 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 seven items: Beginning the Parsing
Parser State
-
Parser State
The |curObject| is bound to the
object
and
ttObject
productions.reifier
and
+ annotationBlock
productions.RDF Term Constructors
blankNodePropertyList blank node A blank node is generated. Note the rules for blankNodePropertyList
in the next section.collection blank node For non-empty lists, a blank node is generated. Note the rules for collection
in the next section.
+ IRI For empty lists, the resulting IRI is rdf:nil
. Note the rules for collection
in the next section.reifier IRI
+ | blank node
+
+ The term sets |curReifier| and is taken from the matched
+
+ iri
production
+ or BlankNode
production, if any.
+ If no such production is matched, it is taken
+ from a fresh RDF blank node.
+
- tripleTerm triple term
The triple term
@@ -1762,28 +1777,19 @@
RDF Term Constructors
ttObject
productions.
reifiedTriple IRI | blank node
+
- reifiedTriple IRI | blank node
- The reifiedTriple production
- defines an RDF term in addition to a triple term.
- The term constructed from this production
- is composed of an optional identifier from either the
iri
- production or the BlankNode
production,
- if present, otherwise from a fresh RDF blank node.
+ The term taken from the matched reifier
, if any,
+ or from a fresh RDF blank node.
annotation IRI | blank node
+
-
+
@@ -1807,35 +1813,51 @@ annotationBlock IRI | blank node
- The
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
.Triple Term
tripleTerm
production
records the |curSubject| and |curPredicate|.
Finishing the tripleTerm
production
- and restores the recorded values of |curSubject| and |curPredicate|.
Beginning the reifier
production,
+ if |curReifier| is set, the production yields the RDF triple |curReifier| rdf:reifies
|curTripleTerm|.
+ Finishing the reifier
production
+ |curReifier| is taken from the reifier
term constructor.
Beginning the reifiedTriple
production
records the |curSubject| and |curPredicate|.
|curSubject| is taken from the
- reifiedTriple
term constructor.
+ reifiedTriple
term constructor,
+ or a fresh RDF blank node, if not matched.
A new tripleTerm
instance |TT|
is composed from
the subject
,
predicate
, and
object
productions.
- Finishing the reifier
production
+ Finishing the reifiedTriple
production
yields the RDF triple |curSubject| rdf:reifies
|TT|
and restores the recorded values of |curSubject| and |curPredicate|.
Beginning the annotationBlock
production
+ |curReifier| is taken from a fresh RDF blank node if not already set,
+ and |curSubject| is taken from |curReifier|.
+ Finishing the annotationBlock
production
+ yields the RDF triple |curReifier| rdf:reifies
|curTripleTerm|,
+ and resets the value of |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 |curSubject| |curPredicate| |curObject|,
+ and the value of |curReifier| is reset.
Finishing the annotation
production
- yields the RDF triple |TI| rdf:reifies
|TT|
+ yields the RDF triple |curReifier| rdf:reifies
|curTripleTerm|,
+ resets the value of |curReifier|,
and restores the recorded values of |curSubject| and |curPredicate|.
Describe parser state for recording and assigning any 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
\
' (
'_
' |
'~
' |
'.
' |
'-
' |
"!
" |
'$
' |
'&
' |
"'
" |
'(
' |
')
' |
'*
' |
'+
' |
',
' |
';
' |
'=
' |
'/
' |
'?
' |
'#
' |
'@
' |
'%
')
Parsing Turtle requires a state of seven items:
+Parsing Turtle requires a state of eight items:
reifier
and
annotationBlock
productions.iri
production
or BlankNode
production, if any.
- If no such production is matched, it is taken
+ If no such production is matched, term is taken
from a fresh RDF blank node.
reifier
, if any,
+ The term is taken from the matched reifier
, if any,
or from a fresh RDF blank node.
reifier
production,
if |curReifier| is set, the production yields the RDF triple |curReifier| rdf:reifies
|curTripleTerm|.
- Finishing the reifier
production
+ Finishing the reifier
production,
|curReifier| is taken from the reifier
term constructor.
Beginning the annotationBlock
production
- |curReifier| is taken from a fresh RDF blank node if not already set,
+
Beginning the annotationBlock
production,
+ |curReifier| is taken from a fresh RDF blank node, if not already set,
and |curSubject| is taken from |curReifier|.
Finishing the annotationBlock
production
yields the RDF triple |curReifier| rdf:reifies
|curTripleTerm|,
From 18735654a7e9617b7ce8d20c1a707ccfbb029896 Mon Sep 17 00:00:00 2001
From: Gregg Kellogg reifiedTriple
construction is generally preferred.
+ as the reifingTriple
construction is generally preferred.
RDF 1.2 Turtle also adds support for
directional language-tagged strings.
A reified triple +
A reifing triple may be the subject or object of an RDF triple.
-A reified triple is syntactic sugar for a specific relationship between an +
A reifing triple is syntactic sugar for a specific relationship between an identifier (reifier) and a triple term. The identifier becomes a way to indirectly refer to a triple term, which @@ -833,11 +833,11 @@
A reified triple is represented using the
- reifiedTriple
production
+
A reifing triple is represented using the
+ reifingTriple
production
starting with <<
,
followed by either a subject
- or reifiedTriple
,
+ or reifingTriple
,
a predicate
, and
a ttObject
,
followed by an optional reifier
,
@@ -854,20 +854,20 @@
Reified Triples may be nested, +
Reifing Triples may be nested,
like
`<< :subject1 :predicate1 << :subject2 :predicate2 :object2 >> ~:IRIREF1 >>`
or
`<< :subject4 :predicate4 << :subject3 :predicate3 :object3 ~:IRIREF3 >> >>`.
If a reifiedTriple
+
If a reifingTriple
is not identified by an IRI
or blank node,
a fresh RDF blank node is allocated
and used to identify this relationship.
+ title="Reifing Triple">-
+ title="Reifing Triple with explicit reifier">-
+ title="Reifying Triple with explicit reifier">-
+ title="Reified Triple with explicit reifier">