diff --git a/grammar/Makefile b/grammar/Makefile index 48a39d76..b797021a 100644 --- a/grammar/Makefile +++ b/grammar/Makefile @@ -25,25 +25,25 @@ n3-yacc.c : n3-selectors.n3-yacc.y n3-selectors.n3-yacc.y : n3-selectors.n3 -n3-checked.txt: n3-selectors.n3 +n3-checked.txt: n3-selectors.n3 n3.n3 $(CG) --grammar=n3-selectors.n3 \ --as=http://www.w3.org/2000/10/swap/grammar/n3#document \ --parse=n3.n3 && touch $@ -n3-selectors.n3 : n3.n3 bnf-rules.n3 - time $P $C n3.n3 bnf-rules.n3 --think --purge --data --quiet > $@ +n3-selectors.n3 : n3.n3 cfg2bnf.n3 bnf-rules.n3 + time $P $C n3.n3 cfg2bnf.n3 bnf-rules.n3 --think --purge --data --quiet > $@ n3-i18n-selectors.n3 : n3-re.n3 bnf-rules.n3 time $P $C n3-re.n3 bnf-rules.n3 --think --purge --data --quiet > $@ -n3-report.big: n3.n3 bnf2html.n3 - time $P $C n3.n3 bnf2html.n3 --chatty=21 --think --data --quiet > $@ +n3-report.big: n3.n3 bnf2html.n3 cfg2bnf.n3 + time $P $C n3.n3 cfg2bnf.n3 bnf2html.n3 --chatty=21 --think --data --quiet > $@ n3-report.html : n3-report.big time $P $C n3-report.big --strings > $@ -n3-ietf.txt : n3-kludge.n3 bnf2ietf.n3 - time $P $C ,n3-kludge.n3 bnf2ietf.n3 --chatty=21 --think --strings > $@ +n3-ietf.txt : ,n3-kludge.n3 cfg2bnf.n3 bnf2ietf.n3 + time $P $C ,n3-kludge.n3 cfg2bnf.n3 bnf2ietf.n3 --chatty=21 --think --strings > $@ ,n3-kludge.n3: n3.n3 sed -e 's/\\[uU]/#x/g' < n3.n3 > ,n3-kludge.n3 diff --git a/grammar/bnf-rules.n3 b/grammar/bnf-rules.n3 index f122ad1c..1640f99d 100644 --- a/grammar/bnf-rules.n3 +++ b/grammar/bnf-rules.n3 @@ -14,24 +14,19 @@ @prefix string: . @keywords a, is, of. -#_____________________________________ -# Shorthand expansion into BNF +<> rdfs:comment + +"""This set of rules process a BNF graph in its basic +cfg:mustBeOneOf BNF form and create the branching tables to drive a +predictive parser. + +See also cfg2bnf.n3 which expands the shothand ontology into the basic +BNF terms. +""". + +#_____________________________________ -#{ ?x bnf:zeroOrMore ?y } => { -# ?x bnf:mustBeOneSequence ( -## ( ) -# ( ?y ?x ) -# ) -#}. -# -#{ ?x bnf:mustBe ?y } => {?x bnf:mustBeOneSequence ((?y))}. -# -# Axioms relating the definite (open world) form to the indefinte (closed world) -#(better words?) form: -# -#{ ?x bnf:mustBe ?y } => { ?x bnf:mustBeOneSequence (( ?y )) }. -# # Enumerate options: diff --git a/grammar/n3-ietf.txt b/grammar/n3-ietf.txt index 1b37581e..899bc665 100644 --- a/grammar/n3-ietf.txt +++ b/grammar/n3-ietf.txt @@ -1,15 +1,21 @@ barename ::= [A-Z_a-z#x00c0-#x00d6#x00d8-#x00f6#x00f8-#x02ff#x0370-#x037d#x037f-#x1fff#x200c-#x200d#x2070-#x218f#x2c00-#x2fef#x3001-#xd7ff#xf900-#xfdcf#xfdf0-#xfffd#x00010000-#x000effff][\-0-9A-Z_a-z#x00b7#x00c0-#x00d6#x00d8-#x00f6#x00f8-#x037d#x037f-#x1fff#x200c-#x200d#x203f-#x2040#x2070-#x218f#x2c00-#x2fef#x3001-#xd7ff#xf900-#xfdcf#xfdf0-#xfffd#x00010000-#x000effff]* +barename_csl ::= | barename barename_csl_tail + | void +barename_csl_tail ::= | "," barename barename_csl_tail + | void boolean ::= | "@false" | "@true" decimal ::= [-+]?[0-9]+(\.[0-9]+)? declaration ::= | "@base" explicituri + | "@keywords" barename_csl | "@prefix" prefix explicituri document ::= | statements_optional EOF double ::= [-+]?[0-9]+(\.[0-9]+)?([eE][-+]?[0-9]+) dtlang ::= | "@" langcode | "^^" symbol | void -existential ::=explicituri ::= <[^>]*> +existential ::= | "@forSome" symbol_csl +explicituri ::= <[^>]*> expression ::= | pathitem pathtail formulacontent ::= | statementlist integer ::= [-+]?[0-9]+ @@ -56,7 +62,12 @@ string ::= ("""[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*""")|("[^"\\]*(?:\\.[^"\\]*)*") subject ::= | expression symbol ::= | explicituri | qname -universal ::=verb ::= | "<=" +symbol_csl ::= | symbol symbol_csl_tail + | void +symbol_csl_tail ::= | "," symbol symbol_csl_tail + | void +universal ::= | "@forAll" symbol_csl +verb ::= | "<=" | "=" | "=>" | "@a" diff --git a/grammar/n3-report.big b/grammar/n3-report.big index bd76c33a..6156c9f1 100644 --- a/grammar/n3-report.big +++ b/grammar/n3-report.big @@ -1,7 +1,8 @@ - @prefix : . + @prefix : . @prefix cfg: . - @prefix h: . @prefix log: . + @prefix n3: . + @prefix rdfs: . @prefix rul: . @forSome <#_g0>, @@ -11,107 +12,110 @@ <#_g4>, <#_g5> . - "!" h:reference """"!"""" . + "!" :reference """"!"""" . - "(" h:reference """"("""" . + "(" :reference """"("""" . - ")" h:reference """")"""" . + ")" :reference """")"""" . - "," h:reference """","""" . + "," :reference """","""" . - "." h:reference """"."""" . + "." :reference """"."""" . - ";" h:reference """";"""" . + ";" :reference """";"""" . - "<=" h:reference """"<="""" . + "<=" :reference """"<="""" . - "=" h:reference """"="""" . + "=" :reference """"="""" . - "=>" h:reference """"=>"""" . + "=>" :reference """"=>"""" . - "@" h:reference """"@"""" . + "@" :reference """"@"""" . - "@a" h:reference """"@a"""" . + "@a" :reference """"@a"""" . - "@base" h:reference """"@base"""" . + "@base" :reference """"@base"""" . - "@false" h:reference """"@false"""" . + "@false" :reference """"@false"""" . - "@forAll" h:reference """"@forAll"""" . + "@forAll" :reference """"@forAll"""" . - "@forSome" h:reference """"@forSome"""" . + "@forSome" :reference """"@forSome"""" . - "@has" h:reference """"@has"""" . + "@has" :reference """"@has"""" . - "@is" h:reference """"@is"""" . + "@is" :reference """"@is"""" . - "@keywords" h:reference """"@keywords"""" . + "@keywords" :reference """"@keywords"""" . - "@of" h:reference """"@of"""" . + "@of" :reference """"@of"""" . - "@prefix" h:reference """"@prefix"""" . + "@prefix" :reference """"@prefix"""" . - "@true" h:reference """"@true"""" . + "@true" :reference """"@true"""" . - "[" h:reference """"["""" . + "[" :reference """"["""" . - "]" h:reference """"]"""" . + "]" :reference """"]"""" . - "^" h:reference """"^"""" . + "^" :reference """"^"""" . - "^^" h:reference """"^^"""" . + "^^" :reference """"^^"""" . - "{" h:reference """"{"""" . + "{" :reference """"{"""" . - "}" h:reference """"}"""" . + "}" :reference """"}"""" . - () a h:Sequence, - h:SequenceTail; - h:seqlabel "void" . + () a :Sequence, + :SequenceTail; + :seqlabel "void" . ( "!" - :expression ) - a h:Sequence, - h:SequenceTail; - h:seqlabel """"!" expression""" . + n3:expression ) + a :Sequence, + :SequenceTail; + :seqlabel """"!" expression""" . ( "(" - :pathlist + n3:pathlist ")" ) - a h:Sequence, - h:SequenceTail; - h:seqlabel """"(" pathlist ")"""" . + a :Sequence, + :SequenceTail; + :seqlabel """"(" pathlist ")"""" . ( ")" ) - a h:SequenceTail; - h:seqlabel """")"""" . + a :SequenceTail; + :seqlabel """")"""" . ( "," - :barename + n3:barename <#_g3> ) - a h:Sequence, - h:SequenceTail . + a :Sequence, + :SequenceTail; + :seqlabel """"," barename barename_csl_tail""" . ( "," - :object - :objecttail ) - a h:Sequence, - h:SequenceTail; - h:seqlabel """"," object objecttail""" . + n3:object + n3:objecttail ) + a :Sequence, + :SequenceTail; + :seqlabel """"," object objecttail""" . ( "," - :symbol + n3:symbol <#_g4> ) - a h:Sequence, - h:SequenceTail . + a :Sequence, + :SequenceTail; + :seqlabel """"," symbol symbol_csl_tail""" . ( "," - :symbol + n3:symbol <#_g5> ) - a h:Sequence, - h:SequenceTail . + a :Sequence, + :SequenceTail; + :seqlabel """"," symbol symbol_csl_tail""" . ( "." - :statementlist ) - a h:Sequence, - h:SequenceTail; - h:seqlabel """"." statementlist""" . + n3:statementlist ) + a :Sequence, + :SequenceTail; + :seqlabel """"." statementlist""" . ( "." - :statements_optional ) - a h:SequenceTail; - h:seqlabel """"." statements_optional""" . + n3:statements_optional ) + a :SequenceTail; + :seqlabel """"." statements_optional""" . ( "0" 0 ) log:outputString """ @@ -128,95 +132,98 @@
""" . ( ";" - :propertylist ) - a h:Sequence, - h:SequenceTail; - h:seqlabel """";" propertylist""" . + n3:propertylist ) + a :Sequence, + :SequenceTail; + :seqlabel """";" propertylist""" . ( "<=" ) - a h:Sequence, - h:SequenceTail; - h:seqlabel """"<="""" . + a :Sequence, + :SequenceTail; + :seqlabel """"<="""" . ( "=" ) - a h:Sequence, - h:SequenceTail; - h:seqlabel """"="""" . + a :Sequence, + :SequenceTail; + :seqlabel """"="""" . ( "=>" ) - a h:Sequence, - h:SequenceTail; - h:seqlabel """"=>"""" . + a :Sequence, + :SequenceTail; + :seqlabel """"=>"""" . ( "@" - :langcode ) - a h:Sequence, - h:SequenceTail; - h:seqlabel """"@" langcode""" . + n3:langcode ) + a :Sequence, + :SequenceTail; + :seqlabel """"@" langcode""" . ( "@a" ) - a h:Sequence, - h:SequenceTail; - h:seqlabel """"@a"""" . + a :Sequence, + :SequenceTail; + :seqlabel """"@a"""" . ( "@base" - :explicituri ) - a h:Sequence, - h:SequenceTail; - h:seqlabel """"@base" explicituri""" . + n3:explicituri ) + a :Sequence, + :SequenceTail; + :seqlabel """"@base" explicituri""" . ( "@false" ) - a h:Sequence, - h:SequenceTail; - h:seqlabel """"@false"""" . + a :Sequence, + :SequenceTail; + :seqlabel """"@false"""" . ( "@forAll" <#_g0> ) - a h:Sequence, - h:SequenceTail . + a :Sequence, + :SequenceTail; + :seqlabel """"@forAll" symbol_csl""" . ( "@forSome" <#_g1> ) - a h:Sequence, - h:SequenceTail . + a :Sequence, + :SequenceTail; + :seqlabel """"@forSome" symbol_csl""" . ( "@has" - :expression ) - a h:Sequence, - h:SequenceTail; - h:seqlabel """"@has" expression""" . + n3:expression ) + a :Sequence, + :SequenceTail; + :seqlabel """"@has" expression""" . ( "@is" - :expression + n3:expression "@of" ) - a h:Sequence, - h:SequenceTail; - h:seqlabel """"@is" expression "@of"""" . + a :Sequence, + :SequenceTail; + :seqlabel """"@is" expression "@of"""" . ( "@keywords" <#_g2> ) - a h:Sequence, - h:SequenceTail . + a :Sequence, + :SequenceTail; + :seqlabel """"@keywords" barename_csl""" . ( "@of" ) - a h:SequenceTail; - h:seqlabel """"@of"""" . + a :SequenceTail; + :seqlabel """"@of"""" . ( "@prefix" - :prefix - :explicituri ) - a h:Sequence, - h:SequenceTail; - h:seqlabel """"@prefix" prefix explicituri""" . + n3:prefix + n3:explicituri ) + a :Sequence, + :SequenceTail; + :seqlabel """"@prefix" prefix explicituri""" . ( "@true" ) - a h:Sequence, - h:SequenceTail; - h:seqlabel """"@true"""" . + a :Sequence, + :SequenceTail; + :seqlabel """"@true"""" . ( "[" - :propertylist + n3:propertylist "]" ) - a h:Sequence, - h:SequenceTail; - h:seqlabel """"[" propertylist "]"""" . + a :Sequence, + :SequenceTail; + :seqlabel """"[" propertylist "]"""" . ( "]" ) - a h:SequenceTail; - h:seqlabel """"]"""" . + a :SequenceTail; + :seqlabel """"]"""" . ( "^" - :expression ) - a h:Sequence, - h:SequenceTail; - h:seqlabel """"^" expression""" . + n3:expression ) + a :Sequence, + :SequenceTail; + :seqlabel """"^" expression""" . ( "^^" - :symbol ) - a h:Sequence, - h:SequenceTail; - h:seqlabel """"^^" symbol""" . + n3:symbol ) + a :Sequence, + :SequenceTail; + :seqlabel """"^^" symbol""" . ( "barename" 0 ) log:outputString """
barename
@@ -228,6 +235,32 @@ ( "barename" 9 ) log:outputString "\t
\n" . + ( "barename_csl" + 0 ) + log:outputString """
barename_csl
+""" . + ( "barename_csl" + 5 ) + log:outputString """

barename barename_csl_tail

+""", + """

void

+""" . + ( "barename_csl" + 9 ) + log:outputString "\t
\n" . + ( "barename_csl_tail" + 0 ) + log:outputString """
barename_csl_tail
+""" . + ( "barename_csl_tail" + 5 ) + log:outputString """

"," barename barename_csl_tail

+""", + """

void

+""" . + ( "barename_csl_tail" + 9 ) + log:outputString "\t
\n" . ( "boolean" 0 ) log:outputString """
boolean
@@ -259,6 +292,8 @@ ( "declaration" 5 ) log:outputString """

"@base" explicituri

+""", + """

"@keywords" barename_csl

""", """

"@prefix" prefix explicituri

""" . @@ -305,6 +340,10 @@ ( "existential" 0 ) log:outputString """
existential
+""" . + ( "existential" + 5 ) + log:outputString """

"@forSome" symbol_csl

""" . ( "existential" 9 ) @@ -628,9 +667,39 @@ ( "symbol" 9 ) log:outputString "\t
\n" . + ( "symbol_csl" + 0 ) + log:outputString """
symbol_csl
+""" . + ( "symbol_csl" + 5 ) + log:outputString """

symbol symbol_csl_tail

+""", + """

void

+""" . + ( "symbol_csl" + 9 ) + log:outputString "\t
\n" . + ( "symbol_csl_tail" + 0 ) + log:outputString """
symbol_csl_tail
+""" . + ( "symbol_csl_tail" + 5 ) + log:outputString """

"," symbol symbol_csl_tail

+""", + """

void

+""" . + ( "symbol_csl_tail" + 9 ) + log:outputString "\t
\n" . ( "universal" 0 ) log:outputString """
universal
+""" . + ( "universal" + 5 ) + log:outputString """

"@forAll" symbol_csl

""" . ( "universal" 9 ) @@ -659,225 +728,241 @@ 9 ) log:outputString "\t
\n" . ( "{" - :formulacontent + n3:formulacontent "}" ) - a h:Sequence, - h:SequenceTail; - h:seqlabel """"{" formulacontent "}"""" . + a :Sequence, + :SequenceTail; + :seqlabel """"{" formulacontent "}"""" . ( "}" ) - a h:SequenceTail; - h:seqlabel """"}"""" . + a :SequenceTail; + :seqlabel """"}"""" . ( "~~" 9 ) log:outputString "\n
\n\n" . ( cfg:eof ) - a h:SequenceTail; - h:seqlabel "EOF" . - ( :barename + a :SequenceTail; + :seqlabel "EOF" . + ( n3:barename <#_g3> ) - a h:Sequence, - h:SequenceTail . - ( :boolean ) - a h:Sequence, - h:SequenceTail; - h:seqlabel "boolean" . - ( :decimal ) - a h:Sequence, - h:SequenceTail; - h:seqlabel "decimal" . - ( :declaration ) - a h:Sequence, - h:SequenceTail; - h:seqlabel "declaration" . - ( :double ) - a h:Sequence, - h:SequenceTail; - h:seqlabel "double" . - ( :dtlang ) - a h:SequenceTail; - h:seqlabel "dtlang" . - ( :existential ) - a h:Sequence, - h:SequenceTail; - h:seqlabel "existential" . - ( :explicituri ) - a h:Sequence, - h:SequenceTail; - h:seqlabel "explicituri" . - ( :expression + a :Sequence, + :SequenceTail; + :seqlabel "barename barename_csl_tail" . + ( n3:boolean ) + a :Sequence, + :SequenceTail; + :seqlabel "boolean" . + ( n3:decimal ) + a :Sequence, + :SequenceTail; + :seqlabel "decimal" . + ( n3:declaration ) + a :Sequence, + :SequenceTail; + :seqlabel "declaration" . + ( n3:double ) + a :Sequence, + :SequenceTail; + :seqlabel "double" . + ( n3:dtlang ) + a :SequenceTail; + :seqlabel "dtlang" . + ( n3:existential ) + a :Sequence, + :SequenceTail; + :seqlabel "existential" . + ( n3:explicituri ) + a :Sequence, + :SequenceTail; + :seqlabel "explicituri" . + ( n3:expression "@of" ) - a h:SequenceTail; - h:seqlabel """expression "@of"""" . - ( :expression - :pathlist ) - a h:Sequence, - h:SequenceTail; - h:seqlabel "expression pathlist" . - ( :expression ) - a h:Sequence, - h:SequenceTail; - h:seqlabel "expression" . - ( :formulacontent + a :SequenceTail; + :seqlabel """expression "@of"""" . + ( n3:expression + n3:pathlist ) + a :Sequence, + :SequenceTail; + :seqlabel "expression pathlist" . + ( n3:expression ) + a :Sequence, + :SequenceTail; + :seqlabel "expression" . + ( n3:formulacontent "}" ) - a h:SequenceTail; - h:seqlabel """formulacontent "}"""" . - ( :integer ) - a h:Sequence, - h:SequenceTail; - h:seqlabel "integer" . - ( :langcode ) - a h:SequenceTail; - h:seqlabel "langcode" . - ( :literal ) - a h:Sequence, - h:SequenceTail; - h:seqlabel "literal" . - ( :numericliteral ) - a h:Sequence, - h:SequenceTail; - h:seqlabel "numericliteral" . - ( :object - :objecttail - :propertylisttail ) - a h:SequenceTail; - h:seqlabel "object objecttail propertylisttail" . - ( :object - :objecttail ) - a h:SequenceTail; - h:seqlabel "object objecttail" . - ( :objecttail - :propertylisttail ) - a h:SequenceTail; - h:seqlabel "objecttail propertylisttail" . - ( :objecttail ) - a h:SequenceTail; - h:seqlabel "objecttail" . - ( :pathitem - :pathtail ) - a h:Sequence, - h:SequenceTail; - h:seqlabel "pathitem pathtail" . - ( :pathlist + a :SequenceTail; + :seqlabel """formulacontent "}"""" . + ( n3:integer ) + a :Sequence, + :SequenceTail; + :seqlabel "integer" . + ( n3:langcode ) + a :SequenceTail; + :seqlabel "langcode" . + ( n3:literal ) + a :Sequence, + :SequenceTail; + :seqlabel "literal" . + ( n3:numericliteral ) + a :Sequence, + :SequenceTail; + :seqlabel "numericliteral" . + ( n3:object + n3:objecttail + n3:propertylisttail ) + a :SequenceTail; + :seqlabel "object objecttail propertylisttail" . + ( n3:object + n3:objecttail ) + a :SequenceTail; + :seqlabel "object objecttail" . + ( n3:objecttail + n3:propertylisttail ) + a :SequenceTail; + :seqlabel "objecttail propertylisttail" . + ( n3:objecttail ) + a :SequenceTail; + :seqlabel "objecttail" . + ( n3:pathitem + n3:pathtail ) + a :Sequence, + :SequenceTail; + :seqlabel "pathitem pathtail" . + ( n3:pathlist ")" ) - a h:SequenceTail; - h:seqlabel """pathlist ")"""" . - ( :pathlist ) - a h:SequenceTail; - h:seqlabel "pathlist" . - ( :pathtail ) - a h:SequenceTail; - h:seqlabel "pathtail" . - ( :prefix - :explicituri ) - a h:SequenceTail; - h:seqlabel "prefix explicituri" . - ( :propertylist + a :SequenceTail; + :seqlabel """pathlist ")"""" . + ( n3:pathlist ) + a :SequenceTail; + :seqlabel "pathlist" . + ( n3:pathtail ) + a :SequenceTail; + :seqlabel "pathtail" . + ( n3:prefix + n3:explicituri ) + a :SequenceTail; + :seqlabel "prefix explicituri" . + ( n3:propertylist "]" ) - a h:SequenceTail; - h:seqlabel """propertylist "]"""" . - ( :propertylist ) - a h:SequenceTail; - h:seqlabel "propertylist" . - ( :propertylisttail ) - a h:SequenceTail; - h:seqlabel "propertylisttail" . - ( :qname ) - a h:Sequence, - h:SequenceTail; - h:seqlabel "qname" . - ( :quickvariable ) - a h:Sequence, - h:SequenceTail; - h:seqlabel "quickvariable" . - ( :simpleStatement ) - a h:Sequence, - h:SequenceTail; - h:seqlabel "simpleStatement" . - ( :statement + a :SequenceTail; + :seqlabel """propertylist "]"""" . + ( n3:propertylist ) + a :SequenceTail; + :seqlabel "propertylist" . + ( n3:propertylisttail ) + a :SequenceTail; + :seqlabel "propertylisttail" . + ( n3:qname ) + a :Sequence, + :SequenceTail; + :seqlabel "qname" . + ( n3:quickvariable ) + a :Sequence, + :SequenceTail; + :seqlabel "quickvariable" . + ( n3:simpleStatement ) + a :Sequence, + :SequenceTail; + :seqlabel "simpleStatement" . + ( n3:statement "." - :statements_optional ) - a h:Sequence, - h:SequenceTail; - h:seqlabel """statement "." statements_optional""" . - ( :statement - :statementtail ) - a h:Sequence, - h:SequenceTail; - h:seqlabel "statement statementtail" . - ( :statementlist ) - a h:Sequence, - h:SequenceTail; - h:seqlabel "statementlist" . - ( :statements_optional + n3:statements_optional ) + a :Sequence, + :SequenceTail; + :seqlabel """statement "." statements_optional""" . + ( n3:statement + n3:statementtail ) + a :Sequence, + :SequenceTail; + :seqlabel "statement statementtail" . + ( n3:statementlist ) + a :Sequence, + :SequenceTail; + :seqlabel "statementlist" . + ( n3:statements_optional cfg:eof ) - a h:Sequence, - h:SequenceTail; - h:seqlabel "statements_optional EOF" . - ( :statements_optional ) - a h:SequenceTail; - h:seqlabel "statements_optional" . - ( :statementtail ) - a h:SequenceTail; - h:seqlabel "statementtail" . - ( :string - :dtlang ) - a h:Sequence, - h:SequenceTail; - h:seqlabel "string dtlang" . - ( :subject - :propertylist ) - a h:Sequence, - h:SequenceTail; - h:seqlabel "subject propertylist" . - ( :symbol + a :Sequence, + :SequenceTail; + :seqlabel "statements_optional EOF" . + ( n3:statements_optional ) + a :SequenceTail; + :seqlabel "statements_optional" . + ( n3:statementtail ) + a :SequenceTail; + :seqlabel "statementtail" . + ( n3:string + n3:dtlang ) + a :Sequence, + :SequenceTail; + :seqlabel "string dtlang" . + ( n3:subject + n3:propertylist ) + a :Sequence, + :SequenceTail; + :seqlabel "subject propertylist" . + ( n3:symbol <#_g4> ) - a h:Sequence, - h:SequenceTail . - ( :symbol + a :Sequence, + :SequenceTail; + :seqlabel "symbol symbol_csl_tail" . + ( n3:symbol <#_g5> ) - a h:Sequence, - h:SequenceTail . - ( :symbol ) - a h:Sequence, - h:SequenceTail; - h:seqlabel "symbol" . - ( :universal ) - a h:Sequence, - h:SequenceTail; - h:seqlabel "universal" . - ( :verb - :object - :objecttail - :propertylisttail ) - a h:Sequence, - h:SequenceTail; - h:seqlabel "verb object objecttail propertylisttail" . + a :Sequence, + :SequenceTail; + :seqlabel "symbol symbol_csl_tail" . + ( n3:symbol ) + a :Sequence, + :SequenceTail; + :seqlabel "symbol" . + ( n3:universal ) + a :Sequence, + :SequenceTail; + :seqlabel "universal" . + ( n3:verb + n3:object + n3:objecttail + n3:propertylisttail ) + a :Sequence, + :SequenceTail; + :seqlabel "verb object objecttail propertylisttail" . ( <#_g0> ) - a h:SequenceTail . + a :SequenceTail; + :seqlabel "symbol_csl" . ( <#_g1> ) - a h:SequenceTail . + a :SequenceTail; + :seqlabel "symbol_csl" . ( <#_g2> ) - a h:SequenceTail . + a :SequenceTail; + :seqlabel "barename_csl" . ( <#_g3> ) - a h:SequenceTail . + a :SequenceTail; + :seqlabel "barename_csl_tail" . ( <#_g4> ) - a h:SequenceTail . + a :SequenceTail; + :seqlabel "symbol_csl_tail" . ( <#_g5> ) - a h:SequenceTail . + a :SequenceTail; + :seqlabel "symbol_csl_tail" . - cfg:syntaxFor [ - cfg:internetMediaType ] . + rdfs:comment """ + +These are rules to take the shortcut ontology such as cfg:zeroOrOneOf +and expland them into the base cfg:mustBeOneSequence. +It also generates human-readable labels for things which have been +generated. + +This file was split from n3.n3 on 2007-01-20. +""" . - cfg:eof h:reference "EOF" . + cfg:eof :reference "EOF" . - :barename a h:Production; + n3:barename a :Production; cfg:canStartWith "_", "a"; cfg:label "barename"; cfg:matches "[A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿][\\-0-9A-Z_a-z·À-ÖØ-öø-ͽͿ-῿‌-‍‿-⁀⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿]*"; - h:reference "barename" . + :reference "barename" . - :boolean a h:Production; + n3:boolean a :Production; cfg:canBeSequence ( "@false" ), ( @@ -888,7 +973,7 @@ "@true" ) ( "@false" ) ); - h:optionTail (), + :optionTail (), ( ( "@false" ) ), @@ -897,48 +982,48 @@ "@true" ) ( "@false" ) ); - h:reference "boolean" . + :reference "boolean" . - :decimal a h:Production; + n3:decimal a :Production; cfg:canStartWith "+", "-", "0"; cfg:label "decimal"; cfg:matches "[-+]?[0-9]+(\\.[0-9]+)?"; - h:reference "decimal" . + :reference "decimal" . - :declaration a h:Production; + n3:declaration a :Production; cfg:canBeSequence ( "@base" - :explicituri ), + n3:explicituri ), ( "@keywords" <#_g2> ), ( "@prefix" - :prefix - :explicituri ); + n3:prefix + n3:explicituri ); cfg:label "declaration"; cfg:mustBeOneSequence ( ( "@base" - :explicituri ) + n3:explicituri ) ( "@prefix" - :prefix - :explicituri ) + n3:prefix + n3:explicituri ) ( "@keywords" <#_g2> ) ); - h:optionTail (), + :optionTail (), ( ( "@base" - :explicituri ) + n3:explicituri ) ( "@prefix" - :prefix - :explicituri ) + n3:prefix + n3:explicituri ) ( "@keywords" <#_g2> ) ), @@ -949,78 +1034,78 @@ ( ( "@prefix" - :prefix - :explicituri ) + n3:prefix + n3:explicituri ) ( "@keywords" <#_g2> ) ); - h:reference "declaration" . + :reference "declaration" . - :document a rul:Used, - h:Production; + n3:document a rul:Used, + :Production; cfg:canBeSequence ( - :statements_optional + n3:statements_optional cfg:eof ); cfg:label "document"; cfg:mustBeOneSequence ( ( - :statements_optional + n3:statements_optional cfg:eof ) ); - h:optionTail (), + :optionTail (), ( ( - :statements_optional + n3:statements_optional cfg:eof ) ); - h:reference "document" . + :reference "document" . - :double a h:Production; + n3:double a :Production; cfg:canStartWith "+", "-", "0"; cfg:label "double"; cfg:matches "[-+]?[0-9]+(\\.[0-9]+)?([eE][-+]?[0-9]+)"; - h:reference "double" . + :reference "double" . - :dtlang a h:Production; + n3:dtlang a :Production; cfg:canBeSequence (), ( "@" - :langcode ), + n3:langcode ), ( "^^" - :symbol ); + n3:symbol ); cfg:label "dtlang"; cfg:mustBeOneSequence ( () ( "@" - :langcode ) + n3:langcode ) ( "^^" - :symbol ) ); - h:optionTail (), + n3:symbol ) ); + :optionTail (), ( () ( "@" - :langcode ) + n3:langcode ) ( "^^" - :symbol ) ), + n3:symbol ) ), ( ( "@" - :langcode ) + n3:langcode ) ( "^^" - :symbol ) ), + n3:symbol ) ), ( ( "^^" - :symbol ) ); - h:reference "dtlang" . + n3:symbol ) ); + :reference "dtlang" . - :existential a h:Production; + n3:existential a :Production; cfg:canBeSequence ( "@forSome" <#_g1> ); @@ -1029,630 +1114,630 @@ ( "@forSome" <#_g1> ) ); - h:optionTail (), + :optionTail (), ( ( "@forSome" <#_g1> ) ); - h:reference "existential" . + :reference "existential" . - :explicituri a h:Production; + n3:explicituri a :Production; cfg:canStartWith "<"; cfg:label "explicituri"; cfg:matches "<[^>]*>"; - h:reference "explicituri" . + :reference "explicituri" . - :expression a h:Production; + n3:expression a :Production; cfg:canBeSequence ( - :pathitem - :pathtail ); + n3:pathitem + n3:pathtail ); cfg:label "expression"; cfg:mustBeOneSequence ( ( - :pathitem - :pathtail ) ); - h:optionTail (), + n3:pathitem + n3:pathtail ) ); + :optionTail (), ( ( - :pathitem - :pathtail ) ); - h:reference "expression" . + n3:pathitem + n3:pathtail ) ); + :reference "expression" . - :formulacontent a h:Production; + n3:formulacontent a :Production; cfg:canBeSequence ( - :statementlist ); + n3:statementlist ); cfg:label "formulacontent"; cfg:mustBeOneSequence ( ( - :statementlist ) ); - h:optionTail (), + n3:statementlist ) ); + :optionTail (), ( ( - :statementlist ) ); - h:reference "formulacontent" . + n3:statementlist ) ); + :reference "formulacontent" . - :integer a h:Production; + n3:integer a :Production; cfg:canStartWith "+", "-", "0"; cfg:label "integer"; cfg:matches "[-+]?[0-9]+"; - h:reference "integer" . + :reference "integer" . - :langcode a h:Production; + n3:langcode a :Production; cfg:canStartWith "a"; cfg:label "langcode"; cfg:matches "[a-z]+(-[a-z0-9]+)*"; - h:reference "langcode" . + :reference "langcode" . - :language a cfg:Language; - cfg:document :document; + n3:language a cfg:Language; + cfg:document n3:document; cfg:whiteSpace "@@@@@" . - :literal a h:Production; + n3:literal a :Production; cfg:canBeSequence ( - :string - :dtlang ); + n3:string + n3:dtlang ); cfg:label "literal"; cfg:mustBeOneSequence ( ( - :string - :dtlang ) ); - h:optionTail (), + n3:string + n3:dtlang ) ); + :optionTail (), ( ( - :string - :dtlang ) ); - h:reference "literal" . + n3:string + n3:dtlang ) ); + :reference "literal" . - :numericliteral a h:Production; + n3:numericliteral a :Production; cfg:canBeSequence ( - :decimal ), + n3:decimal ), ( - :double ), + n3:double ), ( - :integer ); + n3:integer ); cfg:label "numericliteral"; cfg:mustBeOneSequence ( ( - :integer ) + n3:integer ) ( - :double ) + n3:double ) ( - :decimal ) ); - h:optionTail (), + n3:decimal ) ); + :optionTail (), ( ( - :decimal ) ), + n3:decimal ) ), ( ( - :double ) + n3:double ) ( - :decimal ) ), + n3:decimal ) ), ( ( - :integer ) + n3:integer ) ( - :double ) + n3:double ) ( - :decimal ) ); - h:reference "numericliteral" . + n3:decimal ) ); + :reference "numericliteral" . - :object a h:Production; + n3:object a :Production; cfg:canBeSequence ( - :expression ); + n3:expression ); cfg:label "object"; cfg:mustBeOneSequence ( ( - :expression ) ); - h:optionTail (), + n3:expression ) ); + :optionTail (), ( ( - :expression ) ); - h:reference "object" . + n3:expression ) ); + :reference "object" . - :objecttail a h:Production; + n3:objecttail a :Production; cfg:canBeSequence (), ( "," - :object - :objecttail ); + n3:object + n3:objecttail ); cfg:label "objecttail"; cfg:mustBeOneSequence ( () ( "," - :object - :objecttail ) ); - h:optionTail (), + n3:object + n3:objecttail ) ); + :optionTail (), ( () ( "," - :object - :objecttail ) ), + n3:object + n3:objecttail ) ), ( ( "," - :object - :objecttail ) ); - h:reference "objecttail" . + n3:object + n3:objecttail ) ); + :reference "objecttail" . - :pathitem a h:Production; + n3:pathitem a :Production; cfg:canBeSequence ( "(" - :pathlist + n3:pathlist ")" ), ( "[" - :propertylist + n3:propertylist "]" ), ( "{" - :formulacontent + n3:formulacontent "}" ), ( - :boolean ), + n3:boolean ), ( - :literal ), + n3:literal ), ( - :numericliteral ), + n3:numericliteral ), ( - :quickvariable ), + n3:quickvariable ), ( - :symbol ); + n3:symbol ); cfg:label "pathitem"; cfg:mustBeOneSequence ( ( - :symbol ) + n3:symbol ) ( "{" - :formulacontent + n3:formulacontent "}" ) ( - :quickvariable ) + n3:quickvariable ) ( - :numericliteral ) + n3:numericliteral ) ( - :literal ) + n3:literal ) ( "[" - :propertylist + n3:propertylist "]" ) ( "(" - :pathlist + n3:pathlist ")" ) ( - :boolean ) ); - h:optionTail (), + n3:boolean ) ); + :optionTail (), ( ( "(" - :pathlist + n3:pathlist ")" ) ( - :boolean ) ), + n3:boolean ) ), ( ( "[" - :propertylist + n3:propertylist "]" ) ( "(" - :pathlist + n3:pathlist ")" ) ( - :boolean ) ), + n3:boolean ) ), ( ( "{" - :formulacontent + n3:formulacontent "}" ) ( - :quickvariable ) + n3:quickvariable ) ( - :numericliteral ) + n3:numericliteral ) ( - :literal ) + n3:literal ) ( "[" - :propertylist + n3:propertylist "]" ) ( "(" - :pathlist + n3:pathlist ")" ) ( - :boolean ) ), + n3:boolean ) ), ( ( - :boolean ) ), + n3:boolean ) ), ( ( - :literal ) + n3:literal ) ( "[" - :propertylist + n3:propertylist "]" ) ( "(" - :pathlist + n3:pathlist ")" ) ( - :boolean ) ), + n3:boolean ) ), ( ( - :numericliteral ) + n3:numericliteral ) ( - :literal ) + n3:literal ) ( "[" - :propertylist + n3:propertylist "]" ) ( "(" - :pathlist + n3:pathlist ")" ) ( - :boolean ) ), + n3:boolean ) ), ( ( - :quickvariable ) + n3:quickvariable ) ( - :numericliteral ) + n3:numericliteral ) ( - :literal ) + n3:literal ) ( "[" - :propertylist + n3:propertylist "]" ) ( "(" - :pathlist + n3:pathlist ")" ) ( - :boolean ) ), + n3:boolean ) ), ( ( - :symbol ) + n3:symbol ) ( "{" - :formulacontent + n3:formulacontent "}" ) ( - :quickvariable ) + n3:quickvariable ) ( - :numericliteral ) + n3:numericliteral ) ( - :literal ) + n3:literal ) ( "[" - :propertylist + n3:propertylist "]" ) ( "(" - :pathlist + n3:pathlist ")" ) ( - :boolean ) ); - h:reference "pathitem" . + n3:boolean ) ); + :reference "pathitem" . - :pathlist a h:Production; + n3:pathlist a :Production; cfg:canBeSequence (), ( - :expression - :pathlist ); + n3:expression + n3:pathlist ); cfg:label "pathlist"; cfg:mustBeOneSequence ( () ( - :expression - :pathlist ) ); - h:optionTail (), + n3:expression + n3:pathlist ) ); + :optionTail (), ( () ( - :expression - :pathlist ) ), + n3:expression + n3:pathlist ) ), ( ( - :expression - :pathlist ) ); - h:reference "pathlist" . + n3:expression + n3:pathlist ) ); + :reference "pathlist" . - :pathtail a h:Production; + n3:pathtail a :Production; cfg:canBeSequence (), ( "!" - :expression ), + n3:expression ), ( "^" - :expression ); + n3:expression ); cfg:label "pathtail"; cfg:mustBeOneSequence ( () ( "!" - :expression ) + n3:expression ) ( "^" - :expression ) ); - h:optionTail (), + n3:expression ) ); + :optionTail (), ( () ( "!" - :expression ) + n3:expression ) ( "^" - :expression ) ), + n3:expression ) ), ( ( "!" - :expression ) + n3:expression ) ( "^" - :expression ) ), + n3:expression ) ), ( ( "^" - :expression ) ); - h:reference "pathtail" . + n3:expression ) ); + :reference "pathtail" . - :prefix a h:Production; + n3:prefix a :Production; cfg:canStartWith ":", "_", "a"; cfg:label "prefix"; cfg:matches "([A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿][\\-0-9A-Z_a-z·À-ÖØ-öø-ͽͿ-῿‌-‍‿-⁀⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿]*)?:"; - h:reference "prefix" . + :reference "prefix" . - :propertylist a h:Production; + n3:propertylist a :Production; cfg:canBeSequence (), ( - :verb - :object - :objecttail - :propertylisttail ); + n3:verb + n3:object + n3:objecttail + n3:propertylisttail ); cfg:label "propertylist"; cfg:mustBeOneSequence ( () ( - :verb - :object - :objecttail - :propertylisttail ) ); - h:optionTail (), + n3:verb + n3:object + n3:objecttail + n3:propertylisttail ) ); + :optionTail (), ( () ( - :verb - :object - :objecttail - :propertylisttail ) ), + n3:verb + n3:object + n3:objecttail + n3:propertylisttail ) ), ( ( - :verb - :object - :objecttail - :propertylisttail ) ); - h:reference "propertylist" . + n3:verb + n3:object + n3:objecttail + n3:propertylisttail ) ); + :reference "propertylist" . - :propertylisttail a h:Production; + n3:propertylisttail a :Production; cfg:canBeSequence (), ( ";" - :propertylist ); + n3:propertylist ); cfg:label "propertylisttail"; cfg:mustBeOneSequence ( () ( ";" - :propertylist ) ); - h:optionTail (), + n3:propertylist ) ); + :optionTail (), ( () ( ";" - :propertylist ) ), + n3:propertylist ) ), ( ( ";" - :propertylist ) ); - h:reference "propertylisttail" . + n3:propertylist ) ); + :reference "propertylisttail" . - :qname a h:Production; + n3:qname a :Production; cfg:canStartWith ":", "_", "a"; cfg:label "qname"; cfg:matches "(([A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿][\\-0-9A-Z_a-z·À-ÖØ-öø-ͽͿ-῿‌-‍‿-⁀⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿]*)?:)?[A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿][\\-0-9A-Z_a-z·À-ÖØ-öø-ͽͿ-῿‌-‍‿-⁀⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿]*"; - h:reference "qname" . + :reference "qname" . - :quickvariable a h:Production; + n3:quickvariable a :Production; cfg:canStartWith "?"; cfg:label "quickvariable"; cfg:matches "\\?[A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿][\\-0-9A-Z_a-z·À-ÖØ-öø-ͽͿ-῿‌-‍‿-⁀⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿]*"; - h:reference "quickvariable" . + :reference "quickvariable" . - :simpleStatement a h:Production; + n3:simpleStatement a :Production; cfg:canBeSequence ( - :subject - :propertylist ); + n3:subject + n3:propertylist ); cfg:label "simpleStatement"; cfg:mustBeOneSequence ( ( - :subject - :propertylist ) ); - h:optionTail (), + n3:subject + n3:propertylist ) ); + :optionTail (), ( ( - :subject - :propertylist ) ); - h:reference "simpleStatement" . + n3:subject + n3:propertylist ) ); + :reference "simpleStatement" . - :statement a h:Production; + n3:statement a :Production; cfg:canBeSequence ( - :declaration ), + n3:declaration ), ( - :existential ), + n3:existential ), ( - :simpleStatement ), + n3:simpleStatement ), ( - :universal ); + n3:universal ); cfg:label "statement"; cfg:mustBeOneSequence ( ( - :declaration ) + n3:declaration ) ( - :universal ) + n3:universal ) ( - :existential ) + n3:existential ) ( - :simpleStatement ) ); - h:optionTail (), + n3:simpleStatement ) ); + :optionTail (), ( ( - :declaration ) + n3:declaration ) ( - :universal ) + n3:universal ) ( - :existential ) + n3:existential ) ( - :simpleStatement ) ), + n3:simpleStatement ) ), ( ( - :existential ) + n3:existential ) ( - :simpleStatement ) ), + n3:simpleStatement ) ), ( ( - :simpleStatement ) ), + n3:simpleStatement ) ), ( ( - :universal ) + n3:universal ) ( - :existential ) + n3:existential ) ( - :simpleStatement ) ); - h:reference "statement" . + n3:simpleStatement ) ); + :reference "statement" . - :statementlist a h:Production; + n3:statementlist a :Production; cfg:canBeSequence (), ( - :statement - :statementtail ); + n3:statement + n3:statementtail ); cfg:label "statementlist"; cfg:mustBeOneSequence ( () ( - :statement - :statementtail ) ); - h:optionTail (), + n3:statement + n3:statementtail ) ); + :optionTail (), ( () ( - :statement - :statementtail ) ), + n3:statement + n3:statementtail ) ), ( ( - :statement - :statementtail ) ); - h:reference "statementlist" . + n3:statement + n3:statementtail ) ); + :reference "statementlist" . - :statements_optional a h:Production; + n3:statements_optional a :Production; cfg:canBeSequence (), ( - :statement + n3:statement "." - :statements_optional ); + n3:statements_optional ); cfg:label "statements_optional"; cfg:mustBeOneSequence ( () ( - :statement + n3:statement "." - :statements_optional ) ); - h:optionTail (), + n3:statements_optional ) ); + :optionTail (), ( () ( - :statement + n3:statement "." - :statements_optional ) ), + n3:statements_optional ) ), ( ( - :statement + n3:statement "." - :statements_optional ) ); - h:reference "statements_optional" . + n3:statements_optional ) ); + :reference "statements_optional" . - :statementtail a h:Production; + n3:statementtail a :Production; cfg:canBeSequence (), ( "." - :statementlist ); + n3:statementlist ); cfg:label "statementtail"; cfg:mustBeOneSequence ( () ( "." - :statementlist ) ); - h:optionTail (), + n3:statementlist ) ); + :optionTail (), ( () ( "." - :statementlist ) ), + n3:statementlist ) ), ( ( "." - :statementlist ) ); - h:reference "statementtail" . + n3:statementlist ) ); + :reference "statementtail" . - :string a h:Production; + n3:string a :Production; cfg:canStartWith "\""; cfg:label "string"; cfg:matches """(\"""[^"\\\\]*(?:(?:\\\\.|"(?!""))[^"\\\\]*)*\""")|("[^"\\\\]*(?:\\\\.[^"\\\\]*)*")"""; - h:reference "string" . + :reference "string" . - :subject a h:Production; + n3:subject a :Production; cfg:canBeSequence ( - :expression ); + n3:expression ); cfg:label "subject"; cfg:mustBeOneSequence ( ( - :expression ) ); - h:optionTail (), + n3:expression ) ); + :optionTail (), ( ( - :expression ) ); - h:reference "subject" . + n3:expression ) ); + :reference "subject" . - :symbol a h:Production; + n3:symbol a :Production; cfg:canBeSequence ( - :explicituri ), + n3:explicituri ), ( - :qname ); + n3:qname ); cfg:label "symbol"; cfg:mustBeOneSequence ( ( - :explicituri ) + n3:explicituri ) ( - :qname ) ); - h:optionTail (), + n3:qname ) ); + :optionTail (), ( ( - :explicituri ) + n3:explicituri ) ( - :qname ) ), + n3:qname ) ), ( ( - :qname ) ); - h:reference "symbol" . + n3:qname ) ); + :reference "symbol" . - :universal a h:Production; + n3:universal a :Production; cfg:canBeSequence ( "@forAll" <#_g0> ); @@ -1661,14 +1746,14 @@ ( "@forAll" <#_g0> ) ); - h:optionTail (), + :optionTail (), ( ( "@forAll" <#_g0> ) ); - h:reference "universal" . + :reference "universal" . - :verb a h:Production; + n3:verb a :Production; cfg:canBeSequence ( "<=" ), ( @@ -1679,23 +1764,23 @@ "@a" ), ( "@has" - :expression ), + n3:expression ), ( "@is" - :expression + n3:expression "@of" ), ( - :expression ); + n3:expression ); cfg:label "verb"; cfg:mustBeOneSequence ( ( - :expression ) + n3:expression ) ( "@has" - :expression ) + n3:expression ) ( "@is" - :expression + n3:expression "@of" ) ( "@a" ) @@ -1705,7 +1790,7 @@ "=>" ) ( "<=" ) ); - h:optionTail (), + :optionTail (), ( ( "<=" ) ), @@ -1733,10 +1818,10 @@ ( ( "@has" - :expression ) + n3:expression ) ( "@is" - :expression + n3:expression "@of" ) ( "@a" ) @@ -1749,7 +1834,7 @@ ( ( "@is" - :expression + n3:expression "@of" ) ( "@a" ) @@ -1761,13 +1846,13 @@ "<=" ) ), ( ( - :expression ) + n3:expression ) ( "@has" - :expression ) + n3:expression ) ( "@is" - :expression + n3:expression "@of" ) ( "@a" ) @@ -1777,149 +1862,161 @@ "=>" ) ( "<=" ) ); - h:reference "verb" . + :reference "verb" . - <#_g0> a h:Production; + <#_g0> a :Production; cfg:canBeSequence (), ( - :symbol + n3:symbol <#_g5> ); - cfg:commaSeparatedListOf :symbol; + cfg:commaSeparatedListOf n3:symbol; + cfg:label "symbol_csl"; cfg:mustBeOneSequence ( () ( - :symbol + n3:symbol <#_g5> ) ); - h:optionTail (), + :optionTail (), ( () ( - :symbol + n3:symbol <#_g5> ) ), ( ( - :symbol - <#_g5> ) ) . + n3:symbol + <#_g5> ) ); + :reference "symbol_csl" . - <#_g1> a h:Production; + <#_g1> a :Production; cfg:canBeSequence (), ( - :symbol + n3:symbol <#_g4> ); - cfg:commaSeparatedListOf :symbol; + cfg:commaSeparatedListOf n3:symbol; + cfg:label "symbol_csl"; cfg:mustBeOneSequence ( () ( - :symbol + n3:symbol <#_g4> ) ); - h:optionTail (), + :optionTail (), ( () ( - :symbol + n3:symbol <#_g4> ) ), ( ( - :symbol - <#_g4> ) ) . + n3:symbol + <#_g4> ) ); + :reference "symbol_csl" . - <#_g2> a h:Production; + <#_g2> a :Production; cfg:canBeSequence (), ( - :barename + n3:barename <#_g3> ); - cfg:commaSeparatedListOf :barename; + cfg:commaSeparatedListOf n3:barename; + cfg:label "barename_csl"; cfg:mustBeOneSequence ( () ( - :barename + n3:barename <#_g3> ) ); - h:optionTail (), + :optionTail (), ( () ( - :barename + n3:barename <#_g3> ) ), ( ( - :barename - <#_g3> ) ) . + n3:barename + <#_g3> ) ); + :reference "barename_csl" . - <#_g3> a h:Production; - cfg:CSLTail2 :barename; + <#_g3> a :Production; + cfg:CSLTail2 n3:barename; cfg:canBeSequence (), ( "," - :barename + n3:barename <#_g3> ); + cfg:label "barename_csl_tail"; cfg:mustBeOneSequence ( () ( "," - :barename + n3:barename <#_g3> ) ); - h:optionTail (), + :optionTail (), ( () ( "," - :barename + n3:barename <#_g3> ) ), ( ( "," - :barename - <#_g3> ) ) . + n3:barename + <#_g3> ) ); + :reference "barename_csl_tail" . - <#_g4> a h:Production; - cfg:CSLTail2 :symbol; + <#_g4> a :Production; + cfg:CSLTail2 n3:symbol; cfg:canBeSequence (), ( "," - :symbol + n3:symbol <#_g4> ); + cfg:label "symbol_csl_tail"; cfg:mustBeOneSequence ( () ( "," - :symbol + n3:symbol <#_g4> ) ); - h:optionTail (), + :optionTail (), ( () ( "," - :symbol + n3:symbol <#_g4> ) ), ( ( "," - :symbol - <#_g4> ) ) . + n3:symbol + <#_g4> ) ); + :reference "symbol_csl_tail" . - <#_g5> a h:Production; - cfg:CSLTail2 :symbol; + <#_g5> a :Production; + cfg:CSLTail2 n3:symbol; cfg:canBeSequence (), ( "," - :symbol + n3:symbol <#_g5> ); + cfg:label "symbol_csl_tail"; cfg:mustBeOneSequence ( () ( "," - :symbol + n3:symbol <#_g5> ) ); - h:optionTail (), + :optionTail (), ( () ( "," - :symbol + n3:symbol <#_g5> ) ), ( ( "," - :symbol - <#_g5> ) ) . + n3:symbol + <#_g5> ) ); + :reference "symbol_csl_tail" . diff --git a/grammar/n3-report.html b/grammar/n3-report.html index 6805560b..a08c9356 100644 --- a/grammar/n3-report.html +++ b/grammar/n3-report.html @@ -13,6 +13,14 @@

BNF

barename

[A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿][\-0-9A-Z_a-z·À-ÖØ-öø-ͽͿ-῿‌-‍‿-⁀⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿]*

+
barename_csl
+

barename barename_csl_tail

+

void

+
+
barename_csl_tail
+

"," barename barename_csl_tail

+

void

+
boolean

"@false"

"@true"

@@ -22,6 +30,7 @@

BNF

declaration

"@base" explicituri

+

"@keywords" barename_csl

"@prefix" prefix explicituri

document
@@ -36,6 +45,7 @@

BNF

void

existential
+

"@forSome" symbol_csl

explicituri

<[^>]*>

@@ -134,7 +144,16 @@

BNF

explicituri

qname

+
symbol_csl
+

symbol symbol_csl_tail

+

void

+
+
symbol_csl_tail
+

"," symbol symbol_csl_tail

+

void

+
universal
+

"@forAll" symbol_csl

verb

expression

diff --git a/grammar/n3-selectors.n3 b/grammar/n3-selectors.n3 index e69de29b..24c49d02 100644 --- a/grammar/n3-selectors.n3 +++ b/grammar/n3-selectors.n3 @@ -0,0 +1,1806 @@ + @prefix : . + @prefix n3: . + @prefix rul: . + + @forSome <#_g0>, + <#_g1>, + <#_g2>, + <#_g3>, + <#_g4>, + <#_g5> . + + "!" :canPrecede n3:expression; + :canStartWith "!" . + + "(" :canPrecede ")", + n3:pathlist; + :canStartWith "(" . + + ")" :canPrecede ")", + ".", + "@of", + "]", + "}", + n3:object, + n3:objecttail, + n3:pathlist, + n3:pathtail, + n3:propertylist, + n3:propertylisttail, + n3:statementtail . + + "," :canPrecede n3:barename, + n3:object, + n3:symbol; + :canStartWith "," . + + "." :canPrecede "}", + :eof, + n3:statementlist, + n3:statements_optional; + :canStartWith "." . + + ";" :canPrecede ".", + "]", + "}", + n3:propertylist, + n3:statementtail; + :canStartWith ";" . + + "<=" :canPrecede n3:object; + :canStartWith "<=" . + + "=" :canPrecede n3:object; + :canStartWith "=" . + + "=>" :canPrecede n3:object; + :canStartWith "=>" . + + "@" :canPrecede n3:langcode; + :canStartWith "@" . + + "@a" :canPrecede n3:object; + :canStartWith "@a" . + + "@base" :canPrecede n3:explicituri; + :canStartWith "@base" . + + "@false" :canPrecede ")", + ".", + "@of", + "]", + "}", + n3:object, + n3:objecttail, + n3:pathlist, + n3:pathtail, + n3:propertylist, + n3:propertylisttail, + n3:statementtail; + :canStartWith "@false" . + + "@forAll" :canPrecede ".", + "}", + n3:statementtail, + <#_g0>; + :canStartWith "@forAll" . + + "@forSome" :canPrecede ".", + "}", + n3:statementtail, + <#_g1>; + :canStartWith "@forSome" . + + "@has" :canPrecede n3:expression; + :canStartWith "@has" . + + "@is" :canPrecede n3:expression; + :canStartWith "@is" . + + "@keywords" :canPrecede ".", + "}", + n3:statementtail, + <#_g2>; + :canStartWith "@keywords" . + + "@of" :canPrecede n3:object . + + "@prefix" :canPrecede n3:prefix; + :canStartWith "@prefix" . + + "@true" :canPrecede ")", + ".", + "@of", + "]", + "}", + n3:object, + n3:objecttail, + n3:pathlist, + n3:pathtail, + n3:propertylist, + n3:propertylisttail, + n3:statementtail; + :canStartWith "@true" . + + "[" :canPrecede ".", + "]", + "}", + n3:propertylist, + n3:statementtail; + :canStartWith "[" . + + "]" :canPrecede ")", + ".", + "@of", + "]", + "}", + n3:object, + n3:objecttail, + n3:pathlist, + n3:pathtail, + n3:propertylist, + n3:propertylisttail, + n3:statementtail . + + "^" :canPrecede n3:expression; + :canStartWith "^" . + + "^^" :canPrecede n3:symbol; + :canStartWith "^^" . + + "{" :canPrecede n3:formulacontent; + :canStartWith "{" . + + "}" :canPrecede ")", + ".", + "@of", + "]", + "}", + n3:object, + n3:objecttail, + n3:pathlist, + n3:pathtail, + n3:propertylist, + n3:propertylisttail, + n3:statementtail . + + :syntaxFor [ + :internetMediaType ] . + + :eof :canStartWith "@EOFDUMMY" . + + n3:barename :canPrecede ".", + "}", + n3:statementtail, + <#_g3>; + :canStartWith "_", + "a"; + :matches "[A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿][\\-0-9A-Z_a-z·À-ÖØ-öø-ͽͿ-῿‌-‍‿-⁀⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿]*" . + + n3:boolean :TEST "@false", + "@true"; + :branch [ + :branchTail ( + "@true" ); + :condition "@true"; + :sequence ( + "@true" ) ], + [ + :branchTail ( + "@false" ); + :condition "@false"; + :sequence ( + "@false" ) ]; + :canPrecede ")", + ".", + "@of", + "]", + "}", + n3:object, + n3:objecttail, + n3:pathlist, + n3:pathtail, + n3:propertylist, + n3:propertylisttail, + n3:statementtail; + :canStartWith "@false", + "@true"; + :canStartWithLiteral "@false", + "@true"; + :mustBeOneSequence ( + ( + "@true" ) + ( + "@false" ) ) . + + n3:decimal :canPrecede ")", + ".", + "@of", + "]", + "}", + n3:object, + n3:objecttail, + n3:pathlist, + n3:pathtail, + n3:propertylist, + n3:propertylisttail, + n3:statementtail; + :canStartWith "+", + "-", + "0"; + :matches "[-+]?[0-9]+(\\.[0-9]+)?" . + + n3:declaration :TEST "@base", + "@keywords", + "@prefix"; + :branch [ + :branchTail ( + "@base" + n3:explicituri ); + :condition "@base"; + :sequence ( + "@base" + n3:explicituri ) ], + [ + :branchTail ( + "@prefix" + n3:prefix + n3:explicituri ); + :condition "@prefix"; + :sequence ( + "@prefix" + n3:prefix + n3:explicituri ) ], + [ + :branchTail ( + "@keywords" + <#_g2> ); + :condition "@keywords"; + :sequence ( + "@keywords" + <#_g2> ) ]; + :canPrecede ".", + "}", + n3:statementtail; + :canStartWith "@base", + "@keywords", + "@prefix"; + :canStartWithLiteral "@base", + "@keywords", + "@prefix"; + :mustBeOneSequence ( + ( + "@base" + n3:explicituri ) + ( + "@prefix" + n3:prefix + n3:explicituri ) + ( + "@keywords" + <#_g2> ) ) . + + n3:document a rul:Used; + :TEST n3:statements_optional; + :branch [ + :branchTail ( + :eof ), + ( + n3:statements_optional + :eof ); + :condition "\"", + "(", + "+", + "-", + "0", + ":", + "<", + "?", + "@EOFDUMMY", + "@base", + "@false", + "@forAll", + "@forSome", + "@keywords", + "@prefix", + "@true", + "[", + "_", + "a", + "{"; + :sequence ( + n3:statements_optional + :eof ) ]; + :canStartWith "\"", + "(", + "+", + "-", + "0", + ":", + "<", + "?", + "@EOFDUMMY", + "@base", + "@false", + "@forAll", + "@forSome", + "@keywords", + "@prefix", + "@true", + "[", + "_", + "a", + "{"; + :mustBeOneSequence ( + ( + n3:statements_optional + :eof ) ) . + + n3:double :canPrecede ")", + ".", + "@of", + "]", + "}", + n3:object, + n3:objecttail, + n3:pathlist, + n3:pathtail, + n3:propertylist, + n3:propertylisttail, + n3:statementtail; + :canStartWith "+", + "-", + "0"; + :matches "[-+]?[0-9]+(\\.[0-9]+)?([eE][-+]?[0-9]+)" . + + n3:dtlang :TEST "@", + "^^"; + :branch [ + :branchTail (); + :condition "!", + "\"", + "(", + ")", + "+", + ",", + "-", + ".", + "0", + ":", + ";", + "<", + "<=", + "=", + "=>", + "?", + "@a", + "@false", + "@has", + "@is", + "@of", + "@true", + "[", + "]", + "^", + "_", + "a", + "{", + "}"; + :sequence () ], + [ + :branchTail ( + "@" + n3:langcode ); + :condition "@"; + :sequence ( + "@" + n3:langcode ) ], + [ + :branchTail ( + "^^" + n3:symbol ); + :condition "^^"; + :sequence ( + "^^" + n3:symbol ) ]; + :canPrecede ")", + ".", + "@of", + "]", + "}", + n3:object, + n3:objecttail, + n3:pathlist, + n3:pathtail, + n3:propertylist, + n3:propertylisttail, + n3:statementtail; + :canStartWith "@", + "^^"; + :canStartWithLiteral "@", + "^^"; + :mustBeOneSequence ( + () + ( + "@" + n3:langcode ) + ( + "^^" + n3:symbol ) ) . + + n3:existential :TEST "@forSome"; + :branch [ + :branchTail ( + "@forSome" + <#_g1> ); + :condition "@forSome"; + :sequence ( + "@forSome" + <#_g1> ) ]; + :canPrecede ".", + "}", + n3:statementtail; + :canStartWith "@forSome"; + :canStartWithLiteral "@forSome"; + :mustBeOneSequence ( + ( + "@forSome" + <#_g1> ) ) . + + n3:explicituri :canPrecede ")", + ".", + "@of", + "]", + "}", + n3:object, + n3:objecttail, + n3:pathlist, + n3:pathtail, + n3:propertylist, + n3:propertylisttail, + n3:statementtail, + <#_g4>, + <#_g5>; + :canStartWith "<"; + :matches "<[^>]*>" . + + n3:expression :TEST n3:pathitem; + :branch [ + :branchTail ( + n3:pathitem + n3:pathtail ); + :condition "\"", + "(", + "+", + "-", + "0", + ":", + "<", + "?", + "@false", + "@true", + "[", + "_", + "a", + "{"; + :sequence ( + n3:pathitem + n3:pathtail ) ]; + :canPrecede ")", + ".", + "@of", + "]", + "}", + n3:object, + n3:objecttail, + n3:pathlist, + n3:propertylist, + n3:propertylisttail, + n3:statementtail; + :canStartWith "\"", + "(", + "+", + "-", + "0", + ":", + "<", + "?", + "@false", + "@true", + "[", + "_", + "a", + "{"; + :mustBeOneSequence ( + ( + n3:pathitem + n3:pathtail ) ) . + + n3:formulacontent :TEST n3:statementlist; + :branch [ + :branchTail (), + ( + n3:statementlist ); + :condition "\"", + "(", + "+", + "-", + "0", + ":", + "<", + "?", + "@base", + "@false", + "@forAll", + "@forSome", + "@keywords", + "@prefix", + "@true", + "[", + "_", + "a", + "{"; + :sequence ( + n3:statementlist ) ]; + :canPrecede "}"; + :canStartWith "\"", + "(", + "+", + "-", + "0", + ":", + "<", + "?", + "@base", + "@false", + "@forAll", + "@forSome", + "@keywords", + "@prefix", + "@true", + "[", + "_", + "a", + "{"; + :mustBeOneSequence ( + ( + n3:statementlist ) ) . + + n3:integer :canPrecede ")", + ".", + "@of", + "]", + "}", + n3:object, + n3:objecttail, + n3:pathlist, + n3:pathtail, + n3:propertylist, + n3:propertylisttail, + n3:statementtail; + :canStartWith "+", + "-", + "0"; + :matches "[-+]?[0-9]+" . + + n3:langcode :canPrecede ")", + ".", + "@of", + "]", + "}", + n3:object, + n3:objecttail, + n3:pathlist, + n3:pathtail, + n3:propertylist, + n3:propertylisttail, + n3:statementtail; + :canStartWith "a"; + :matches "[a-z]+(-[a-z0-9]+)*" . + + n3:language a :Language; + :document n3:document; + :whiteSpace "@@@@@" . + + n3:literal :TEST n3:string; + :branch [ + :branchTail ( + n3:string + n3:dtlang ); + :condition "\""; + :sequence ( + n3:string + n3:dtlang ) ]; + :canPrecede ")", + ".", + "@of", + "]", + "}", + n3:object, + n3:objecttail, + n3:pathlist, + n3:pathtail, + n3:propertylist, + n3:propertylisttail, + n3:statementtail; + :canStartWith "\""; + :mustBeOneSequence ( + ( + n3:string + n3:dtlang ) ) . + + n3:numericliteral :TEST n3:decimal, + n3:double, + n3:integer; + :branch [ + :branchTail ( + n3:integer ); + :condition "+", + "-", + "0"; + :sequence ( + n3:integer ) ], + [ + :branchTail ( + n3:double ); + :condition "+", + "-", + "0"; + :sequence ( + n3:double ) ], + [ + :branchTail ( + n3:decimal ); + :condition "+", + "-", + "0"; + :sequence ( + n3:decimal ) ]; + :canPrecede ")", + ".", + "@of", + "]", + "}", + n3:object, + n3:objecttail, + n3:pathlist, + n3:pathtail, + n3:propertylist, + n3:propertylisttail, + n3:statementtail; + :canStartWith "+", + "-", + "0"; + :mustBeOneSequence ( + ( + n3:integer ) + ( + n3:double ) + ( + n3:decimal ) ) . + + n3:object :TEST n3:expression; + :branch [ + :branchTail ( + n3:expression ); + :condition "\"", + "(", + "+", + "-", + "0", + ":", + "<", + "?", + "@false", + "@true", + "[", + "_", + "a", + "{"; + :sequence ( + n3:expression ) ]; + :canPrecede ".", + "]", + "}", + n3:objecttail, + n3:propertylisttail, + n3:statementtail; + :canStartWith "\"", + "(", + "+", + "-", + "0", + ":", + "<", + "?", + "@false", + "@true", + "[", + "_", + "a", + "{"; + :mustBeOneSequence ( + ( + n3:expression ) ) . + + n3:objecttail :TEST ","; + :branch [ + :branchTail (); + :condition ".", + ";", + "]", + "}"; + :sequence () ], + [ + :branchTail ( + "," + n3:object + n3:objecttail ); + :condition ","; + :sequence ( + "," + n3:object + n3:objecttail ) ]; + :canPrecede ".", + "]", + "}", + n3:propertylisttail, + n3:statementtail; + :canStartWith ","; + :canStartWithLiteral ","; + :mustBeOneSequence ( + () + ( + "," + n3:object + n3:objecttail ) ) . + + n3:pathitem :TEST "(", + "[", + "{", + n3:boolean, + n3:literal, + n3:numericliteral, + n3:quickvariable, + n3:symbol; + :branch [ + :branchTail ( + n3:symbol ); + :condition ":", + "<", + "_", + "a"; + :sequence ( + n3:symbol ) ], + [ + :branchTail ( + "{" + n3:formulacontent + "}" ); + :condition "{"; + :sequence ( + "{" + n3:formulacontent + "}" ) ], + [ + :branchTail ( + n3:quickvariable ); + :condition "?"; + :sequence ( + n3:quickvariable ) ], + [ + :branchTail ( + n3:numericliteral ); + :condition "+", + "-", + "0"; + :sequence ( + n3:numericliteral ) ], + [ + :branchTail ( + n3:literal ); + :condition "\""; + :sequence ( + n3:literal ) ], + [ + :branchTail ( + "[" + n3:propertylist + "]" ); + :condition "["; + :sequence ( + "[" + n3:propertylist + "]" ) ], + [ + :branchTail ( + "(" + n3:pathlist + ")" ); + :condition "("; + :sequence ( + "(" + n3:pathlist + ")" ) ], + [ + :branchTail ( + n3:boolean ); + :condition "@false", + "@true"; + :sequence ( + n3:boolean ) ]; + :canPrecede ")", + ".", + "@of", + "]", + "}", + n3:object, + n3:objecttail, + n3:pathlist, + n3:pathtail, + n3:propertylist, + n3:propertylisttail, + n3:statementtail; + :canStartWith "\"", + "(", + "+", + "-", + "0", + ":", + "<", + "?", + "@false", + "@true", + "[", + "_", + "a", + "{"; + :canStartWithLiteral "(", + "[", + "{"; + :mustBeOneSequence ( + ( + n3:symbol ) + ( + "{" + n3:formulacontent + "}" ) + ( + n3:quickvariable ) + ( + n3:numericliteral ) + ( + n3:literal ) + ( + "[" + n3:propertylist + "]" ) + ( + "(" + n3:pathlist + ")" ) + ( + n3:boolean ) ) . + + n3:pathlist :TEST n3:expression; + :branch [ + :branchTail (); + :condition ")"; + :sequence () ], + [ + :branchTail ( + n3:expression + n3:pathlist ); + :condition "\"", + "(", + "+", + "-", + "0", + ":", + "<", + "?", + "@false", + "@true", + "[", + "_", + "a", + "{"; + :sequence ( + n3:expression + n3:pathlist ) ]; + :canPrecede ")"; + :canStartWith "\"", + "(", + "+", + "-", + "0", + ":", + "<", + "?", + "@false", + "@true", + "[", + "_", + "a", + "{"; + :mustBeOneSequence ( + () + ( + n3:expression + n3:pathlist ) ) . + + n3:pathtail :TEST "!", + "^"; + :branch [ + :branchTail (); + :condition "\"", + "(", + ")", + "+", + ",", + "-", + ".", + "0", + ":", + ";", + "<", + "<=", + "=", + "=>", + "?", + "@a", + "@false", + "@has", + "@is", + "@of", + "@true", + "[", + "]", + "_", + "a", + "{", + "}"; + :sequence () ], + [ + :branchTail ( + "!" + n3:expression ); + :condition "!"; + :sequence ( + "!" + n3:expression ) ], + [ + :branchTail ( + "^" + n3:expression ); + :condition "^"; + :sequence ( + "^" + n3:expression ) ]; + :canPrecede ")", + ".", + "@of", + "]", + "}", + n3:object, + n3:objecttail, + n3:pathlist, + n3:propertylist, + n3:propertylisttail, + n3:statementtail; + :canStartWith "!", + "^"; + :canStartWithLiteral "!", + "^"; + :mustBeOneSequence ( + () + ( + "!" + n3:expression ) + ( + "^" + n3:expression ) ) . + + n3:prefix :canPrecede n3:explicituri; + :canStartWith ":", + "_", + "a"; + :matches "([A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿][\\-0-9A-Z_a-z·À-ÖØ-öø-ͽͿ-῿‌-‍‿-⁀⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿]*)?:" . + + n3:propertylist :TEST n3:verb; + :branch [ + :branchTail (); + :condition ".", + "]", + "}"; + :sequence () ], + [ + :branchTail ( + n3:verb + n3:object + n3:objecttail + n3:propertylisttail ); + :condition "\"", + "(", + "+", + "-", + "0", + ":", + "<", + "<=", + "=", + "=>", + "?", + "@a", + "@false", + "@has", + "@is", + "@true", + "[", + "_", + "a", + "{"; + :sequence ( + n3:verb + n3:object + n3:objecttail + n3:propertylisttail ) ]; + :canPrecede ".", + "]", + "}", + n3:statementtail; + :canStartWith "\"", + "(", + "+", + "-", + "0", + ":", + "<", + "<=", + "=", + "=>", + "?", + "@a", + "@false", + "@has", + "@is", + "@true", + "[", + "_", + "a", + "{"; + :mustBeOneSequence ( + () + ( + n3:verb + n3:object + n3:objecttail + n3:propertylisttail ) ) . + + n3:propertylisttail :TEST ";"; + :branch [ + :branchTail (); + :condition ".", + "]", + "}"; + :sequence () ], + [ + :branchTail ( + ";" + n3:propertylist ); + :condition ";"; + :sequence ( + ";" + n3:propertylist ) ]; + :canPrecede ".", + "]", + "}", + n3:statementtail; + :canStartWith ";"; + :canStartWithLiteral ";"; + :mustBeOneSequence ( + () + ( + ";" + n3:propertylist ) ) . + + n3:qname :canPrecede ")", + ".", + "@of", + "]", + "}", + n3:object, + n3:objecttail, + n3:pathlist, + n3:pathtail, + n3:propertylist, + n3:propertylisttail, + n3:statementtail, + <#_g4>, + <#_g5>; + :canStartWith ":", + "_", + "a"; + :matches "(([A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿][\\-0-9A-Z_a-z·À-ÖØ-öø-ͽͿ-῿‌-‍‿-⁀⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿]*)?:)?[A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿][\\-0-9A-Z_a-z·À-ÖØ-öø-ͽͿ-῿‌-‍‿-⁀⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿]*" . + + n3:quickvariable :canPrecede ")", + ".", + "@of", + "]", + "}", + n3:object, + n3:objecttail, + n3:pathlist, + n3:pathtail, + n3:propertylist, + n3:propertylisttail, + n3:statementtail; + :canStartWith "?"; + :matches "\\?[A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿][\\-0-9A-Z_a-z·À-ÖØ-öø-ͽͿ-῿‌-‍‿-⁀⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿]*" . + + n3:simpleStatement :TEST n3:subject; + :branch [ + :branchTail ( + n3:subject + n3:propertylist ); + :condition "\"", + "(", + "+", + "-", + "0", + ":", + "<", + "?", + "@false", + "@true", + "[", + "_", + "a", + "{"; + :sequence ( + n3:subject + n3:propertylist ) ]; + :canPrecede ".", + "}", + n3:statementtail; + :canStartWith "\"", + "(", + "+", + "-", + "0", + ":", + "<", + "?", + "@false", + "@true", + "[", + "_", + "a", + "{"; + :mustBeOneSequence ( + ( + n3:subject + n3:propertylist ) ) . + + n3:statement :TEST n3:declaration, + n3:existential, + n3:simpleStatement, + n3:universal; + :branch [ + :branchTail ( + n3:declaration ); + :condition "@base", + "@keywords", + "@prefix"; + :sequence ( + n3:declaration ) ], + [ + :branchTail ( + n3:universal ); + :condition "@forAll"; + :sequence ( + n3:universal ) ], + [ + :branchTail ( + n3:existential ); + :condition "@forSome"; + :sequence ( + n3:existential ) ], + [ + :branchTail ( + n3:simpleStatement ); + :condition "\"", + "(", + "+", + "-", + "0", + ":", + "<", + "?", + "@false", + "@true", + "[", + "_", + "a", + "{"; + :sequence ( + n3:simpleStatement ) ]; + :canPrecede ".", + "}", + n3:statementtail; + :canStartWith "\"", + "(", + "+", + "-", + "0", + ":", + "<", + "?", + "@base", + "@false", + "@forAll", + "@forSome", + "@keywords", + "@prefix", + "@true", + "[", + "_", + "a", + "{"; + :mustBeOneSequence ( + ( + n3:declaration ) + ( + n3:universal ) + ( + n3:existential ) + ( + n3:simpleStatement ) ) . + + n3:statementlist :TEST n3:statement; + :branch [ + :branchTail (); + :condition "}"; + :sequence () ], + [ + :branchTail ( + n3:statement + n3:statementtail ); + :condition "\"", + "(", + "+", + "-", + "0", + ":", + "<", + "?", + "@base", + "@false", + "@forAll", + "@forSome", + "@keywords", + "@prefix", + "@true", + "[", + "_", + "a", + "{"; + :sequence ( + n3:statement + n3:statementtail ) ]; + :canPrecede "}"; + :canStartWith "\"", + "(", + "+", + "-", + "0", + ":", + "<", + "?", + "@base", + "@false", + "@forAll", + "@forSome", + "@keywords", + "@prefix", + "@true", + "[", + "_", + "a", + "{"; + :mustBeOneSequence ( + () + ( + n3:statement + n3:statementtail ) ) . + + n3:statements_optional :TEST n3:statement; + :branch [ + :branchTail (); + :condition "@EOFDUMMY"; + :sequence () ], + [ + :branchTail ( + n3:statement + "." + n3:statements_optional ); + :condition "\"", + "(", + "+", + "-", + "0", + ":", + "<", + "?", + "@base", + "@false", + "@forAll", + "@forSome", + "@keywords", + "@prefix", + "@true", + "[", + "_", + "a", + "{"; + :sequence ( + n3:statement + "." + n3:statements_optional ) ]; + :canPrecede :eof; + :canStartWith "\"", + "(", + "+", + "-", + "0", + ":", + "<", + "?", + "@base", + "@false", + "@forAll", + "@forSome", + "@keywords", + "@prefix", + "@true", + "[", + "_", + "a", + "{"; + :mustBeOneSequence ( + () + ( + n3:statement + "." + n3:statements_optional ) ) . + + n3:statementtail :TEST "."; + :branch [ + :branchTail (); + :condition "}"; + :sequence () ], + [ + :branchTail ( + "." + n3:statementlist ); + :condition "."; + :sequence ( + "." + n3:statementlist ) ]; + :canPrecede "}"; + :canStartWith "."; + :canStartWithLiteral "."; + :mustBeOneSequence ( + () + ( + "." + n3:statementlist ) ) . + + n3:string :canPrecede ")", + ".", + "@of", + "]", + "}", + n3:dtlang, + n3:object, + n3:objecttail, + n3:pathlist, + n3:pathtail, + n3:propertylist, + n3:propertylisttail, + n3:statementtail; + :canStartWith "\""; + :matches """(\"""[^"\\\\]*(?:(?:\\\\.|"(?!""))[^"\\\\]*)*\""")|("[^"\\\\]*(?:\\\\.[^"\\\\]*)*")""" . + + n3:subject :TEST n3:expression; + :branch [ + :branchTail ( + n3:expression ); + :condition "\"", + "(", + "+", + "-", + "0", + ":", + "<", + "?", + "@false", + "@true", + "[", + "_", + "a", + "{"; + :sequence ( + n3:expression ) ]; + :canPrecede ".", + "]", + "}", + n3:propertylist, + n3:statementtail; + :canStartWith "\"", + "(", + "+", + "-", + "0", + ":", + "<", + "?", + "@false", + "@true", + "[", + "_", + "a", + "{"; + :mustBeOneSequence ( + ( + n3:expression ) ) . + + n3:symbol :TEST n3:explicituri, + n3:qname; + :branch [ + :branchTail ( + n3:explicituri ); + :condition "<"; + :sequence ( + n3:explicituri ) ], + [ + :branchTail ( + n3:qname ); + :condition ":", + "_", + "a"; + :sequence ( + n3:qname ) ]; + :canPrecede ")", + ".", + "@of", + "]", + "}", + n3:object, + n3:objecttail, + n3:pathlist, + n3:pathtail, + n3:propertylist, + n3:propertylisttail, + n3:statementtail, + <#_g4>, + <#_g5>; + :canStartWith ":", + "<", + "_", + "a"; + :mustBeOneSequence ( + ( + n3:explicituri ) + ( + n3:qname ) ) . + + n3:universal :TEST "@forAll"; + :branch [ + :branchTail ( + "@forAll" + <#_g0> ); + :condition "@forAll"; + :sequence ( + "@forAll" + <#_g0> ) ]; + :canPrecede ".", + "}", + n3:statementtail; + :canStartWith "@forAll"; + :canStartWithLiteral "@forAll"; + :mustBeOneSequence ( + ( + "@forAll" + <#_g0> ) ) . + + n3:verb :TEST "<=", + "=", + "=>", + "@a", + "@has", + "@is", + n3:expression; + :branch [ + :branchTail ( + n3:expression ); + :condition "\"", + "(", + "+", + "-", + "0", + ":", + "<", + "?", + "@false", + "@true", + "[", + "_", + "a", + "{"; + :sequence ( + n3:expression ) ], + [ + :branchTail ( + "@has" + n3:expression ); + :condition "@has"; + :sequence ( + "@has" + n3:expression ) ], + [ + :branchTail ( + "@is" + n3:expression + "@of" ); + :condition "@is"; + :sequence ( + "@is" + n3:expression + "@of" ) ], + [ + :branchTail ( + "@a" ); + :condition "@a"; + :sequence ( + "@a" ) ], + [ + :branchTail ( + "=" ); + :condition "="; + :sequence ( + "=" ) ], + [ + :branchTail ( + "=>" ); + :condition "=>"; + :sequence ( + "=>" ) ], + [ + :branchTail ( + "<=" ); + :condition "<="; + :sequence ( + "<=" ) ]; + :canPrecede n3:object; + :canStartWith "\"", + "(", + "+", + "-", + "0", + ":", + "<", + "<=", + "=", + "=>", + "?", + "@a", + "@false", + "@has", + "@is", + "@true", + "[", + "_", + "a", + "{"; + :canStartWithLiteral "<=", + "=", + "=>", + "@a", + "@has", + "@is"; + :mustBeOneSequence ( + ( + n3:expression ) + ( + "@has" + n3:expression ) + ( + "@is" + n3:expression + "@of" ) + ( + "@a" ) + ( + "=" ) + ( + "=>" ) + ( + "<=" ) ) . + + <#_g0> :TEST n3:symbol; + :branch [ + :branchTail (); + :condition ".", + "}"; + :sequence () ], + [ + :branchTail ( + n3:symbol + <#_g5> ); + :condition ":", + "<", + "_", + "a"; + :sequence ( + n3:symbol + <#_g5> ) ]; + :canPrecede ".", + "}", + n3:statementtail; + :canStartWith ":", + "<", + "_", + "a"; + :commaSeparatedListOf n3:symbol; + :mustBeOneSequence ( + () + ( + n3:symbol + <#_g5> ) ) . + + <#_g1> :TEST n3:symbol; + :branch [ + :branchTail (); + :condition ".", + "}"; + :sequence () ], + [ + :branchTail ( + n3:symbol + <#_g4> ); + :condition ":", + "<", + "_", + "a"; + :sequence ( + n3:symbol + <#_g4> ) ]; + :canPrecede ".", + "}", + n3:statementtail; + :canStartWith ":", + "<", + "_", + "a"; + :commaSeparatedListOf n3:symbol; + :mustBeOneSequence ( + () + ( + n3:symbol + <#_g4> ) ) . + + <#_g2> :TEST n3:barename; + :branch [ + :branchTail (); + :condition ".", + "}"; + :sequence () ], + [ + :branchTail ( + n3:barename + <#_g3> ); + :condition "_", + "a"; + :sequence ( + n3:barename + <#_g3> ) ]; + :canPrecede ".", + "}", + n3:statementtail; + :canStartWith "_", + "a"; + :commaSeparatedListOf n3:barename; + :mustBeOneSequence ( + () + ( + n3:barename + <#_g3> ) ) . + + <#_g3> :CSLTail2 n3:barename; + :TEST ","; + :branch [ + :branchTail (); + :condition ".", + "}"; + :sequence () ], + [ + :branchTail ( + "," + n3:barename + <#_g3> ); + :condition ","; + :sequence ( + "," + n3:barename + <#_g3> ) ]; + :canPrecede ".", + "}", + n3:statementtail; + :canStartWith ","; + :canStartWithLiteral ","; + :mustBeOneSequence ( + () + ( + "," + n3:barename + <#_g3> ) ) . + + <#_g4> :CSLTail2 n3:symbol; + :TEST ","; + :branch [ + :branchTail (); + :condition ".", + "}"; + :sequence () ], + [ + :branchTail ( + "," + n3:symbol + <#_g4> ); + :condition ","; + :sequence ( + "," + n3:symbol + <#_g4> ) ]; + :canPrecede ".", + "}", + n3:statementtail; + :canStartWith ","; + :canStartWithLiteral ","; + :mustBeOneSequence ( + () + ( + "," + n3:symbol + <#_g4> ) ) . + + <#_g5> :CSLTail2 n3:symbol; + :TEST ","; + :branch [ + :branchTail (); + :condition ".", + "}"; + :sequence () ], + [ + :branchTail ( + "," + n3:symbol + <#_g5> ); + :condition ","; + :sequence ( + "," + n3:symbol + <#_g5> ) ]; + :canPrecede ".", + "}", + n3:statementtail; + :canStartWith ","; + :canStartWithLiteral ","; + :mustBeOneSequence ( + () + ( + "," + n3:symbol + <#_g5> ) ) . + diff --git a/grammar/n3.n3 b/grammar/n3.n3 index 3afc5d85..cc334e16 100644 --- a/grammar/n3.n3 +++ b/grammar/n3.n3 @@ -30,10 +30,9 @@ # (possible ending characters of one and beginning characters overlap) # -<> cfg:syntaxFor [ cfg:internetMediaType - ]. +#<> cfg:syntaxFor [ cfg:internetMediaType +# ]. -# <> rdfsem:semanticsFor "" ..... # __________________________________________________________________ # @@ -107,7 +106,7 @@ simpleStatement cfg:mustBeOneSequence(( subject propertylist )). propertylist cfg:mustBeOneSequence ( ( ) - ( verb object objecttail propertylisttail ) + ( predicate object objecttail propertylisttail ) ). propertylisttail cfg:mustBeOneSequence ( @@ -122,7 +121,7 @@ objecttail cfg:mustBeOneSequence ( ). -verb cfg:mustBeOneSequence ( +predicate cfg:mustBeOneSequence ( ( expression ) ( "@has" expression ) ( "@is" expression "@of" ) @@ -175,10 +174,14 @@ symbol cfg:mustBeOneSequence ( numericliteral cfg:mustBeOneSequence ( ( integer ) + ( rational ) ( double ) ( decimal ) ) . +rational cfg:mustBeOneSequence (( integer "/" unsignedint)). + + literal cfg:mustBeOneSequence(( string dtlang)). dtlang cfg:mustBeOneSequence( () ("@" langcode) ("^^" symbol)). @@ -194,6 +197,8 @@ dtlang cfg:mustBeOneSequence( () ("@" langcode) ("^^" symbol)). # integer cfg:matches """[-+]?[0-9]+"""; cfg:canStartWith "0", "-", "+". +unsignedint cfg:matches """[0-9]+"""; + cfg:canStartWith "0". double cfg:matches """[-+]?[0-9]+(\\.[0-9]+)?([eE][-+]?[0-9]+)"""; cfg:canStartWith "0", "-", "+". decimal cfg:matches """[-+]?[0-9]+(\\.[0-9]+)?"""; @@ -244,7 +249,7 @@ langcode cfg:matches "[a-z]+(-[a-z0-9]+)*"; # http://www.w3.org/TR/rdf-testcas # >>> print notation3.stringToN3(tokenize.Double) # "[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\"" # After that we have to prefix with one or three opening \" which -# the python regexp doesn't have them. +# the python regexp doesn't have. # # string3 cfg:matches "\"\"\"[^\"\\\\]*(?:(?:\\\\.|\"(?!\"\"))[^\"\\\\]*)*\"\"\"". # string1 cfg:matches "\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\"". @@ -252,64 +257,5 @@ langcode cfg:matches "[a-z]+(-[a-z0-9]+)*"; # http://www.w3.org/TR/rdf-testcas string cfg:matches "(\"\"\"[^\"\\\\]*(?:(?:\\\\.|\"(?!\"\"))[^\"\\\\]*)*\"\"\")|(\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\")"; cfg:canStartWith "\"". -#____________________________________________________ - -# Axioms reducing the shortcut CFG terms to cfg:musBeOneSequence. - -{ ?x cfg:zeroOrMore ?y } => {?x cfg:mustBeOneSequence ( () (?y ?x) ) }. - - -{ ?x cfg:commaSeparatedPeriodTerminatedListOf ?y } => -{ - ?x cfg:mustBeOneSequence ( - ( "." ) - ( ?y [cfg:CSLTail ?y] ) - ) -}. - -{ ?x cfg:CSLTail ?y } => -{ - ?x cfg:mustBeOneSequence ( - ( "." ) - ( "," ?y ?x ) - ) -}. - -# Without the period - -{ ?x cfg:commaSeparatedListOf ?y } => -{ - ?x cfg:mustBeOneSequence ( - ( ) - ( ?y [cfg:CSLTail2 ?y] ) - ) -}. - -{ ?x cfg:CSLTail2 ?y } => -{ - ?x cfg:mustBeOneSequence ( - ( ) - ( "," ?y ?x ) - ) -}. - - -# labelling of things which do not have explicit URIs: - -{ ?x cfg:zeroOrMore [ cfg:label ?y]. - ( ?y "_s" ) string:concatenation ?str } => { ?x cfg:label ?str }. - -{ ?x cfg:commaSeparatedPeriodTerminatedListOf [ cfg:label ?y]. - ( ?y "_csptl" ) string:concatenation ?str } => { ?x cfg:label ?str }. - -{ ?x cfg:commaSeparatedListOf [ cfg:label ?y]. - ( ?y "_csl" ) string:concatenation ?str } => { ?x cfg:label ?str }. - -{ ?x cfg:CSLTail [ cfg:label ?y]. - ( ?y "_csptl_tail" ) string:concatenation ?str } => { ?x cfg:label ?str }. - -{ ?x cfg:CSLTail2 [ cfg:label ?y]. - ( ?y "_csl_tail" ) string:concatenation ?str } => { ?x cfg:label ?str }. - #ends