rdf-n3 3.1.1 → 3.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +148 -69
  3. data/UNLICENSE +1 -1
  4. data/VERSION +1 -1
  5. data/lib/rdf/n3.rb +8 -8
  6. data/lib/rdf/n3/algebra.rb +147 -68
  7. data/lib/rdf/n3/algebra/builtin.rb +79 -0
  8. data/lib/rdf/n3/algebra/formula.rb +355 -94
  9. data/lib/rdf/n3/algebra/list/append.rb +33 -4
  10. data/lib/rdf/n3/algebra/list/first.rb +24 -0
  11. data/lib/rdf/n3/algebra/list/in.rb +42 -3
  12. data/lib/rdf/n3/algebra/list/last.rb +17 -4
  13. data/lib/rdf/n3/algebra/list/length.rb +24 -0
  14. data/lib/rdf/n3/algebra/list/member.rb +39 -2
  15. data/lib/rdf/n3/algebra/list_operator.rb +83 -0
  16. data/lib/rdf/n3/algebra/log/conclusion.rb +57 -1
  17. data/lib/rdf/n3/algebra/log/conjunction.rb +28 -1
  18. data/lib/rdf/n3/algebra/log/content.rb +34 -0
  19. data/lib/rdf/n3/algebra/log/equal_to.rb +34 -0
  20. data/lib/rdf/n3/algebra/log/implies.rb +55 -30
  21. data/lib/rdf/n3/algebra/log/includes.rb +58 -1
  22. data/lib/rdf/n3/algebra/log/n3_string.rb +34 -0
  23. data/lib/rdf/n3/algebra/log/not_equal_to.rb +23 -0
  24. data/lib/rdf/n3/algebra/log/not_includes.rb +27 -0
  25. data/lib/rdf/n3/algebra/log/output_string.rb +40 -0
  26. data/lib/rdf/n3/algebra/log/parsed_as_n3.rb +36 -0
  27. data/lib/rdf/n3/algebra/log/semantics.rb +40 -0
  28. data/lib/rdf/n3/algebra/math/absolute_value.rb +36 -0
  29. data/lib/rdf/n3/algebra/math/acos.rb +26 -0
  30. data/lib/rdf/n3/algebra/math/acosh.rb +26 -0
  31. data/lib/rdf/n3/algebra/math/asin.rb +26 -0
  32. data/lib/rdf/n3/algebra/math/asinh.rb +26 -0
  33. data/lib/rdf/n3/algebra/math/atan.rb +26 -0
  34. data/lib/rdf/n3/algebra/math/atanh.rb +26 -0
  35. data/lib/rdf/n3/algebra/math/ceiling.rb +28 -0
  36. data/lib/rdf/n3/algebra/math/cos.rb +40 -0
  37. data/lib/rdf/n3/algebra/math/cosh.rb +38 -0
  38. data/lib/rdf/n3/algebra/math/difference.rb +34 -3
  39. data/lib/rdf/n3/algebra/math/equal_to.rb +54 -0
  40. data/lib/rdf/n3/algebra/math/exponentiation.rb +29 -3
  41. data/lib/rdf/n3/algebra/math/floor.rb +28 -0
  42. data/lib/rdf/n3/algebra/math/greater_than.rb +41 -0
  43. data/lib/rdf/n3/algebra/math/less_than.rb +41 -0
  44. data/lib/rdf/n3/algebra/math/negation.rb +31 -2
  45. data/lib/rdf/n3/algebra/math/not_equal_to.rb +25 -0
  46. data/lib/rdf/n3/algebra/math/not_greater_than.rb +25 -0
  47. data/lib/rdf/n3/algebra/math/not_less_than.rb +25 -0
  48. data/lib/rdf/n3/algebra/math/product.rb +14 -3
  49. data/lib/rdf/n3/algebra/math/quotient.rb +30 -3
  50. data/lib/rdf/n3/algebra/math/remainder.rb +29 -3
  51. data/lib/rdf/n3/algebra/math/rounded.rb +20 -3
  52. data/lib/rdf/n3/algebra/math/sin.rb +40 -0
  53. data/lib/rdf/n3/algebra/math/sinh.rb +38 -0
  54. data/lib/rdf/n3/algebra/math/sum.rb +35 -4
  55. data/lib/rdf/n3/algebra/math/tan.rb +40 -0
  56. data/lib/rdf/n3/algebra/math/tanh.rb +38 -0
  57. data/lib/rdf/n3/algebra/not_implemented.rb +13 -0
  58. data/lib/rdf/n3/algebra/resource_operator.rb +123 -0
  59. data/lib/rdf/n3/algebra/str/concatenation.rb +21 -3
  60. data/lib/rdf/n3/algebra/str/contains.rb +28 -4
  61. data/lib/rdf/n3/algebra/str/contains_ignoring_case.rb +33 -0
  62. data/lib/rdf/n3/algebra/str/ends_with.rb +33 -0
  63. data/lib/rdf/n3/algebra/str/equal_ignoring_case.rb +34 -0
  64. data/lib/rdf/n3/algebra/str/format.rb +12 -4
  65. data/lib/rdf/n3/algebra/str/greater_than.rb +38 -0
  66. data/lib/rdf/n3/algebra/str/less_than.rb +33 -0
  67. data/lib/rdf/n3/algebra/str/matches.rb +33 -5
  68. data/lib/rdf/n3/algebra/str/not_equal_ignoring_case.rb +17 -0
  69. data/lib/rdf/n3/algebra/str/not_greater_than.rb +17 -0
  70. data/lib/rdf/n3/algebra/str/not_less_than.rb +17 -0
  71. data/lib/rdf/n3/algebra/str/not_matches.rb +18 -0
  72. data/lib/rdf/n3/algebra/str/replace.rb +28 -5
  73. data/lib/rdf/n3/algebra/str/scrape.rb +31 -5
  74. data/lib/rdf/n3/algebra/str/starts_with.rb +33 -0
  75. data/lib/rdf/n3/algebra/time/day.rb +35 -0
  76. data/lib/rdf/n3/algebra/time/day_of_week.rb +27 -0
  77. data/lib/rdf/n3/algebra/time/gm_time.rb +29 -0
  78. data/lib/rdf/n3/algebra/time/hour.rb +35 -0
  79. data/lib/rdf/n3/algebra/time/in_seconds.rb +59 -0
  80. data/lib/rdf/n3/algebra/time/local_time.rb +29 -0
  81. data/lib/rdf/n3/algebra/time/minute.rb +35 -0
  82. data/lib/rdf/n3/algebra/time/month.rb +35 -0
  83. data/lib/rdf/n3/algebra/time/second.rb +35 -0
  84. data/lib/rdf/n3/algebra/time/timezone.rb +36 -0
  85. data/lib/rdf/n3/algebra/time/year.rb +29 -0
  86. data/lib/rdf/n3/extensions.rb +180 -21
  87. data/lib/rdf/n3/format.rb +65 -0
  88. data/lib/rdf/n3/list.rb +630 -0
  89. data/lib/rdf/n3/reader.rb +762 -485
  90. data/lib/rdf/n3/reasoner.rb +57 -68
  91. data/lib/rdf/n3/refinements.rb +178 -0
  92. data/lib/rdf/n3/repository.rb +332 -0
  93. data/lib/rdf/n3/terminals.rb +80 -0
  94. data/lib/rdf/n3/vocab.rb +35 -7
  95. data/lib/rdf/n3/writer.rb +208 -148
  96. metadata +110 -52
  97. data/AUTHORS +0 -1
  98. data/History.markdown +0 -99
  99. data/lib/rdf/n3/algebra/log/equalTo.rb +0 -7
  100. data/lib/rdf/n3/algebra/log/notEqualTo.rb +0 -7
  101. data/lib/rdf/n3/algebra/log/notIncludes.rb +0 -12
  102. data/lib/rdf/n3/algebra/log/outputString.rb +0 -7
  103. data/lib/rdf/n3/algebra/math/absoluteValue.rb +0 -9
  104. data/lib/rdf/n3/algebra/math/equalTo.rb +0 -9
  105. data/lib/rdf/n3/algebra/math/greaterThan.rb +0 -9
  106. data/lib/rdf/n3/algebra/math/integerQuotient.rb +0 -9
  107. data/lib/rdf/n3/algebra/math/lessThan.rb +0 -9
  108. data/lib/rdf/n3/algebra/math/memberCount.rb +0 -9
  109. data/lib/rdf/n3/algebra/math/notEqualTo.rb +0 -9
  110. data/lib/rdf/n3/algebra/math/notGreaterThan.rb +0 -9
  111. data/lib/rdf/n3/algebra/math/notLessThan.rb +0 -9
  112. data/lib/rdf/n3/algebra/str/containsIgnoringCase.rb +0 -9
  113. data/lib/rdf/n3/algebra/str/endsWith.rb +0 -9
  114. data/lib/rdf/n3/algebra/str/equalIgnoringCase.rb +0 -9
  115. data/lib/rdf/n3/algebra/str/greaterThan.rb +0 -9
  116. data/lib/rdf/n3/algebra/str/lessThan.rb +0 -9
  117. data/lib/rdf/n3/algebra/str/notEqualIgnoringCase.rb +0 -9
  118. data/lib/rdf/n3/algebra/str/notGreaterThan.rb +0 -9
  119. data/lib/rdf/n3/algebra/str/notLessThan.rb +0 -9
  120. data/lib/rdf/n3/algebra/str/notMatches.rb +0 -9
  121. data/lib/rdf/n3/algebra/str/startsWith.rb +0 -56
  122. data/lib/rdf/n3/patches/array_hacks.rb +0 -53
  123. data/lib/rdf/n3/reader/meta.rb +0 -641
  124. data/lib/rdf/n3/reader/parser.rb +0 -239
@@ -1,12 +0,0 @@
1
- module RDF::N3::Algebra::Log
2
- ##
3
- # The object formula is NOT a subset of subject. True iff log:includes is false. The converse of log:includes.
4
- # (Understood natively by cwm. The subject formula may contain variables.)
5
- #
6
- # (In cwm, variables must of course end up getting bound before the log:include test can be done, or an infinite result set would result)
7
- #
8
- # Related: See includes
9
- class NotIncludes < SPARQL::Algebra::Operator::Binary
10
- NAME = :logNotIncludes
11
- end
12
- end
@@ -1,7 +0,0 @@
1
- module RDF::N3::Algebra::Log
2
- ##
3
- # The subject is a key and the object is a string, where the strings are to be output in the order of the keys.
4
- class OutputString < SPARQL::Algebra::Operator::Binary
5
- NAME = :logOutputString
6
- end
7
- end
@@ -1,9 +0,0 @@
1
- module RDF::N3::Algebra::Math
2
- ##
3
- # The object is calulated as the absolute value of the subject.
4
- class AbsoluteValue < SPARQL::Algebra::Operator::Binary
5
- include RDF::Util::Logger
6
-
7
- NAME = :mathAbsoluteValue
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module RDF::N3::Algebra::Math
2
- ##
3
- # True iff the subject is a string representation of a number which is EQUAL TO a number of which the object is a string representation.
4
- class EqualTo < SPARQL::Algebra::Operator::Binary
5
- include RDF::Util::Logger
6
-
7
- NAME = :mathEqualTo
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module RDF::N3::Algebra::Math
2
- ##
3
- # True iff the subject is a string representation of a number which is greater than the number of which the object is a string representation.
4
- class GreaterThan < SPARQL::Algebra::Operator::Binary
5
- include RDF::Util::Logger
6
-
7
- NAME = :mathGreaterThan
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module RDF::N3::Algebra::Math
2
- ##
3
- # The subject is a pair of integer numbers. The object is calculated by dividing the first number of the pair by the second, ignoring remainder.
4
- class IntegerQuotient < SPARQL::Algebra::Operator::Binary
5
- include RDF::Util::Logger
6
-
7
- NAME = :mathIntegerQuotient
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module RDF::N3::Algebra::Math
2
- ##
3
- # True iff the subject is a string representation of a number which is LESS than a number of which the object is a string representation.
4
- class LessThan < SPARQL::Algebra::Operator::Binary
5
- include RDF::Util::Logger
6
-
7
- NAME = :mathLessThan
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module RDF::N3::Algebra::Math
2
- ##
3
- # The number of items in a list. The subject is a list, the object is calculated as the number of members.
4
- class MemberCount < SPARQL::Algebra::Operator::Binary
5
- include RDF::Util::Logger
6
-
7
- NAME = :mathMemberCount
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module RDF::N3::Algebra::Math
2
- ##
3
- # True iff the subject is a string representation of a number which is NOT EQUAL to a number of which the object is a string representation.
4
- class NotEqualTo < SPARQL::Algebra::Operator::Binary
5
- include RDF::Util::Logger
6
-
7
- NAME = :mathNotEqualTo
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module RDF::N3::Algebra::Math
2
- ##
3
- # True iff the subject is a string representation of a number which is NOT greater than the number of which the object is a string representation.
4
- class NotGreaterThan < SPARQL::Algebra::Operator::Binary
5
- include RDF::Util::Logger
6
-
7
- NAME = :mathNotGreaterThan
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module RDF::N3::Algebra::Math
2
- ##
3
- # True iff the subject is a string representation of a number which is NOT LESS than a number of which the object is a string representation.
4
- class NotLessThan < SPARQL::Algebra::Operator::Binary
5
- include RDF::Util::Logger
6
-
7
- NAME = :mathNotLessThan
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module RDF::N3::Algebra::Str
2
- ##
3
- # True iff the subject string contains the object string, with the comparison done ignoring the difference between upper case and lower case characters.
4
- class ContainsIgnoringCase < SPARQL::Algebra::Operator::Binary
5
- include RDF::Util::Logger
6
-
7
- NAME = :strContainsIgnoringCase
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module RDF::N3::Algebra::Str
2
- ##
3
- # True iff the subject string ends with the object string.
4
- class EndsWith < SPARQL::Algebra::Operator::Binary
5
- include RDF::Util::Logger
6
-
7
- NAME = :strEndsWith
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module RDF::N3::Algebra::Str
2
- ##
3
- # True iff the subject string is the same as object string ignoring differences between upper and lower case.
4
- class EqualIgnoringCase < SPARQL::Algebra::Operator::Binary
5
- include RDF::Util::Logger
6
-
7
- NAME = :strEqualIgnoringCase
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module RDF::N3::Algebra::Str
2
- ##
3
- # True iff the string is greater than the object when ordered according to Unicode(tm) code order
4
- class GreaterThan < SPARQL::Algebra::Operator::Binary
5
- include RDF::Util::Logger
6
-
7
- NAME = :strGreaterThan
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module RDF::N3::Algebra::Str
2
- ##
3
- # True iff the string is less than the object when ordered according to Unicode(tm) code order.
4
- class LessThan < SPARQL::Algebra::Operator::Binary
5
- include RDF::Util::Logger
6
-
7
- NAME = :strLessThan
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module RDF::N3::Algebra::Str
2
- ##
3
- # True iff the subject string is the NOT same as object string ignoring differences between upper and lower case.
4
- class NotEqualIgnoringCase < SPARQL::Algebra::Operator::Binary
5
- include RDF::Util::Logger
6
-
7
- NAME = :strNotEqualIgnoringCase
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module RDF::N3::Algebra::Str
2
- ##
3
- # True iff the string is NOT greater than the object when ordered according to Unicode(tm) code order.
4
- class NotGreaterThan < SPARQL::Algebra::Operator::Binary
5
- include RDF::Util::Logger
6
-
7
- NAME = :strNotGreaterThan
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module RDF::N3::Algebra::Str
2
- ##
3
- # True iff the string is NOT less than the object when ordered according to Unicode(tm) code order.
4
- class NotLessThan < SPARQL::Algebra::Operator::Binary
5
- include RDF::Util::Logger
6
-
7
- NAME = :strNotLessThan
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module RDF::N3::Algebra::Str
2
- ##
3
- # The subject string; the object is is a regular expression in the perl, python style. It is true iff the string does NOT match the regexp.
4
- class NotMatches < SPARQL::Algebra::Operator::Binary
5
- include RDF::Util::Logger
6
-
7
- NAME = :strNotMatches
8
- end
9
- end
@@ -1,56 +0,0 @@
1
- module RDF::N3::Algebra::Str
2
- ##
3
- # True iff the subject string starts with the object string.
4
- class StartsWith < SPARQL::Algebra::Operator::Binary
5
- include SPARQL::Algebra::Query
6
- include SPARQL::Algebra::Update
7
- include RDF::Enumerable
8
- include RDF::Util::Logger
9
-
10
- NAME = :strStartsWith
11
-
12
- ##
13
- # The string:startsWith operator corresponds to the XPath fn:starts-with function. The arguments must be argument compatible otherwise an error is raised.
14
- #
15
- # For constant inputs that evaulate to true, the original solutions are returned.
16
- #
17
- # For constant inputs that evaluate to false, the empty solution set is returned. XXX
18
- #
19
- # Otherwise, for variable operands, it binds matching variables to the solution set.
20
- #
21
- # @param [RDF::Queryable] queryable
22
- # @param [RDF::Query::Solutions] solutions
23
- # @return [RDF::Query::Solutions]
24
- # @raise [TypeError] if operands are not compatible
25
- def execute(queryable, solutions:, **options)
26
- log_debug {"strStartsWith #{operands.to_sxp}"}
27
- @solutions = solutions.filter do |solution|
28
- left, right = operands.map {|op| op.evaluate(solution.bindings)}
29
- if !left.compatible?(right)
30
- log_debug {"(strStartsWith incompatible operands #{[left, right].to_sxp})"}
31
- false
32
- elsif !left.to_s.start_with?(right.to_s)
33
- log_debug {"(strStartsWith false #{[left, right].to_sxp})"}
34
- false
35
- else
36
- log_debug {"(strStartsWith true #{[left, right].to_sxp})"}
37
- true
38
- end
39
- end
40
- end
41
-
42
- ##
43
- # Does not yield statements.
44
- #
45
- # @yield [statement]
46
- # each matching statement
47
- # @yieldparam [RDF::Statement] solution
48
- # @yieldreturn [void] ignored
49
- def each(&block)
50
- end
51
-
52
- # Graph name associated with this operation, using the name of the parent
53
- # @return [RDF::Resource]
54
- def graph_name; parent.graph_name; end
55
- end
56
- end
@@ -1,53 +0,0 @@
1
- class Array
2
- # http://wiki.rubygarden.org/Ruby/page/show/ArrayPermute
3
- # Permute an array, and call a block for each permutation
4
- # Author: Paul Battley
5
- def permute(prefixed=[])
6
- if (length < 2)
7
- # there are no elements left to permute
8
- yield(prefixed + self)
9
- else
10
- # recursively permute the remaining elements
11
- each_with_index do |e, i|
12
- (self[0,i]+self[(i+1)..-1]).permute(prefixed+[e]) { |a| yield a }
13
- end
14
- end
15
- end unless Array.method_defined?(:permute)
16
-
17
- # Converts the array to a comma-separated sentence where the last element is joined by the connector word. Options:
18
- # * <tt>:words_connector</tt> - The sign or word used to join the elements in arrays with two or more elements (default: ", ")
19
- # * <tt>:two_words_connector</tt> - The sign or word used to join the elements in arrays with two elements (default: " and ")
20
- # * <tt>:last_word_connector</tt> - The sign or word used to join the last element in arrays with three or more elements (default: ", and ")
21
- def to_sentence(**options)
22
- default_words_connector = ", "
23
- default_two_words_connector = " and "
24
- default_last_word_connector = ", and "
25
-
26
- # Try to emulate to_senteces previous to 2.3
27
- if options.has_key?(:connector) || options.has_key?(:skip_last_comma)
28
- ::ActiveSupport::Deprecation.warn(":connector has been deprecated. Use :words_connector instead", caller) if options.has_key? :connector
29
- ::ActiveSupport::Deprecation.warn(":skip_last_comma has been deprecated. Use :last_word_connector instead", caller) if options.has_key? :skip_last_comma
30
-
31
- skip_last_comma = options.delete :skip_last_comma
32
- if connector = options.delete(:connector)
33
- options[:last_word_connector] ||= skip_last_comma ? connector : ", #{connector}"
34
- else
35
- options[:last_word_connector] ||= skip_last_comma ? default_two_words_connector : default_last_word_connector
36
- end
37
- end
38
-
39
- # options.assert_valid_keys(:words_connector, :two_words_connector, :last_word_connector, :locale)
40
- options = {words_connector: default_words_connector, two_words_connector: default_two_words_connector, last_word_connector: default_last_word_connector}.merge(options)
41
-
42
- case length
43
- when 0
44
- ""
45
- when 1
46
- self[0].to_s
47
- when 2
48
- "#{self[0]}#{options[:two_words_connector]}#{self[1]}"
49
- else
50
- "#{self[0...-1].join(options[:words_connector])}#{options[:last_word_connector]}#{self[-1]}"
51
- end
52
- end unless Array.method_defined?(:to_sentence)
53
- end
@@ -1,641 +0,0 @@
1
- # coding: utf-8
2
- # This file is automatically generated by script/build_meta
3
- # Branch and Regexp tables derived from http://www.w3.org/2000/10/swap/grammar/n3-selectors.n3
4
- module RDF::N3::Meta
5
- BRANCHES = {
6
- :"_:_g0" => {
7
- "." => [],
8
- ":" => [:"http://www.w3.org/2000/10/swap/grammar/n3#symbol",
9
- :"_:_g5"],
10
- "<" => [:"http://www.w3.org/2000/10/swap/grammar/n3#symbol",
11
- :"_:_g5"],
12
- "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#symbol",
13
- :"_:_g5"],
14
- "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#symbol",
15
- :"_:_g5"],
16
- "}" => [],
17
- },
18
- :"_:_g1" => {
19
- "." => [],
20
- ":" => [:"http://www.w3.org/2000/10/swap/grammar/n3#symbol",
21
- :"_:_g4"],
22
- "<" => [:"http://www.w3.org/2000/10/swap/grammar/n3#symbol",
23
- :"_:_g4"],
24
- "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#symbol",
25
- :"_:_g4"],
26
- "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#symbol",
27
- :"_:_g4"],
28
- "}" => [],
29
- },
30
- :"_:_g2" => {
31
- "." => [],
32
- "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#barename",
33
- :"_:_g3"],
34
- "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#barename",
35
- :"_:_g3"],
36
- "}" => [],
37
- },
38
- :"_:_g3" => {
39
- "," => [",",
40
- :"http://www.w3.org/2000/10/swap/grammar/n3#barename",
41
- :"_:_g3"],
42
- "." => [],
43
- "}" => [],
44
- },
45
- :"_:_g4" => {
46
- "," => [",",
47
- :"http://www.w3.org/2000/10/swap/grammar/n3#symbol",
48
- :"_:_g4"],
49
- "." => [],
50
- "}" => [],
51
- },
52
- :"_:_g5" => {
53
- "," => [",",
54
- :"http://www.w3.org/2000/10/swap/grammar/n3#symbol",
55
- :"_:_g5"],
56
- "." => [],
57
- "}" => [],
58
- },
59
- :"http://www.w3.org/2000/10/swap/grammar/n3#boolean" => {
60
- "@false" => ["@false"],
61
- "@true" => ["@true"],
62
- },
63
- :"http://www.w3.org/2000/10/swap/grammar/n3#declaration" => {
64
- "@base" => ["@base",
65
- :"http://www.w3.org/2000/10/swap/grammar/n3#explicituri"],
66
- "@keywords" => ["@keywords",
67
- :"_:_g2"],
68
- "@prefix" => ["@prefix",
69
- :"http://www.w3.org/2000/10/swap/grammar/n3#prefix",
70
- :"http://www.w3.org/2000/10/swap/grammar/n3#explicituri"],
71
- },
72
- :"http://www.w3.org/2000/10/swap/grammar/n3#document" => {
73
- "\"" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
74
- :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
75
- "(" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
76
- :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
77
- "+" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
78
- :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
79
- "-" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
80
- :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
81
- "0" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
82
- :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
83
- ":" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
84
- :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
85
- "<" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
86
- :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
87
- "?" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
88
- :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
89
- "@EOFDUMMY" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
90
- :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
91
- "@base" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
92
- :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
93
- "@false" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
94
- :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
95
- "@forAll" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
96
- :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
97
- "@forSome" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
98
- :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
99
- "@keywords" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
100
- :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
101
- "@prefix" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
102
- :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
103
- "@true" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
104
- :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
105
- "[" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
106
- :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
107
- "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
108
- :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
109
- "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
110
- :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
111
- "{" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional",
112
- :"http://www.w3.org/2000/10/swap/grammar/bnf#eof"],
113
- },
114
- :"http://www.w3.org/2000/10/swap/grammar/n3#dtlang" => {
115
- "!" => [],
116
- "\"" => [],
117
- "(" => [],
118
- ")" => [],
119
- "+" => [],
120
- "," => [],
121
- "-" => [],
122
- "." => [],
123
- "0" => [],
124
- ":" => [],
125
- ";" => [],
126
- "<" => [],
127
- "<=" => [],
128
- "=" => [],
129
- "=>" => [],
130
- "?" => [],
131
- "@" => ["@",
132
- :"http://www.w3.org/2000/10/swap/grammar/n3#langcode"],
133
- "@a" => [],
134
- "@false" => [],
135
- "@has" => [],
136
- "@is" => [],
137
- "@of" => [],
138
- "@true" => [],
139
- "[" => [],
140
- "]" => [],
141
- "^" => [],
142
- "^^" => ["^^",
143
- :"http://www.w3.org/2000/10/swap/grammar/n3#symbol"],
144
- "_" => [],
145
- "a" => [],
146
- "{" => [],
147
- "}" => [],
148
- },
149
- :"http://www.w3.org/2000/10/swap/grammar/n3#existential" => {
150
- "@forSome" => ["@forSome",
151
- :"_:_g1"],
152
- },
153
- :"http://www.w3.org/2000/10/swap/grammar/n3#expression" => {
154
- "\"" => [:"http://www.w3.org/2000/10/swap/grammar/n3#pathitem",
155
- :"http://www.w3.org/2000/10/swap/grammar/n3#pathtail"],
156
- "(" => [:"http://www.w3.org/2000/10/swap/grammar/n3#pathitem",
157
- :"http://www.w3.org/2000/10/swap/grammar/n3#pathtail"],
158
- "+" => [:"http://www.w3.org/2000/10/swap/grammar/n3#pathitem",
159
- :"http://www.w3.org/2000/10/swap/grammar/n3#pathtail"],
160
- "-" => [:"http://www.w3.org/2000/10/swap/grammar/n3#pathitem",
161
- :"http://www.w3.org/2000/10/swap/grammar/n3#pathtail"],
162
- "0" => [:"http://www.w3.org/2000/10/swap/grammar/n3#pathitem",
163
- :"http://www.w3.org/2000/10/swap/grammar/n3#pathtail"],
164
- ":" => [:"http://www.w3.org/2000/10/swap/grammar/n3#pathitem",
165
- :"http://www.w3.org/2000/10/swap/grammar/n3#pathtail"],
166
- "<" => [:"http://www.w3.org/2000/10/swap/grammar/n3#pathitem",
167
- :"http://www.w3.org/2000/10/swap/grammar/n3#pathtail"],
168
- "?" => [:"http://www.w3.org/2000/10/swap/grammar/n3#pathitem",
169
- :"http://www.w3.org/2000/10/swap/grammar/n3#pathtail"],
170
- "@false" => [:"http://www.w3.org/2000/10/swap/grammar/n3#pathitem",
171
- :"http://www.w3.org/2000/10/swap/grammar/n3#pathtail"],
172
- "@true" => [:"http://www.w3.org/2000/10/swap/grammar/n3#pathitem",
173
- :"http://www.w3.org/2000/10/swap/grammar/n3#pathtail"],
174
- "[" => [:"http://www.w3.org/2000/10/swap/grammar/n3#pathitem",
175
- :"http://www.w3.org/2000/10/swap/grammar/n3#pathtail"],
176
- "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#pathitem",
177
- :"http://www.w3.org/2000/10/swap/grammar/n3#pathtail"],
178
- "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#pathitem",
179
- :"http://www.w3.org/2000/10/swap/grammar/n3#pathtail"],
180
- "{" => [:"http://www.w3.org/2000/10/swap/grammar/n3#pathitem",
181
- :"http://www.w3.org/2000/10/swap/grammar/n3#pathtail"],
182
- },
183
- :"http://www.w3.org/2000/10/swap/grammar/n3#formulacontent" => {
184
- "\"" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
185
- "(" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
186
- "+" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
187
- "-" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
188
- "0" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
189
- ":" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
190
- "<" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
191
- "?" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
192
- "@base" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
193
- "@false" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
194
- "@forAll" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
195
- "@forSome" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
196
- "@keywords" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
197
- "@prefix" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
198
- "@true" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
199
- "[" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
200
- "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
201
- "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
202
- "{" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
203
- "}" => [],
204
- },
205
- :"http://www.w3.org/2000/10/swap/grammar/n3#literal" => {
206
- "\"" => [:"http://www.w3.org/2000/10/swap/grammar/n3#string",
207
- :"http://www.w3.org/2000/10/swap/grammar/n3#dtlang"],
208
- },
209
- :"http://www.w3.org/2000/10/swap/grammar/n3#object" => {
210
- "\"" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
211
- "(" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
212
- "+" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
213
- "-" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
214
- "0" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
215
- ":" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
216
- "<" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
217
- "?" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
218
- "@false" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
219
- "@true" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
220
- "[" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
221
- "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
222
- "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
223
- "{" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
224
- },
225
- :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail" => {
226
- "," => [",",
227
- :"http://www.w3.org/2000/10/swap/grammar/n3#object",
228
- :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail"],
229
- "." => [],
230
- ";" => [],
231
- "]" => [],
232
- "}" => [],
233
- },
234
- :"http://www.w3.org/2000/10/swap/grammar/n3#pathitem" => {
235
- "\"" => [:"http://www.w3.org/2000/10/swap/grammar/n3#literal"],
236
- "(" => ["(",
237
- :"http://www.w3.org/2000/10/swap/grammar/n3#pathlist",
238
- ")"],
239
- "+" => [:"http://www.w3.org/2000/10/swap/grammar/n3#numericliteral"],
240
- "-" => [:"http://www.w3.org/2000/10/swap/grammar/n3#numericliteral"],
241
- "0" => [:"http://www.w3.org/2000/10/swap/grammar/n3#numericliteral"],
242
- ":" => [:"http://www.w3.org/2000/10/swap/grammar/n3#symbol"],
243
- "<" => [:"http://www.w3.org/2000/10/swap/grammar/n3#symbol"],
244
- "?" => [:"http://www.w3.org/2000/10/swap/grammar/n3#quickvariable"],
245
- "@false" => [:"http://www.w3.org/2000/10/swap/grammar/n3#boolean"],
246
- "@true" => [:"http://www.w3.org/2000/10/swap/grammar/n3#boolean"],
247
- "[" => ["[",
248
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist",
249
- "]"],
250
- "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#symbol"],
251
- "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#symbol"],
252
- "{" => ["{",
253
- :"http://www.w3.org/2000/10/swap/grammar/n3#formulacontent",
254
- "}"],
255
- },
256
- :"http://www.w3.org/2000/10/swap/grammar/n3#pathlist" => {
257
- "\"" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression",
258
- :"http://www.w3.org/2000/10/swap/grammar/n3#pathlist"],
259
- "(" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression",
260
- :"http://www.w3.org/2000/10/swap/grammar/n3#pathlist"],
261
- ")" => [],
262
- "+" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression",
263
- :"http://www.w3.org/2000/10/swap/grammar/n3#pathlist"],
264
- "-" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression",
265
- :"http://www.w3.org/2000/10/swap/grammar/n3#pathlist"],
266
- "0" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression",
267
- :"http://www.w3.org/2000/10/swap/grammar/n3#pathlist"],
268
- ":" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression",
269
- :"http://www.w3.org/2000/10/swap/grammar/n3#pathlist"],
270
- "<" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression",
271
- :"http://www.w3.org/2000/10/swap/grammar/n3#pathlist"],
272
- "?" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression",
273
- :"http://www.w3.org/2000/10/swap/grammar/n3#pathlist"],
274
- "@false" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression",
275
- :"http://www.w3.org/2000/10/swap/grammar/n3#pathlist"],
276
- "@true" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression",
277
- :"http://www.w3.org/2000/10/swap/grammar/n3#pathlist"],
278
- "[" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression",
279
- :"http://www.w3.org/2000/10/swap/grammar/n3#pathlist"],
280
- "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression",
281
- :"http://www.w3.org/2000/10/swap/grammar/n3#pathlist"],
282
- "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression",
283
- :"http://www.w3.org/2000/10/swap/grammar/n3#pathlist"],
284
- "{" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression",
285
- :"http://www.w3.org/2000/10/swap/grammar/n3#pathlist"],
286
- },
287
- :"http://www.w3.org/2000/10/swap/grammar/n3#pathtail" => {
288
- "!" => ["!",
289
- :"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
290
- "\"" => [],
291
- "(" => [],
292
- ")" => [],
293
- "+" => [],
294
- "," => [],
295
- "-" => [],
296
- "." => [],
297
- "0" => [],
298
- ":" => [],
299
- ";" => [],
300
- "<" => [],
301
- "<=" => [],
302
- "=" => [],
303
- "=>" => [],
304
- "?" => [],
305
- "@a" => [],
306
- "@false" => [],
307
- "@has" => [],
308
- "@is" => [],
309
- "@of" => [],
310
- "@true" => [],
311
- "[" => [],
312
- "]" => [],
313
- "^" => ["^",
314
- :"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
315
- "_" => [],
316
- "a" => [],
317
- "{" => [],
318
- "}" => [],
319
- },
320
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist" => {
321
- "\"" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
322
- :"http://www.w3.org/2000/10/swap/grammar/n3#object",
323
- :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
324
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
325
- "(" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
326
- :"http://www.w3.org/2000/10/swap/grammar/n3#object",
327
- :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
328
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
329
- "+" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
330
- :"http://www.w3.org/2000/10/swap/grammar/n3#object",
331
- :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
332
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
333
- "-" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
334
- :"http://www.w3.org/2000/10/swap/grammar/n3#object",
335
- :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
336
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
337
- "." => [],
338
- "0" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
339
- :"http://www.w3.org/2000/10/swap/grammar/n3#object",
340
- :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
341
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
342
- ":" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
343
- :"http://www.w3.org/2000/10/swap/grammar/n3#object",
344
- :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
345
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
346
- "<" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
347
- :"http://www.w3.org/2000/10/swap/grammar/n3#object",
348
- :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
349
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
350
- "<=" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
351
- :"http://www.w3.org/2000/10/swap/grammar/n3#object",
352
- :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
353
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
354
- "=" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
355
- :"http://www.w3.org/2000/10/swap/grammar/n3#object",
356
- :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
357
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
358
- "=>" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
359
- :"http://www.w3.org/2000/10/swap/grammar/n3#object",
360
- :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
361
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
362
- "?" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
363
- :"http://www.w3.org/2000/10/swap/grammar/n3#object",
364
- :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
365
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
366
- "@a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
367
- :"http://www.w3.org/2000/10/swap/grammar/n3#object",
368
- :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
369
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
370
- "@false" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
371
- :"http://www.w3.org/2000/10/swap/grammar/n3#object",
372
- :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
373
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
374
- "@has" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
375
- :"http://www.w3.org/2000/10/swap/grammar/n3#object",
376
- :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
377
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
378
- "@is" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
379
- :"http://www.w3.org/2000/10/swap/grammar/n3#object",
380
- :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
381
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
382
- "@true" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
383
- :"http://www.w3.org/2000/10/swap/grammar/n3#object",
384
- :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
385
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
386
- "[" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
387
- :"http://www.w3.org/2000/10/swap/grammar/n3#object",
388
- :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
389
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
390
- "]" => [],
391
- "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
392
- :"http://www.w3.org/2000/10/swap/grammar/n3#object",
393
- :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
394
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
395
- "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
396
- :"http://www.w3.org/2000/10/swap/grammar/n3#object",
397
- :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
398
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
399
- "{" => [:"http://www.w3.org/2000/10/swap/grammar/n3#verb",
400
- :"http://www.w3.org/2000/10/swap/grammar/n3#object",
401
- :"http://www.w3.org/2000/10/swap/grammar/n3#objecttail",
402
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail"],
403
- "}" => [],
404
- },
405
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylisttail" => {
406
- "." => [],
407
- ";" => [";",
408
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist"],
409
- "]" => [],
410
- "}" => [],
411
- },
412
- :"http://www.w3.org/2000/10/swap/grammar/n3#simpleStatement" => {
413
- "\"" => [:"http://www.w3.org/2000/10/swap/grammar/n3#subject",
414
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist"],
415
- "(" => [:"http://www.w3.org/2000/10/swap/grammar/n3#subject",
416
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist"],
417
- "+" => [:"http://www.w3.org/2000/10/swap/grammar/n3#subject",
418
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist"],
419
- "-" => [:"http://www.w3.org/2000/10/swap/grammar/n3#subject",
420
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist"],
421
- "0" => [:"http://www.w3.org/2000/10/swap/grammar/n3#subject",
422
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist"],
423
- ":" => [:"http://www.w3.org/2000/10/swap/grammar/n3#subject",
424
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist"],
425
- "<" => [:"http://www.w3.org/2000/10/swap/grammar/n3#subject",
426
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist"],
427
- "?" => [:"http://www.w3.org/2000/10/swap/grammar/n3#subject",
428
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist"],
429
- "@false" => [:"http://www.w3.org/2000/10/swap/grammar/n3#subject",
430
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist"],
431
- "@true" => [:"http://www.w3.org/2000/10/swap/grammar/n3#subject",
432
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist"],
433
- "[" => [:"http://www.w3.org/2000/10/swap/grammar/n3#subject",
434
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist"],
435
- "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#subject",
436
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist"],
437
- "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#subject",
438
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist"],
439
- "{" => [:"http://www.w3.org/2000/10/swap/grammar/n3#subject",
440
- :"http://www.w3.org/2000/10/swap/grammar/n3#propertylist"],
441
- },
442
- :"http://www.w3.org/2000/10/swap/grammar/n3#statement" => {
443
- "\"" => [:"http://www.w3.org/2000/10/swap/grammar/n3#simpleStatement"],
444
- "(" => [:"http://www.w3.org/2000/10/swap/grammar/n3#simpleStatement"],
445
- "+" => [:"http://www.w3.org/2000/10/swap/grammar/n3#simpleStatement"],
446
- "-" => [:"http://www.w3.org/2000/10/swap/grammar/n3#simpleStatement"],
447
- "0" => [:"http://www.w3.org/2000/10/swap/grammar/n3#simpleStatement"],
448
- ":" => [:"http://www.w3.org/2000/10/swap/grammar/n3#simpleStatement"],
449
- "<" => [:"http://www.w3.org/2000/10/swap/grammar/n3#simpleStatement"],
450
- "?" => [:"http://www.w3.org/2000/10/swap/grammar/n3#simpleStatement"],
451
- "@base" => [:"http://www.w3.org/2000/10/swap/grammar/n3#declaration"],
452
- "@false" => [:"http://www.w3.org/2000/10/swap/grammar/n3#simpleStatement"],
453
- "@forAll" => [:"http://www.w3.org/2000/10/swap/grammar/n3#universal"],
454
- "@forSome" => [:"http://www.w3.org/2000/10/swap/grammar/n3#existential"],
455
- "@keywords" => [:"http://www.w3.org/2000/10/swap/grammar/n3#declaration"],
456
- "@prefix" => [:"http://www.w3.org/2000/10/swap/grammar/n3#declaration"],
457
- "@true" => [:"http://www.w3.org/2000/10/swap/grammar/n3#simpleStatement"],
458
- "[" => [:"http://www.w3.org/2000/10/swap/grammar/n3#simpleStatement"],
459
- "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#simpleStatement"],
460
- "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#simpleStatement"],
461
- "{" => [:"http://www.w3.org/2000/10/swap/grammar/n3#simpleStatement"],
462
- },
463
- :"http://www.w3.org/2000/10/swap/grammar/n3#statementlist" => {
464
- "\"" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
465
- :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
466
- "(" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
467
- :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
468
- "+" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
469
- :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
470
- "-" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
471
- :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
472
- "0" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
473
- :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
474
- ":" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
475
- :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
476
- "<" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
477
- :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
478
- "?" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
479
- :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
480
- "@base" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
481
- :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
482
- "@false" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
483
- :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
484
- "@forAll" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
485
- :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
486
- "@forSome" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
487
- :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
488
- "@keywords" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
489
- :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
490
- "@prefix" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
491
- :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
492
- "@true" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
493
- :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
494
- "[" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
495
- :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
496
- "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
497
- :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
498
- "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
499
- :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
500
- "{" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
501
- :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail"],
502
- "}" => [],
503
- },
504
- :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional" => {
505
- "\"" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
506
- ".",
507
- :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
508
- "(" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
509
- ".",
510
- :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
511
- "+" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
512
- ".",
513
- :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
514
- "-" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
515
- ".",
516
- :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
517
- "0" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
518
- ".",
519
- :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
520
- ":" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
521
- ".",
522
- :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
523
- "<" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
524
- ".",
525
- :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
526
- "?" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
527
- ".",
528
- :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
529
- "@EOFDUMMY" => [],
530
- "@base" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
531
- ".",
532
- :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
533
- "@false" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
534
- ".",
535
- :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
536
- "@forAll" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
537
- ".",
538
- :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
539
- "@forSome" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
540
- ".",
541
- :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
542
- "@keywords" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
543
- ".",
544
- :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
545
- "@prefix" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
546
- ".",
547
- :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
548
- "@true" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
549
- ".",
550
- :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
551
- "[" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
552
- ".",
553
- :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
554
- "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
555
- ".",
556
- :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
557
- "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
558
- ".",
559
- :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
560
- "{" => [:"http://www.w3.org/2000/10/swap/grammar/n3#statement",
561
- ".",
562
- :"http://www.w3.org/2000/10/swap/grammar/n3#statements_optional"],
563
- },
564
- :"http://www.w3.org/2000/10/swap/grammar/n3#statementtail" => {
565
- "." => [".",
566
- :"http://www.w3.org/2000/10/swap/grammar/n3#statementlist"],
567
- "}" => [],
568
- },
569
- :"http://www.w3.org/2000/10/swap/grammar/n3#subject" => {
570
- "\"" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
571
- "(" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
572
- "+" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
573
- "-" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
574
- "0" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
575
- ":" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
576
- "<" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
577
- "?" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
578
- "@false" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
579
- "@true" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
580
- "[" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
581
- "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
582
- "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
583
- "{" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
584
- },
585
- :"http://www.w3.org/2000/10/swap/grammar/n3#symbol" => {
586
- ":" => [:"http://www.w3.org/2000/10/swap/grammar/n3#qname"],
587
- "<" => [:"http://www.w3.org/2000/10/swap/grammar/n3#explicituri"],
588
- "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#qname"],
589
- "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#qname"],
590
- },
591
- :"http://www.w3.org/2000/10/swap/grammar/n3#universal" => {
592
- "@forAll" => ["@forAll",
593
- :"_:_g0"],
594
- },
595
- :"http://www.w3.org/2000/10/swap/grammar/n3#verb" => {
596
- "\"" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
597
- "(" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
598
- "+" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
599
- "-" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
600
- "0" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
601
- ":" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
602
- "<" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
603
- "<=" => ["<="],
604
- "=" => ["="],
605
- "=>" => ["=>"],
606
- "?" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
607
- "@a" => ["@a"],
608
- "@false" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
609
- "@has" => ["@has",
610
- :"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
611
- "@is" => ["@is",
612
- :"http://www.w3.org/2000/10/swap/grammar/n3#expression",
613
- "@of"],
614
- "@true" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
615
- "[" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
616
- "_" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
617
- "a" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
618
- "{" => [:"http://www.w3.org/2000/10/swap/grammar/n3#expression"],
619
- },
620
- }
621
-
622
- if RUBY_VERSION >= "1.9.0"
623
- BARENAME_START = "A-Z_a-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd\u{10000}-\u{effff}"
624
- BARENAME_TAIL = "0-9#{BARENAME_START}\u00b7\u0300-\u036f\u203f-\u2040\\-"
625
- else
626
- BARENAME_START = "A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\xff"
627
- BARENAME_TAIL = "0-9#{BARENAME_START}\xb7\\-"
628
- end
629
- REGEXPS = {
630
- :"http://www.w3.org/2000/10/swap/grammar/n3#barename" => Regexp.compile(%(^[#{BARENAME_START}][#{BARENAME_TAIL}]*)),
631
- :"http://www.w3.org/2000/10/swap/grammar/n3#explicituri" => Regexp.compile("^<[^>]*>"),
632
- :"http://www.w3.org/2000/10/swap/grammar/n3#langcode" => Regexp.compile("^[a-zA-Z]+(-[a-zA-Z0-9]+)*"),
633
- :"http://www.w3.org/2000/10/swap/grammar/n3#prefix" => Regexp.compile(%(^([#{BARENAME_START}][#{BARENAME_TAIL}]*)?:)),
634
- :"http://www.w3.org/2000/10/swap/grammar/n3#qname" => Regexp.compile(%(^(([#{BARENAME_START}][#{BARENAME_TAIL}]*)?:)?([#{BARENAME_START}][#{BARENAME_TAIL}]*)?)),
635
- :"http://www.w3.org/2000/10/swap/grammar/n3#quickvariable" => Regexp.compile(%(^\\?[#{BARENAME_START}][#{BARENAME_TAIL}]*)),
636
- :"http://www.w3.org/2000/10/swap/grammar/n3#string" => Regexp.compile("(\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\")"),
637
-
638
- # Hack to replace integer|double|decimal with numericliteral
639
- :"http://www.w3.org/2000/10/swap/grammar/n3#numericliteral" => Regexp.compile(%(^[-+]?[0-9]+(\\.[0-9]+)?([eE][-+]?[0-9]+)?))
640
- }
641
- end