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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ec61e722e941b81e66326c2c01be01294d795e79de7d2c19170621cf8e847abd
4
- data.tar.gz: 939c44022792bd224fbdda4bd424e5a314007fa063bb37ecd0e4d9d970a05bda
3
+ metadata.gz: c53b64b52fa5a16fdfe462a270e5eb861c8cbd432aadc0df0aedaf057accb3f3
4
+ data.tar.gz: 2e7537cc0ab6084f7a321ffe4347a5071e6d9204025a746b21856c786fd491d4
5
5
  SHA512:
6
- metadata.gz: 8f9aa6b2c0dfa8932709f9b3d6f39be96252e2ee9002bf1d328fe2adb8145bd79755cb7f7933b1263a0a3e255d4b814ae224c81a465ddf887524294aa34dde90
7
- data.tar.gz: 164f2b19c87a60c328176cee7ff0a358ea04c4f073f169c3f4175d916d9fa910a0d2c4fc01793fc985e1cae6292fefd9eebfe7a3edfd6b90bbb57fcafa724d82
6
+ metadata.gz: b8fd2b701f9eb17083ca81884f98de32435068e494445d14ffdbb7fff7f323a0c32a507e6490466b56f77abb3b7d3cd523861f50e82cb494236537871be8f840
7
+ data.tar.gz: f68c2f4a5f91ecb35d95ad9e58f58adb9ade18b66fd24ad04bfb34482f49cb245e98f27660e46b5bfc4adf72da1c6e534ae903deec35d07fe1419949cefc5312
data/README.md CHANGED
@@ -2,19 +2,28 @@
2
2
  Notation-3 reader/writer for [RDF.rb][RDF.rb] .
3
3
 
4
4
  [![Gem Version](https://badge.fury.io/rb/rdf-n3.png)](https://badge.fury.io/rb/rdf-n3)
5
- [![Build Status](https://travis-ci.org/ruby-rdf/rdf-n3.png?branch=master)](https://travis-ci.org/ruby-rdf/rdf-n3)
5
+ [![Build Status](https://github.com/ruby-rdf/rdf-n3/workflows/CI/badge.svg?branch=develop)](https://github.com/ruby-rdf/rdf-n3/actions?query=workflow%3ACI)
6
+ [![Coverage Status](https://coveralls.io/repos/ruby-rdf/rdf-n3/badge.svg)](https://coveralls.io/github/ruby-rdf/rdf-n3)
7
+ [![Gitter chat](https://badges.gitter.im/ruby-rdf/rdf.png)](https://gitter.im/ruby-rdf/rdf)
6
8
 
7
9
  ## Description
8
- RDF::N3 is an Notation-3 parser for Ruby using the [RDF.rb][RDF.rb] library suite. Also implements N3 Entailment.
10
+ RDF::N3 is an Notation-3 parser and reasoner for Ruby using the [RDF.rb][RDF.rb] library suite.
9
11
 
10
12
  Reader inspired from TimBL predictiveParser and Python librdf implementation.
11
13
 
12
- ## Turtle deprecated
13
- Support for Turtle mime-types and specific format support has been deprecated from this gem,
14
- as Turtle is now implemented using [RDF::Turtle][RDF::Turtle].
14
+ ## Uses CG Specification
15
+ This version tracks the [W3C N3 Community Group][] [Specification][N3] which has incompatibilities with the [Team Submission][] version. Notably:
16
+
17
+ * The `@keywords` declaration is removed, and most form of `@` keywords (e.g., `@is`, `@has`, `@true`) are no longer supported.
18
+ * Terminals adhere closely to their counterparts in [Turtle][].
19
+ * The modifier `<-` is introduced as a synonym for `is ... of`.
20
+ * The SPARQL `BASE` and `PREFIX` declarations are supported.
21
+ * Implicit universal variables are defined at the top-level, rather than in the parent formula of the one in which they are defined.
22
+
23
+ This brings N3 closer to compatibility with Turtle.
15
24
 
16
25
  ## Features
17
- RDF::N3 parses [Notation-3][N3], [Turtle][Turtle] and [N-Triples][N-Triples] into statements or quads. It also performs reasoning and serializes to N3.
26
+ RDF::N3 parses [Notation-3][N3], [Turtle][] and [N-Triples][] into statements or quads. It also performs reasoning and serializes to N3.
18
27
 
19
28
  Install with `gem install rdf-n3`
20
29
 
@@ -49,24 +58,104 @@ Experimental N3 reasoning is supported. Instantiate a reasoner from a dataset:
49
58
  end
50
59
  end
51
60
 
52
- Reasoning is performed by turning a repository containing formula and predicate operators into an executable set of operators (similar to the executable SPARQL Algebra). Reasoning adds statements to the base dataset, marked with `:inferred` (e.g. `statement.inferred?`). Predicate operators are defined from the following vocabularies:
53
-
54
- * RDF List vocabulary <http://www.w3.org/2000/10/swap/list#>
55
- * list:append (not implemented yet - See {RDF::N3::Algebra::ListAppend})
56
- * list:in (not implemented yet - See {RDF::N3::Algebra::ListIn})
57
- * list:last (not implemented yet - See {RDF::N3::Algebra::ListLast})
58
- * list:member (not implemented yet - See {RDF::N3::Algebra::ListMember})
59
- * RDF Log vocabulary <http://www.w3.org/2000/10/swap/log#>
60
- * log:conclusion (not implemented yet - See {RDF::N3::Algebra::LogConclusion})
61
- * log:conjunction (not implemented yet - See {RDF::N3::Algebra::LogConjunction})
62
- * log:equalTo (See {not implemented yet - RDF::N3::Algebra::LogEqualTo})
63
- * log:implies (See {RDF::N3::Algebra::LogImplies})
64
- * log:includes (not implemented yet - See {RDF::N3::Algebra::LogIncludes})
65
- * log:notEqualTo (not implemented yet - See {RDF::N3::Algebra::LogNotEqualTo})
66
- * log:notIncludes (not implemented yet - See {RDF::N3::Algebra::LogNotIncludes})
67
- * log:outputString (not implemented yet - See {RDF::N3::Algebra::LogOutputString})
68
-
69
- N3 Formulae are introduced with the { statement-list } syntax. A given formula is assigned an RDF::Node instance, which is also used as the graph_name for RDF::Statement instances provided to RDF::N3::Reader#each_statement. For example, the following N3 generates the associated statements:
61
+ Reasoning is performed by turning a repository containing formula and predicate operators into an executable set of operators (similar to the executable SPARQL Algebra). Reasoning adds statements to the base dataset, marked with `:inferred` (e.g. `statement.inferred?`). Predicate operators are defined from the following vocabularies.
62
+
63
+ When dispatching built-in operators, precedence is given to operators whos operands are fully evaluated, followed by those having only variable output operands, followed by those having the fewest operands. Operators are evaluated until either no solutions are derived, or all operators have been completed.
64
+
65
+ Reasoning is discussed in the [Design Issues][] document.
66
+
67
+ #### RDF List vocabulary <http://www.w3.org/2000/10/swap/list#>
68
+
69
+ * `list:append` (See {RDF::N3::Algebra::List::Append})
70
+ * `list:first` (See {RDF::N3::Algebra::List::First})
71
+ * `list:in` (See {RDF::N3::Algebra::List::In})
72
+ * `list:last` (See {RDF::N3::Algebra::List::Last})
73
+ * `list:length` (See {RDF::N3::Algebra::List::Length})
74
+ * `list:member` (See {RDF::N3::Algebra::List::Member})
75
+
76
+ #### RDF Log vocabulary <http://www.w3.org/2000/10/swap/log#>
77
+
78
+ * `log:conclusion` (See {RDF::N3::Algebra::Log::Conclusion})
79
+ * `log:conjunction` (See {RDF::N3::Algebra::Log::Conjunction})
80
+ * `log:content` (See {RDF::N3::Algebra::Log::Content})
81
+ * `log:equalTo` (See {RDF::N3::Algebra::Log::EqualTo})
82
+ * `log:implies` (See {RDF::N3::Algebra::Log::Implies})
83
+ * `log:includes` (See {RDF::N3::Algebra::Log::Includes})
84
+ * `log:n3String` (See {RDF::N3::Algebra::Log::N3String})
85
+ * `log:notEqualTo` (See {RDF::N3::Algebra::Log::NotEqualTo})
86
+ * `log:notIncludes` (See {RDF::N3::Algebra::Log::NotIncludes})
87
+ * `log:outputString` See {RDF::N3::Algebra::Log::OutputString})
88
+ * `log:parsedAsN3` (See {RDF::N3::Algebra::Log::ParsedAsN3})
89
+ * `log:semantics` (See {RDF::N3::Algebra::Log::Semantics})
90
+
91
+ #### RDF Math vocabulary <http://www.w3.org/2000/10/swap/math#>
92
+
93
+ * `math:absoluteValue` (See {RDF::N3::Algebra::Math::AbsoluteValue})
94
+ * `math:acos` (See {RDF::N3::Algebra::Math::ACos})
95
+ * `math:asin` (See {RDF::N3::Algebra::Math::ASin})
96
+ * `math:atan` (See {RDF::N3::Algebra::Math::ATan})
97
+ * `math:acosh` (See {RDF::N3::Algebra::Math::ACosH})
98
+ * `math:asinh` (See {RDF::N3::Algebra::Math::ASinH})
99
+ * `math:atanh` (See {RDF::N3::Algebra::Math::ATanH})
100
+ * `math:ceiling` (See {RDF::N3::Algebra::Math::Ceiling})
101
+ * `math:cosh` (See {RDF::N3::Algebra::Math::CosH})
102
+ * `math:cos` (See {RDF::N3::Algebra::Math::Cos})
103
+ * `math:difference` (See {RDF::N3::Algebra::Math::Difference})
104
+ * `math:equalTo` (See {RDF::N3::Algebra::Math::EqualTo})
105
+ * `math:exponentiation` (See {RDF::N3::Algebra::Math::Exponentiation})
106
+ * `math:floor` (See {RDF::N3::Algebra::Math::Floor})
107
+ * `math:greaterThan` (See {RDF::N3::Algebra::Math::GreaterThan})
108
+ * `math:lessThan` (See {RDF::N3::Algebra::Math::LessThan})
109
+ * `math:negation` (See {RDF::N3::Algebra::Math::Negation})
110
+ * `math:notEqualTo` (See {RDF::N3::Algebra::Math::NotEqualTo})
111
+ * `math:notGreaterThan` (See {RDF::N3::Algebra::Math::NotGreaterThan})
112
+ * `math:notLessThan` (See {RDF::N3::Algebra::Math::NotLessThan})
113
+ * `math:product` (See {RDF::N3::Algebra::Math::Product})
114
+ * `math:quotient` (See {RDF::N3::Algebra::Math::Quotient})
115
+ * `math:remainder` (See {RDF::N3::Algebra::Math::Remainder})
116
+ * `math:rounded` (See {RDF::N3::Algebra::Math::Rounded})
117
+ * `math:sinh` (See {RDF::N3::Algebra::Math::SinH})
118
+ * `math:sin` (See {RDF::N3::Algebra::Math::Sin})
119
+ * `math:sum` (See {RDF::N3::Algebra::Math::Sum})
120
+ * `math:tanh` (See {RDF::N3::Algebra::Math::TanH})
121
+ * `math:tan` (See {RDF::N3::Algebra::Math::Tan})
122
+
123
+ #### RDF String vocabulary <http://www.w3.org/2000/10/swap/str#>
124
+
125
+ * `string:concatenation` (See {RDF::N3::Algebra::Str::Concatenation})
126
+ * `string:contains` (See {RDF::N3::Algebra::Str::Contains})
127
+ * `string:containsIgnoringCase` (See {RDF::N3::Algebra::Str::ContainsIgnoringCase})
128
+ * `string:endsWith` (See {RDF::N3::Algebra::Str::EndsWith})
129
+ * `string:equalIgnoringCase` (See {RDF::N3::Algebra::Str::EqualIgnoringCase})
130
+ * `string:format` (See {RDF::N3::Algebra::Str::Format})
131
+ * `string:greaterThan` (See {RDF::N3::Algebra::Str::GreaterThan})
132
+ * `string:lessThan` (See {RDF::N3::Algebra::Str::LessThan})
133
+ * `string:matches` (See {RDF::N3::Algebra::Str::Matches})
134
+ * `string:notEqualIgnoringCase` (See {RDF::N3::Algebra::Str::NotEqualIgnoringCase})
135
+ * `string:notGreaterThan` (See {RDF::N3::Algebra::Str::NotGreaterThan})
136
+ * `string:notLessThan` (See {RDF::N3::Algebra::Str::NotLessThan})
137
+ * `string:notMatches` (See {RDF::N3::Algebra::Str::NotMatches})
138
+ * `string:replace` (See {RDF::N3::Algebra::Str::Replace})
139
+ * `string:scrape` (See {RDF::N3::Algebra::Str::Scrape})
140
+ * `string:startsWith` (See {RDF::N3::Algebra::Str::StartsWith})
141
+
142
+ #### RDF Time vocabulary <>
143
+
144
+ * `time:dayOfWeek` (See {RDF::N3::Algebra::Time::DayOfWeek})
145
+ * `time:day` (See {RDF::N3::Algebra::Time::Day})
146
+ * `time:gmTime` (See {RDF::N3::Algebra::Time::GmTime})
147
+ * `time:hour` (See {RDF::N3::Algebra::Time::Hour})
148
+ * `time:inSeconds` (See {RDF::N3::Algebra::Time::InSeconds})
149
+ * `time:localTime` (See {RDF::N3::Algebra::Time::LocalTime})
150
+ * `time:minute` (See {RDF::N3::Algebra::Time::Minute})
151
+ * `time:month` (See {RDF::N3::Algebra::Time::Month})
152
+ * `time:second` (See {RDF::N3::Algebra::Time::Second})
153
+ * `time:timeZone` (See {RDF::N3::Algebra::Time::Timezone})
154
+ * `time:year` (See {RDF::N3::Algebra::Time::Year})
155
+
156
+ ### Formulae / Quoted Graphs
157
+
158
+ N3 Formulae are introduced with the `{ statement-list }` syntax. A given formula is assigned an `RDF::Node` instance, which is also used as the graph_name for `RDF::Statement` instances provided to `RDF::N3::Reader#each_statement`. For example, the following N3 generates the associated statements:
70
159
 
71
160
  @prefix x: <http://example.org/x-ns/#> .
72
161
  @prefix log: <http://www.w3.org/2000/10/swap/log#> .
@@ -81,10 +170,10 @@ when turned into an RDF Repository results in the following quads
81
170
  _:ora <http://purl.org/dc/elements/1.1/#wrote> _:moby _:form .
82
171
  _:ora <http://example.org/x-ns/#firstname> "Ora" _:form .
83
172
 
84
- Reasoning uses a Notation3 Algebra, similar to [SPARQL S-Expressions](). This implementation considers formulae to be patterns, which may be asserted on statements made in the default graph, possibly loaded from a separate file. The logical relationships are reduced to algebraic operators.
173
+ Reasoning uses a Notation3 Algebra, similar to [SPARQL S-Expressions][]. This implementation considers formulae to be patterns, which may be asserted on statements made in the default graph, possibly loaded from a separate file. The logical relationships are reduced to algebraic operators.
85
174
 
86
175
  ### Variables
87
- N3 Variables are introduced with @forAll, @forSome, or ?x. Variables reference URIs described in formulae, typically defined in the default vocabulary (e.g., ":x"). Existential variables are replaced with an allocated RDF::Node instance. Universal variables are replaced with a RDF::Query::Variable instance. For example, the following N3 generates the associated statements:
176
+ N3 Variables are introduced with `@forAll`, `@forSome`, or `?x`. Variables reference URIs described in formulae, typically defined in the default vocabulary (e.g., `":x"`). Existential variables are replaced with an allocated `RDF::Node` instance. Universal variables are replaced with a `RDF::Query::Variable` instance. For example, the following N3 generates the associated statements:
88
177
 
89
178
  @forAll <#h>. @forSome <#g>. <#g> <#loves> <#h> .
90
179
 
@@ -96,21 +185,20 @@ results in:
96
185
 
97
186
  Note that the behavior of both existential and universal variables is not entirely in keeping with the [Team Submission][], and neither work quite like SPARQL variables. When used in the antecedent part of an implication, universal variables should behave much like SPARQL variables. This area is subject to a fair amount of change.
98
187
 
99
- ## Implementation Notes
100
- The parser is driven through a rules table contained in lib/rdf/n3/reader/meta.rb. This includes
101
- branch rules to indicate productions to be taken based on a current production. Terminals are denoted
102
- through a set of regular expressions used to match each type of terminal.
188
+ * Variables, themselves, cannot be part of a solution, which limits the ability to generate updated rules for reasoning.
189
+ * Both Existentials and Universals are treated as simple variables, and there is really no preference given based on the order in which they are introduced.
103
190
 
104
- The [meta.rb][file:lib/rdf/n3/reader/meta.rb] file is generated from lib/rdf/n3/reader/n3-selectors.n3
105
- (taken from http://www.w3.org/2000/10/swap/grammar/n3-selectors.n3) which is the result of parsing
106
- http://www.w3.org/2000/10/swap/grammar/n3.n3 (along with bnf-rules.n3) using cwm using the following command sequence:
191
+ ### Query
192
+ Formulae are typically used to query the knowledge-base, which is set from the base-formula/default graph. A formula is composed of both constant statements, and variable statements. When running as a query, such as for the antecedent formula in `log:implies`, statements including either explicit variables or blank nodes are treated as query patterns and are used to query the knowledge base to create a solution set, which is used either prove the formula correct, or create bindings passed to the consequent formula.
107
193
 
108
- cwm n3.n3 bnf-rules.n3 --think --purge --data > n3-selectors.n3
109
-
110
- [n3-selectors.n3][file:lib/rdf/n3/reader/n3-selectors.rb] is itself used to generate meta.rb using script/build_meta.
194
+ Blank nodes associated with rdf:List statements used as part of a built-in are made _non-distinguished_ existential variables, and patters containing these variables become optional. If they are not bound as part of the query, the implicitly are bound as the original blank nodes defined within the formula, which allows for both constant list arguments, list arguments that contain variables, or arguments which are variables expanding to lists.
111
195
 
112
196
  ## Dependencies
113
- * [RDF.rb](https://rubygems.org/gems/rdf) (~> 3.0, >= 3.0.10)
197
+ * [Ruby](https://ruby-lang.org/) (>= 2.4)
198
+ * [RDF.rb](https://rubygems.org/gems/rdf) (~> 3.1, >= 3.1.4)
199
+ * [EBNF][EBNF gem] (~> 2.1)
200
+ * [SPARQL][SPARQL gem] (~> 3.1)
201
+ * [SXP][SXP gem] (~> 1.1)
114
202
 
115
203
  ## Documentation
116
204
  Full documentation available on [RubyDoc.info](https://rubydoc.info/github/ruby-rdf/rdf-n3)
@@ -123,26 +211,11 @@ Full documentation available on [RubyDoc.info](https://rubydoc.info/github/ruby-
123
211
  * {RDF::N3::Writer}
124
212
  * {RDF::N3::Algebra}
125
213
  * {RDF::N3::Algebra::Formula}
126
- * {RDF::N3::Algebra::ListAppend}
127
- * {RDF::N3::Algebra::ListIn}
128
- * {RDF::N3::Algebra::ListLast}
129
- * {RDF::N3::Algebra::ListMember}
130
- * {RDF::N3::Algebra::LogConclusion}
131
- * {RDF::N3::Algebra::LogConjunction}
132
- * {RDF::N3::Algebra::LogEqualTo}
133
- * {RDF::N3::Algebra::LogImplies}
134
- * {RDF::N3::Algebra::LogIncludes}
135
- * {RDF::N3::Algebra::LogNotEqualTo}
136
- * {RDF::N3::Algebra::LogNotIncludes}
137
- * {RDF::N3::Algebra::LogOutputString}
138
214
 
139
215
  ### Additional vocabularies
140
- * {RDF::N3::Log}
141
216
  * {RDF::N3::Rei}
142
217
  * {RDF::N3::Crypto}
143
- * {RDF::N3::List}
144
218
  * {RDF::N3::Math}
145
- * {RDF::N3::Str}
146
219
  * {RDF::N3::Time}
147
220
 
148
221
  ## Resources
@@ -151,19 +224,17 @@ Full documentation available on [RubyDoc.info](https://rubydoc.info/github/ruby-
151
224
  * [Documentation](https://rubydoc.info/github/ruby-rdf/rdf-n3/)
152
225
  * [History](file:file.History.html)
153
226
  * [Notation-3][N3]
227
+ * [Team Submission][]
154
228
  * [N3 Primer](https://www.w3.org/2000/10/swap/Primer.html)
155
229
  * [N3 Reification](https://www.w3.org/DesignIssues/Reify.html)
156
- * [Turtle][Turtle]
157
- * [W3C SWAP Test suite](https://www.w3.org/2000/10/swap/test/README.html)
158
- * [W3C Turtle Test suite](https://www.w3.org/2001/sw/DataAccess/df1/tests/README.txt)
159
- * [N-Triples][N-Triples]
230
+ * [Turtle][]
231
+ * [W3C SWAP Test suite](https://w3c.github.io/N3/tests/)
232
+ * [W3C Turtle Test suite](https://w3c.github.io/rdf-tests/turtle/)
233
+ * [N-Triples][]
160
234
 
161
235
  ## Author
162
236
  * [Gregg Kellogg](https://github.com/gkellogg) - <https://greggkellogg.net/>
163
237
 
164
- ## Contributors
165
- * [Nicholas Humfrey](https://github.com/njh) - <https://njh.me/>
166
-
167
238
  ## Contributing
168
239
  This repository uses [Git Flow](https://github.com/nvie/gitflow) to mange development and release activity. All submissions _must_ be on a feature branch based on the _develop_ branch to ease staging and integration.
169
240
 
@@ -177,7 +248,9 @@ This repository uses [Git Flow](https://github.com/nvie/gitflow) to mange develo
177
248
  list in the the `README`. Alphabetical order applies.
178
249
  * Do note that in order for us to merge any non-trivial changes (as a rule
179
250
  of thumb, additions larger than about 15 lines of code), we need an
180
- explicit [public domain dedication][PDD] on record from you.
251
+ explicit [public domain dedication][PDD] on record from you,
252
+ which you will be asked to agree to on the first commit to a repo within the organization.
253
+ Note that the agreement applies to all repos in the [Ruby RDF](https://github.com/ruby-rdf/) organization.
181
254
 
182
255
  ## License
183
256
 
@@ -190,13 +263,19 @@ see <https://unlicense.org/> or the accompanying {file:UNLICENSE} file.
190
263
  * <https://github.com/ruby-rdf/rdf-n3>
191
264
  * <https://lists.w3.org/Archives/Public/public-rdf-ruby/>
192
265
 
193
- [RDF.rb]: https://ruby-rdf.github.com/rdf
194
- [RDF::Turtle]: https://ruby-rdf.github.com/rdf-turtle/
195
- [N3]: https://www.w3.org/DesignIssues/Notation3.html "Notation-3"
196
- [Team Submission]: https://www.w3.org/TeamSubmission/n3/
197
- [Turtle]: https://www.w3.org/TR/turtle/
198
- [N-Triples]: https://www.w3.org/TR/n-triples/
199
- [YARD]: https://yardoc.org/
200
- [YARD-GS]: https://rubydoc.info/docs/yard/file/docs/GettingStarted.md
201
- [PDD]: https://lists.w3.org/Archives/Public/public-rdf-ruby/2010May/0013.html
266
+ [RDF::Turtle]: https://ruby-rdf.github.com/rdf-turtle/
267
+ [Design Issues]: https://www.w3.org/DesignIssues/Notation3.html "Notation-3 Design Issues"
268
+ [Team Submission]: https://www.w3.org/TeamSubmission/n3/
269
+ [Turtle]: https://www.w3.org/TR/turtle/
270
+ [N-Triples]: https://www.w3.org/TR/n-triples/
271
+ [YARD]: https://yardoc.org/
272
+ [YARD-GS]: https://rubydoc.info/docs/yard/file/docs/GettingStarted.md
273
+ [PDD]: https://unlicense.org/#unlicensing-contributions
202
274
  [SPARQL S-Expressions]: https://jena.apache.org/documentation/notes/sse.html
275
+ [W3C N3 Community Group]: https://www.w3.org/community/n3-dev/
276
+ [N3]: https://w3c.github.io/N3/spec/
277
+ [PEG]: https://en.wikipedia.org/wiki/Parsing_expression_grammar
278
+ [RDF.rb]: https://ruby-rdf.github.com/rdf
279
+ [EBNF gem]: https://ruby-rdf.github.com/ebnf
280
+ [SPARQL gem]: https://ruby-rdf.github.com/sparql
281
+ [SXP gem]: https://ruby-rdf.github.com/sxp
data/UNLICENSE CHANGED
@@ -21,4 +21,4 @@ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
21
  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
22
  OTHER DEALINGS IN THE SOFTWARE.
23
23
 
24
- For more information, please refer to <http://unlicense.org/>
24
+ For more information, please refer to <https://unlicense.org/>
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.1.1
1
+ 3.1.2
@@ -1,4 +1,3 @@
1
- $:.unshift(File.expand_path(File.join(File.dirname(__FILE__), '..')))
2
1
  require 'rdf'
3
2
 
4
3
  module RDF
@@ -24,12 +23,13 @@ module RDF
24
23
  require 'rdf/n3/format'
25
24
  require 'rdf/n3/vocab'
26
25
  require 'rdf/n3/extensions'
27
- require 'rdf/n3/patches/array_hacks'
28
- autoload :Meta, 'rdf/n3/reader/meta'
29
- autoload :Parser, 'rdf/n3/reader/parser'
30
- autoload :Reader, 'rdf/n3/reader'
31
- autoload :Reasoner, 'rdf/n3/reasoner'
32
- autoload :VERSION, 'rdf/n3/version'
33
- autoload :Writer, 'rdf/n3/writer'
26
+ require 'rdf/n3/refinements'
27
+ autoload :List, 'rdf/n3/list'
28
+ autoload :Reader, 'rdf/n3/reader'
29
+ autoload :Reasoner, 'rdf/n3/reasoner'
30
+ autoload :Repository, 'rdf/n3/repository'
31
+ autoload :Terminals, 'rdf/n3/terminals'
32
+ autoload :VERSION, 'rdf/n3/version'
33
+ autoload :Writer, 'rdf/n3/writer'
34
34
  end
35
35
  end
@@ -7,115 +7,194 @@ module RDF::N3
7
7
  #
8
8
  # @author [Gregg Kellogg](http://greggkellogg.net/)
9
9
  module Algebra
10
+ autoload :Builtin, 'rdf/n3/algebra/builtin'
10
11
  autoload :Formula, 'rdf/n3/algebra/formula'
12
+ autoload :ListOperator, 'rdf/n3/algebra/list_operator'
13
+ autoload :NotImplemented, 'rdf/n3/algebra/not_implemented'
14
+ autoload :ResourceOperator, 'rdf/n3/algebra/resource_operator'
11
15
 
12
16
  module List
17
+ def vocab; RDF::N3::List.to_uri; end
18
+ module_function :vocab
13
19
  autoload :Append, 'rdf/n3/algebra/list/append'
20
+ autoload :First, 'rdf/n3/algebra/list/first'
14
21
  autoload :In, 'rdf/n3/algebra/list/in'
15
22
  autoload :Last, 'rdf/n3/algebra/list/last'
23
+ autoload :Length, 'rdf/n3/algebra/list/length'
16
24
  autoload :Member, 'rdf/n3/algebra/list/member'
17
25
  end
18
26
 
19
27
  module Log
28
+ def vocab; RDF::N3::Log.to_uri; end
29
+ module_function :vocab
20
30
  autoload :Conclusion, 'rdf/n3/algebra/log/conclusion'
21
31
  autoload :Conjunction, 'rdf/n3/algebra/log/conjunction'
22
- autoload :EqualTo, 'rdf/n3/algebra/log/equalTo'
32
+ autoload :Content, 'rdf/n3/algebra/log/content'
33
+ autoload :EqualTo, 'rdf/n3/algebra/log/equal_to'
23
34
  autoload :Implies, 'rdf/n3/algebra/log/implies'
24
35
  autoload :Includes, 'rdf/n3/algebra/log/includes'
25
- autoload :NotEqualTo, 'rdf/n3/algebra/log/notEqualTo'
26
- autoload :NotIncludes, 'rdf/n3/algebra/log/notIncludes'
27
- autoload :OutputString, 'rdf/n3/algebra/log/outputString'
36
+ autoload :N3String, 'rdf/n3/algebra/log/n3_string'
37
+ autoload :NotEqualTo, 'rdf/n3/algebra/log/not_equal_to'
38
+ autoload :NotIncludes, 'rdf/n3/algebra/log/not_includes'
39
+ autoload :OutputString, 'rdf/n3/algebra/log/output_string'
40
+ autoload :ParsedAsN3, 'rdf/n3/algebra/log/parsed_as_n3'
41
+ autoload :Semantics, 'rdf/n3/algebra/log/semantics'
28
42
  end
29
43
 
30
44
  module Math
31
- autoload :AbsoluteValue, 'rdf/n3/algebra/math/absoluteValue'
45
+ def vocab; RDF::N3::Math.to_uri; end
46
+ module_function :vocab
47
+ autoload :AbsoluteValue, 'rdf/n3/algebra/math/absolute_value'
48
+ autoload :ACos, 'rdf/n3/algebra/math/acos'
49
+ autoload :ASin, 'rdf/n3/algebra/math/asin'
50
+ autoload :ATan, 'rdf/n3/algebra/math/atan'
51
+ autoload :ACosH, 'rdf/n3/algebra/math/acosh'
52
+ autoload :ASinH, 'rdf/n3/algebra/math/asinh'
53
+ autoload :ATanH, 'rdf/n3/algebra/math/atanh'
54
+ autoload :Ceiling, 'rdf/n3/algebra/math/ceiling'
55
+ autoload :Cos, 'rdf/n3/algebra/math/cos'
56
+ autoload :CosH, 'rdf/n3/algebra/math/cosh'
32
57
  autoload :Difference, 'rdf/n3/algebra/math/difference'
33
- autoload :EqualTo, 'rdf/n3/algebra/math/equalTo'
58
+ autoload :EqualTo, 'rdf/n3/algebra/math/equal_to'
34
59
  autoload :Exponentiation, 'rdf/n3/algebra/math/exponentiation'
35
- autoload :GreaterThan, 'rdf/n3/algebra/math/greaterThan'
36
- autoload :IntegerQuotient, 'rdf/n3/algebra/math/integerQuotient'
37
- autoload :LessThan, 'rdf/n3/algebra/math/lessThan'
38
- autoload :MemberCount, 'rdf/n3/algebra/math/memberCount'
60
+ autoload :Floor, 'rdf/n3/algebra/math/floor'
61
+ autoload :GreaterThan, 'rdf/n3/algebra/math/greater_than'
62
+ autoload :LessThan, 'rdf/n3/algebra/math/less_than'
39
63
  autoload :Negation, 'rdf/n3/algebra/math/negation'
40
- autoload :NotEqualTo, 'rdf/n3/algebra/math/notEqualTo'
41
- autoload :NotGreaterThan, 'rdf/n3/algebra/math/notGreaterThan'
42
- autoload :NotLessThan, 'rdf/n3/algebra/math/notLessThan'
64
+ autoload :NotEqualTo, 'rdf/n3/algebra/math/not_equal_to'
65
+ autoload :NotGreaterThan, 'rdf/n3/algebra/math/not_greater_than'
66
+ autoload :NotLessThan, 'rdf/n3/algebra/math/not_less_than'
43
67
  autoload :Product, 'rdf/n3/algebra/math/product'
44
68
  autoload :Quotient, 'rdf/n3/algebra/math/quotient'
45
69
  autoload :Remainder, 'rdf/n3/algebra/math/remainder'
46
70
  autoload :Rounded, 'rdf/n3/algebra/math/rounded'
71
+ autoload :Sin, 'rdf/n3/algebra/math/sin'
72
+ autoload :SinH, 'rdf/n3/algebra/math/sinh'
47
73
  autoload :Sum, 'rdf/n3/algebra/math/sum'
74
+ autoload :Tan, 'rdf/n3/algebra/math/tan'
75
+ autoload :TanH, 'rdf/n3/algebra/math/tanh'
48
76
  end
49
77
 
50
78
  module Str
79
+ def vocab; RDF::N3::Str.to_uri; end
80
+ module_function :vocab
51
81
  autoload :Concatenation, 'rdf/n3/algebra/str/concatenation'
52
82
  autoload :Contains, 'rdf/n3/algebra/str/contains'
53
- autoload :ContainsIgnoringCase, 'rdf/n3/algebra/str/containsIgnoringCase'
54
- autoload :EndsWith, 'rdf/n3/algebra/str/endsWith'
55
- autoload :EqualIgnoringCase, 'rdf/n3/algebra/str/equalIgnoringCase'
83
+ autoload :ContainsIgnoringCase, 'rdf/n3/algebra/str/contains_ignoring_case'
84
+ autoload :EndsWith, 'rdf/n3/algebra/str/ends_with'
85
+ autoload :EqualIgnoringCase, 'rdf/n3/algebra/str/equal_ignoring_case'
56
86
  autoload :Format, 'rdf/n3/algebra/str/format'
57
- autoload :GreaterThan, 'rdf/n3/algebra/str/greaterThan'
58
- autoload :LessThan, 'rdf/n3/algebra/str/lessThan'
87
+ autoload :GreaterThan, 'rdf/n3/algebra/str/greater_than'
88
+ autoload :LessThan, 'rdf/n3/algebra/str/less_than'
59
89
  autoload :Matches, 'rdf/n3/algebra/str/matches'
60
- autoload :NotEqualIgnoringCase, 'rdf/n3/algebra/str/notEqualIgnoringCase'
61
- autoload :NotGreaterThan, 'rdf/n3/algebra/str/notGreaterThan'
62
- autoload :NotLessThan, 'rdf/n3/algebra/str/notLessThan'
63
- autoload :NotMatches, 'rdf/n3/algebra/str/notMatches'
90
+ autoload :NotEqualIgnoringCase, 'rdf/n3/algebra/str/not_equal_ignoring_case'
91
+ autoload :NotGreaterThan, 'rdf/n3/algebra/str/not_greater_than'
92
+ autoload :NotLessThan, 'rdf/n3/algebra/str/not_less_than'
93
+ autoload :NotMatches, 'rdf/n3/algebra/str/not_matches'
64
94
  autoload :Replace, 'rdf/n3/algebra/str/replace'
65
95
  autoload :Scrape, 'rdf/n3/algebra/str/scrape'
66
- autoload :StartsWith, 'rdf/n3/algebra/str/startsWith'
96
+ autoload :StartsWith, 'rdf/n3/algebra/str/starts_with'
97
+ end
98
+
99
+ module Time
100
+ def vocab; RDF::N3::Time.to_uri; end
101
+ module_function :vocab
102
+ autoload :DayOfWeek, 'rdf/n3/algebra/time/day_of_week'
103
+ autoload :Day, 'rdf/n3/algebra/time/day'
104
+ autoload :GmTime, 'rdf/n3/algebra/time/gm_time'
105
+ autoload :Hour, 'rdf/n3/algebra/time/hour'
106
+ autoload :InSeconds, 'rdf/n3/algebra/time/in_seconds'
107
+ autoload :LocalTime, 'rdf/n3/algebra/time/local_time'
108
+ autoload :Minute, 'rdf/n3/algebra/time/minute'
109
+ autoload :Month, 'rdf/n3/algebra/time/month'
110
+ autoload :Second, 'rdf/n3/algebra/time/second'
111
+ autoload :Timezone, 'rdf/n3/algebra/time/timezone'
112
+ autoload :Year, 'rdf/n3/algebra/time/year'
67
113
  end
68
114
 
69
115
  def for(uri)
70
116
  {
71
- RDF::N3::List.append => List::Append,
72
- RDF::N3::List.in => List::In,
73
- RDF::N3::List.last => List::Last,
74
- RDF::N3::List.member => List::Member,
117
+ RDF::N3::List.append => List.const_get(:Append),
118
+ RDF::N3::List.first => List.const_get(:First),
119
+ RDF::N3::List.in => List.const_get(:In),
120
+ RDF::N3::List.last => List.const_get(:Last),
121
+ RDF::N3::List.length => List.const_get(:Length),
122
+ RDF::N3::List.member => List.const_get(:Member),
123
+
124
+ RDF::N3::Log.conclusion => Log.const_get(:Conclusion),
125
+ RDF::N3::Log.conjunction => Log.const_get(:Conjunction),
126
+ RDF::N3::Log.content => Log.const_get(:Content),
127
+ RDF::N3::Log.equalTo => Log.const_get(:EqualTo),
128
+ RDF::N3::Log.implies => Log.const_get(:Implies),
129
+ RDF::N3::Log.includes => Log.const_get(:Includes),
130
+ RDF::N3::Log.n3String => Log.const_get(:N3String),
131
+ RDF::N3::Log.notEqualTo => Log.const_get(:NotEqualTo),
132
+ RDF::N3::Log.notIncludes => Log.const_get(:NotIncludes),
133
+ RDF::N3::Log.outputString => Log.const_get(:OutputString),
134
+ RDF::N3::Log.parsedAsN3 => Log.const_get(:ParsedAsN3),
135
+ RDF::N3::Log.semantics => Log.const_get(:Semantics),
136
+ RDF::N3::Log.supports => NotImplemented,
75
137
 
76
- RDF::N3::Log.conclusion => Log::Conclusion,
77
- RDF::N3::Log.conjunction => Log::Conjunction,
78
- RDF::N3::Log.equalTo => Log::EqualTo,
79
- RDF::N3::Log.implies => Log::Implies,
80
- RDF::N3::Log.includes => Log::Includes,
81
- RDF::N3::Log.notEqualTo => Log::NotEqualTo,
82
- RDF::N3::Log.notIncludes => Log::NotIncludes,
83
- RDF::N3::Log.outputString => Log::OutputString,
138
+ RDF::N3::Math.absoluteValue => Math.const_get(:AbsoluteValue),
139
+ RDF::N3::Math.acos => Math.const_get(:ACos),
140
+ RDF::N3::Math.asin => Math.const_get(:ASin),
141
+ RDF::N3::Math.atan => Math.const_get(:ATan),
142
+ RDF::N3::Math.acosh => Math.const_get(:ACosH),
143
+ RDF::N3::Math.asinh => Math.const_get(:ASinH),
144
+ RDF::N3::Math.atanh => Math.const_get(:ATanH),
145
+ RDF::N3::Math.ceiling => Math.const_get(:Ceiling),
146
+ RDF::N3::Math.ceiling => Math.const_get(:Ceiling),
147
+ RDF::N3::Math.cos => Math.const_get(:Cos),
148
+ RDF::N3::Math.cosh => Math.const_get(:CosH),
149
+ RDF::N3::Math.difference => Math.const_get(:Difference),
150
+ RDF::N3::Math.equalTo => Math.const_get(:EqualTo),
151
+ RDF::N3::Math.exponentiation => Math.const_get(:Exponentiation),
152
+ RDF::N3::Math.floor => Math.const_get(:Floor),
153
+ RDF::N3::Math.greaterThan => Math.const_get(:GreaterThan),
154
+ RDF::N3::Math.lessThan => Math.const_get(:LessThan),
155
+ RDF::N3::Math.negation => Math.const_get(:Negation),
156
+ RDF::N3::Math.notEqualTo => Math.const_get(:NotEqualTo),
157
+ RDF::N3::Math.notGreaterThan => Math.const_get(:NotGreaterThan),
158
+ RDF::N3::Math.notLessThan => Math.const_get(:NotLessThan),
159
+ RDF::N3::Math.product => Math.const_get(:Product),
160
+ RDF::N3::Math.quotient => Math.const_get(:Quotient),
161
+ RDF::N3::Math.remainder => Math.const_get(:Remainder),
162
+ RDF::N3::Math.rounded => Math.const_get(:Rounded),
163
+ RDF::N3::Math.sin => Math.const_get(:Sin),
164
+ RDF::N3::Math.sinh => Math.const_get(:SinH),
165
+ RDF::N3::Math.tan => Math.const_get(:Tan),
166
+ RDF::N3::Math.tanh => Math.const_get(:TanH),
167
+ RDF::N3::Math[:sum] => Math.const_get(:Sum),
84
168
 
85
- RDF::N3::Math.absoluteValue => Math::AbsoluteValue,
86
- RDF::N3::Math.difference => Math::Difference,
87
- RDF::N3::Math.equalTo => Math::EqualTo,
88
- RDF::N3::Math.exponentiation => Math::Exponentiation,
89
- RDF::N3::Math.greaterThan => Math::GreaterThan,
90
- RDF::N3::Math.integerQuotient => Math::IntegerQuotient,
91
- RDF::N3::Math.lessThan => Math::LessThan,
92
- RDF::N3::Math.memberCount => Math::MemberCount,
93
- RDF::N3::Math.negation => Math::Negation,
94
- RDF::N3::Math.notEqualTo => Math::NotEqualTo,
95
- RDF::N3::Math.notGreaterThan => Math::NotGreaterThan,
96
- RDF::N3::Math.notLessThan => Math::NotLessThan,
97
- RDF::N3::Math.product => Math::Product,
98
- RDF::N3::Math.quotient => Math::Quotient,
99
- RDF::N3::Math.remainder => Math::Remainder,
100
- RDF::N3::Math.rounded => Math::Rounded,
101
- RDF::N3::Math.sum => Math::Sum,
169
+ RDF::N3::Str.concatenation => Str.const_get(:Concatenation),
170
+ RDF::N3::Str.contains => Str.const_get(:Contains),
171
+ RDF::N3::Str.containsIgnoringCase => Str.const_get(:ContainsIgnoringCase),
172
+ RDF::N3::Str.containsRoughly => NotImplemented,
173
+ RDF::N3::Str.endsWith => Str.const_get(:EndsWith),
174
+ RDF::N3::Str.equalIgnoringCase => Str.const_get(:EqualIgnoringCase),
175
+ RDF::N3::Str.format => Str.const_get(:Format),
176
+ RDF::N3::Str.greaterThan => Str.const_get(:GreaterThan),
177
+ RDF::N3::Str.lessThan => Str.const_get(:LessThan),
178
+ RDF::N3::Str.matches => Str.const_get(:Matches),
179
+ RDF::N3::Str.notEqualIgnoringCase => Str.const_get(:NotEqualIgnoringCase),
180
+ RDF::N3::Str.notGreaterThan => Str.const_get(:NotGreaterThan),
181
+ RDF::N3::Str.notLessThan => Str.const_get(:NotLessThan),
182
+ RDF::N3::Str.notMatches => Str.const_get(:NotMatches),
183
+ RDF::N3::Str.replace => Str.const_get(:Replace),
184
+ RDF::N3::Str.scrape => Str.const_get(:Scrape),
185
+ RDF::N3::Str.startsWith => Str.const_get(:StartsWith),
102
186
 
103
- RDF::N3::Str.concatenation => Str::Concatenation,
104
- RDF::N3::Str.contains => Str::Contains,
105
- RDF::N3::Str.containsIgnoringCase => Str::ContainsIgnoringCase,
106
- RDF::N3::Str.endsWith => Str::EndsWith,
107
- RDF::N3::Str.equalIgnoringCase => Str::EqualIgnoringCase,
108
- RDF::N3::Str.format => Str::Format,
109
- RDF::N3::Str.greaterThan => Str::GreaterThan,
110
- RDF::N3::Str.lessThan => Str::LessThan,
111
- RDF::N3::Str.matches => Str::Matches,
112
- RDF::N3::Str.notEqualIgnoringCase => Str::NotEqualIgnoringCase,
113
- RDF::N3::Str.notGreaterThan => Str::NotGreaterThan,
114
- RDF::N3::Str.notLessThan => Str::NotLessThan,
115
- RDF::N3::Str.notMatches => Str::NotMatches,
116
- RDF::N3::Str.replace => Str::Replace,
117
- RDF::N3::Str.scrape => Str::Scrape,
118
- RDF::N3::Str.startsWith => Str::StartsWith,
187
+ RDF::N3::Time.dayOfWeek => Time.const_get(:DayOfWeek),
188
+ RDF::N3::Time.day => Time.const_get(:Day),
189
+ RDF::N3::Time.gmTime => Time.const_get(:GmTime),
190
+ RDF::N3::Time.hour => Time.const_get(:Hour),
191
+ RDF::N3::Time.inSeconds => Time.const_get(:InSeconds),
192
+ RDF::N3::Time.localTime => Time.const_get(:LocalTime),
193
+ RDF::N3::Time.minute => Time.const_get(:Minute),
194
+ RDF::N3::Time.month => Time.const_get(:Month),
195
+ RDF::N3::Time.second => Time.const_get(:Second),
196
+ RDF::N3::Time.timeZone => Time.const_get(:Timezone),
197
+ RDF::N3::Time.year => Time.const_get(:Year),
119
198
  }[uri]
120
199
  end
121
200
  module_function :for