TriG updates
authorGavin Carothers <gavin@carothers.name>
Tue, 30 Oct 2012 02:57:44 -0700
changeset 523 f1209dd6946a
parent 522 558da8cd92bb
child 524 0f7e0f30c3d2
TriG updates
trig/index.html
trig/trig.bnf
--- a/trig/index.html	Tue Oct 30 02:46:50 2012 -0700
+++ b/trig/index.html	Tue Oct 30 02:57:44 2012 -0700
@@ -144,7 +144,7 @@
 				
 				<p>A graph statement pairs an IRI with a RDF Graph. The triple statements that make up the graph are enclosed in <code>{}</code>.</p>
 
-				<p>In a TriG document a graph IRI MAY be used to label more then one graph. The IRI of a graph statement MAY be omitted. In this case the graph is considered the default graph of the RDF Dataset.</p>
+				<p>In a TriG document a graph IRI MAY be used to label more then one graph. The IRI of a graph statement may be omitted. In this case the graph is considered the default graph of the RDF Dataset.</p>
 
 				<p>A RDF Dataset may contain only a single graph.</p>
 				<pre class="example">
@@ -165,7 +165,7 @@
 				<script type="application/trig"># This document contains a default graph and two named graphs.
 
 @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix dc: <http://purl.org/dc/elements/1.1/> .
+@prefix dc: <http://purl.org/dc/terms/> .
 @prefix foaf: <http://xmlns.com/foaf/0.1/> .
 
 # default graph
@@ -186,57 +186,27 @@
        _:a foaf:mbox <mailto:alice@work.example.org> .
     }				</script>
 				</pre>
-
-				<p>A RDF Dataset MAY contain graphs that refer to other graphs to provide providence. In this case <code>:G3</code> provides providence for 
-				<code>:G1</code> and <code>:G2</code>.</p>
-
-				<pre class="example">
-					<script type="application/trig"># This document encodes three graphs.
-
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix swp: <http://www.w3.org/2004/03/trix/swp-1/> .
-@prefix dc: <http://purl.org/dc/elements/1.1/> .
-@prefix ex: <http://www.example.org/vocabulary#> .
-@prefix : <http://www.example.org/exampleDocument#> .
-
-:G1 { :Monica ex:name "Monica Murphy" .      
-      :Monica ex:homepage <http://www.monicamurphy.org> .
-      :Monica ex:email <mailto:monica@monicamurphy.org> .
-      :Monica ex:hasSkill ex:Management }
-
-:G2 { :Monica rdf:type ex:Person .
-      :Monica ex:hasSkill ex:Programming }
-
-:G3 { :G1 swp:assertedBy _:w1 .
-      _:w1 swp:authority :Chris .
-      _:w1 dc:date "2003-10-02"^^xsd:date .   
-      :G2 swp:quotedBy _:w2 .
-      :G3 swp:assertedBy _:w2 .
-      _:w2 dc:date "2003-09-03"^^xsd:date .
-      _:w2 swp:authority :Chris .
-      :Chris rdf:type ex:Person .  
-      :Chris ex:email <mailto:chris@bizer.de> }
-					</script>
-				</pre>
-
+				<p class="issue">
+				A providence example
+				</p>
+				<p class="issue">A verisions example</p>
+				<p class="issue">A web snapshot example</p>
 			</section>
 			<section>
 				<h3>Other Terms</h3>
 				<p>All other terms and directives come from Turtle.</p>
 				<section id="terms-blanks-nodes">
 					<h4>Special Considerations for Blank Nodes</h4>
-					<p class="issue"><a href="http://www.w3.org/2011/rdf-wg/track/issues/12">ISSUE-12</a> BlankNodes being shared between graphs is unresolved.</p>
 					<p>The formal semantics [[RDF-MT]] of RDF do not provide for the meaning of 
-					blank nodes between graphs. BlankNodes sharing the same label in different 
-					graph literals MUST not be considered to be the same BlankNode.</p>
+					blank nodes between graphs. BlankNodes sharing the same label in differently 
+					labeled graph statements MUST NOT be considered to be the same BlankNode.</p>
 				</section>
 			</section>
 		</section>
 
 		<section id="sec-syntax">
 			<h2>Syntax</h2>
-			<p class="issue">There should likely be come content here.</p>
+			<p class="issue">There should likely be some content here.</p>
 		</section>
 		<section id="sec-grammar">
 			<h2>TriG Grammar</h2>
--- a/trig/trig.bnf	Tue Oct 30 02:46:50 2012 -0700
+++ b/trig/trig.bnf	Tue Oct 30 02:57:44 2012 -0700
@@ -1,6 +1,6 @@
 [1g] trigDoc ::= (graph_statement)* 
  
-[2g] graph_statement ::= directive "." 
+[2g] graph_statement ::= directive 
  | graph
 
 [3g] graph ::= graphIri? "{" (triples ".")* "}"
@@ -10,123 +10,96 @@
 # Remaining from Turtle
 
 [3] directive ::= prefixID 
- | base 
-[4] prefixID ::= PREFIX PNAME_NS IRI_REF 
+ | base | sparqlPrefix | sparqlBase
+
+[4] prefixID ::= '@prefix' PNAME_NS IRIREF "."
  
-[5] base ::= BASE IRI_REF 
+[5] base ::= '@base' IRIREF "."
+
+[28*] sparqlPrefix ::= [Pp][Rr][Ee][Ff][Ii][Xx] PNAME_NS IRIREF
+[29*] sparqlBase ::= [Bb][Aa][Ss][Ee] IRIREF
  
-[6] triples ::= subject predicateObjectList 
+[6] triples ::= subject predicateObjectList |
+blankNodePropertyList predicateObjectList? 
  
-[7] predicateObjectList ::= verb objectList ( ";" verb objectList )* (";")? 
+[7] predicateObjectList ::= verb objectList (";" (predicateObjectList)?)* 
  
 [8] objectList ::= object ( "," object )* 
  
 [9] verb ::= predicate 
  | "a" 
-[10] subject ::= IRIref 
+[10] subject ::= iri 
  | blank 
-[11] predicate ::= IRIref 
+[11] predicate ::= iri 
  
-[12] object ::= IRIref 
+[12] object ::= iri 
  | blank 
+ | blankNodePropertyList
  | literal 
 [13] literal ::= RDFLiteral 
  | NumericLiteral 
  | BooleanLiteral 
 [14] blank ::= BlankNode 
- | blankNodePropertyList 
  | collection 
 [15] blankNodePropertyList ::= "[" predicateObjectList "]" 
  
 [16] collection ::= "(" object* ")" 
- 
-[60s] RDFLiteral ::= String ( LANGTAG | ( "^^" IRIref ) )? 
+[17] NumericLiteral ::= INTEGER | DECIMAL | DOUBLE 
+
+[128s] RDFLiteral ::= String ( LANGTAG | ( "^^" iri ) )? 
  
-[61s] NumericLiteral ::= NumericLiteralUnsigned 
- | NumericLiteralPositive 
- | NumericLiteralNegative 
-[62s] NumericLiteralUnsigned ::= INTEGER 
- | DECIMAL 
- | DOUBLE 
-[63s] NumericLiteralPositive ::= INTEGER_POSITIVE 
- | DECIMAL_POSITIVE 
- | DOUBLE_POSITIVE 
-[64s] NumericLiteralNegative ::= INTEGER_NEGATIVE 
- | DECIMAL_NEGATIVE 
- | DOUBLE_NEGATIVE 
-[65s] BooleanLiteral ::= "true" 
+[133s] BooleanLiteral ::= "true" 
  | "false" 
-[66s] String ::= STRING_LITERAL1 
- | STRING_LITERAL2 
- | STRING_LITERAL_LONG1 
- | STRING_LITERAL_LONG2 
-[67s] IRIref ::= IRI_REF 
+[18] String ::= STRING_LITERAL_QUOTE 
+ | STRING_LITERAL_SINGLE_QUOTE 
+ | STRING_LITERAL_LONG_SINGLE_QUOTE 
+ | STRING_LITERAL_LONG_QUOTE 
+[135s] iri ::= IRIREF 
  | PrefixedName 
-[68s] PrefixedName ::= PNAME_LN 
+[136s] PrefixedName ::= PNAME_LN 
  | PNAME_NS 
-[69s] BlankNode ::= BLANK_NODE_LABEL 
+[137s] BlankNode ::= BLANK_NODE_LABEL 
  | ANON 
 
 @terminals
 
-[17] BASE ::= "@base" 
- 
-[18] PREFIX ::= "@prefix" 
- 
-[70s] IRI_REF ::= "<" ( [^<>\"{}|^`\\] - [#x00-#x20] | UCHAR )* ">"
- 
-[71s] PNAME_NS ::= (PN_PREFIX)? ":" 
- 
-[72s] PNAME_LN ::= PNAME_NS PN_LOCAL 
- 
-[73s] BLANK_NODE_LABEL ::= "_:" PN_LOCAL 
- 
-[76s] LANGTAG ::= BASE 
- | PREFIX 
- | "@" [a-zA-Z]+ ( "-" [a-zA-Z0-9]+ )* 
-[77s] INTEGER ::= [0-9]+ 
- 
-[78s] DECIMAL ::= [0-9]+ "." [0-9]+ 
- | "." [0-9]+ 
-[79s] DOUBLE ::= [0-9]+ "." [0-9]+ EXPONENT 
- | "." ( [0-9] )+ EXPONENT 
- | ( [0-9] )+ EXPONENT 
-[80s] INTEGER_POSITIVE ::= "+" INTEGER 
- 
-[81s] DECIMAL_POSITIVE ::= "+" DECIMAL 
- 
-[82s] DOUBLE_POSITIVE ::= "+" DOUBLE 
+[19] IRIREF ::=  '<' ([^#x00-#x20<>\"{}|^`\] | UCHAR)* '>'
  
-[83s] INTEGER_NEGATIVE ::= "-" INTEGER 
- 
-[84s] DECIMAL_NEGATIVE ::= "-" DECIMAL 
- 
-[85s] DOUBLE_NEGATIVE ::= "-" DOUBLE 
- 
-[86s] EXPONENT ::= [eE] [+-]? [0-9]+ 
- 
-[87s] STRING_LITERAL1 ::= "'" ( ( [^'\\\n\r] ) | ECHAR | UCHAR )* "'" 
- 
-[88s] STRING_LITERAL2 ::= '"' ( ( [^\"\\\n\r] ) | ECHAR | UCHAR )* '"' 
- 
-[89s] STRING_LITERAL_LONG1 ::= "'''" ( ( "'" | "''" )? ( [^'\\] | ECHAR | UCHAR ) )* "'''" 
+[139s] PNAME_NS ::= PN_PREFIX? ":" 
  
-[90s] STRING_LITERAL_LONG2 ::= '"""' ( ( '"' | '""' )? ( [^\"\\] | ECHAR | UCHAR ) )* '"""' 
- 
-[19] UCHAR ::= ( "\\u" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] ) 
- | ( "\\U" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] 
- [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] ) 
-[91s] ECHAR ::= "\\" [tbnrf\\\"'] 
+[140s] PNAME_LN ::= PNAME_NS PN_LOCAL 
  
-[92s] NIL ::= "(" (WS)* ")" 
+[141s] BLANK_NODE_LABEL ::= '_:' ( PN_CHARS_U | [0-9] ) ((PN_CHARS|'.')* PN_CHARS)?
  
-[93s] WS ::= " " 
- | "\t" 
- | "\r" 
- | "\n" 
-[94s] ANON ::= "[" (WS)* "]" 
+[144s] LANGTAG ::= "@" [a-zA-Z]+ ( "-" [a-zA-Z0-9]+ )* 
+[20] INTEGER ::= [+-]? [0-9]+
  
-[95s] PN_CHARS_BASE ::= [A-Z] 
+[21] DECIMAL ::= [+-]?  ( ([0-9])* '.' ([0-9])+  )
+[22] DOUBLE ::= [+-]? ( [0-9]+ '.' [0-9]* EXPONENT | '.' ([0-9])+ EXPONENT | ([0-9])+ 
+EXPONENT )
+  
+[154s] EXPONENT ::= [eE] [+-]? [0-9]+ 
+ 
+[23] STRING_LITERAL_QUOTE ::= '"' ( [^#x22#x5C#xA#xD] | ECHAR | UCHAR )* '"' 
+ 
+[24] STRING_LITERAL_SINGLE_QUOTE ::= "'" ( [^#x27#x5C#xA#xD] | ECHAR | UCHAR )* "'" 
+ 
+[25] STRING_LITERAL_LONG_SINGLE_QUOTE ::= "'''" ( ( "'" | "''" )? ( [^'\] | ECHAR | UCHAR ) )* "'''" 
+ 
+[26] STRING_LITERAL_LONG_QUOTE ::= '"""' ( ( '"' | '""' )? ( [^"\] | ECHAR | UCHAR ) )* '"""' 
+ 
+[27] UCHAR ::= ( "\u" HEX HEX HEX HEX ) 
+ | ( "\U" HEX HEX HEX HEX HEX HEX HEX HEX ) 
+
+[159s] ECHAR ::= "\" [tbnrf\"'] 
+ 
+[160s] NIL ::= "(" WS* ")" 
+ 
+[161s] WS ::= #x20 | #x9 | #xD | #xA
+
+[162s] ANON ::= "[" WS* "]" 
+ 
+[163s] PN_CHARS_BASE ::= [A-Z] 
  | [a-z] 
  | [#00C0-#00D6] 
  | [#00D8-#00F6] 
@@ -140,18 +113,22 @@
  | [#F900-#FDCF] 
  | [#FDF0-#FFFD] 
  | [#10000-#EFFFF] 
- | UCHAR 
-[96s] PN_CHARS_U ::= PN_CHARS_BASE 
- | "_" 
-[98s] PN_CHARS ::= PN_CHARS_U 
+[164s] PN_CHARS_U  ::=  PN_CHARS_BASE 
+ | '_' 
+[166s] PN_CHARS ::= PN_CHARS_U 
  | "-" 
  | [0-9] 
  | #00B7 
  | [#0300-#036F] 
  | [#203F-#2040] 
-[99s] PN_PREFIX ::= PN_CHARS_BASE ( ( PN_CHARS | "." )* PN_CHARS )? 
+[167s] PN_PREFIX ::= PN_CHARS_BASE ( ( PN_CHARS | "." )* PN_CHARS )? 
  
-[100s] PN_LOCAL ::= ( PN_CHARS_U | [0-9] ) ( ( PN_CHARS | "." )* PN_CHARS )? 
- 
-@pass ::= [ \t\r\n]+ 
- | "#" [^\r\n]* 
+[168s] PN_LOCAL ::= ( PN_CHARS_U | ':' | [0-9] | PLX ) ( ( PN_CHARS | '.' | ':' | PLX )*  ( PN_CHARS | ':' | PLX ) ) ?
+
+[169s] PLX ::= PERCENT | PN_LOCAL_ESC
+
+[170s] PERCENT ::= '%' HEX HEX
+
+[171s] HEX ::= [0-9] | [A-F] | [a-f]
+
+[172s] PN_LOCAL_ESC ::= '\' ( '_' | '~' | '.' | '-' | '!' | '$' | '&' | "'" | '(' | ')' | '*' | '+' | ',' | ';' | '=' | '/' | '?' | '#' | '@' | '%' )
\ No newline at end of file