rdf 3.2.5 → 3.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/rdf/model/literal/temporal.rb +4 -4
- data/lib/rdf/model/literal/time.rb +4 -1
- data/lib/rdf/query/solution.rb +1 -2
- data/lib/rdf/query/solutions.rb +21 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58dcc9836c4302cad4bb46a86596235794a664d508cc002ce298b6c964265ba9
|
4
|
+
data.tar.gz: 941a3daf3a379acf33fe09688ea9cabefd25eb88dc80a7b31d05ac380b2cb2f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f384a93b62b93d574c3dae02e8285f77a3ea6fa26c60eb30aa387e7213343e763a00d9a58f33d0caf4acc5f68a4b27e55361beb792127486059e8afeb333053e
|
7
|
+
data.tar.gz: ed8a19309a2b2f042a3f10df60465b56bd5ea9ace1a305cbe595bab507a7606eae99438fe3ce1edbcd653f513bd015aaf19d5e7203c5903278e275dc591e9d15
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.2.
|
1
|
+
3.2.6
|
@@ -128,7 +128,7 @@ module RDF; class Literal
|
|
128
128
|
#
|
129
129
|
# @return [String]
|
130
130
|
def to_s
|
131
|
-
@string
|
131
|
+
@string ||= (@object.strftime(self.class.const_get(:FORMAT)).sub('.000', '') + self.tz)
|
132
132
|
end
|
133
133
|
|
134
134
|
##
|
@@ -146,18 +146,18 @@ module RDF; class Literal
|
|
146
146
|
#
|
147
147
|
# Otherwise, the timezone is set based on the difference between the current timezone offset (if any) and `zone`.
|
148
148
|
#
|
149
|
-
# @param [String] zone (nil) In the form of {ZONE_GRAMMAR}.
|
149
|
+
# @param [DayTimeDuration, String] zone (nil) In the form of {ZONE_GRAMMAR}.
|
150
150
|
# @return [Temporal] `self`
|
151
151
|
# @raise [RangeError] if `zone < -14*60` or `zone > 14*60`
|
152
152
|
# @see https://www.w3.org/TR/xpath-functions/#func-adjust-dateTime-to-timezone
|
153
153
|
def adjust_to_timezone!(*args)
|
154
154
|
zone = args.empty? ? '+00:00' : args.first
|
155
|
-
if zone.
|
155
|
+
if zone.to_s.empty?
|
156
156
|
# Remove timezone component
|
157
157
|
@object = self.class.new(@object.strftime(self.class.const_get(:FORMAT))).object
|
158
158
|
@zone = nil
|
159
159
|
else
|
160
|
-
md = zone.match(ZONE_GRAMMAR)
|
160
|
+
md = zone.to_s.match(ZONE_GRAMMAR)
|
161
161
|
raise ArgumentError,
|
162
162
|
"expected #{zone.inspect} to be a xsd:dayTimeDuration or +/-HH:MM" unless md
|
163
163
|
|
@@ -39,7 +39,10 @@ module RDF; class Literal
|
|
39
39
|
end
|
40
40
|
# Normalize 24:00:00 to 00:00:00
|
41
41
|
hr, mi, se = tm.split(':')
|
42
|
-
|
42
|
+
if hr.to_i > 23
|
43
|
+
hr = "%.2i" % (hr.to_i % 24)
|
44
|
+
@string = nil
|
45
|
+
end
|
43
46
|
value = "#{hr}:#{mi}:#{se}"
|
44
47
|
# Normalize to 1972-12-31 dateTime base
|
45
48
|
::DateTime.parse("1972-12-31T#{hr}:#{mi}:#{se}#{@zone}")
|
data/lib/rdf/query/solution.rb
CHANGED
@@ -317,13 +317,12 @@ class RDF::Query
|
|
317
317
|
def hash
|
318
318
|
@bindings.hash
|
319
319
|
end
|
320
|
-
|
320
|
+
|
321
321
|
##
|
322
322
|
# Equivalence of solution
|
323
323
|
def eql?(other)
|
324
324
|
other.is_a?(Solution) && @bindings.eql?(other.bindings)
|
325
325
|
end
|
326
|
-
alias_method :==, :eql?
|
327
326
|
|
328
327
|
##
|
329
328
|
# Equals of solution
|
data/lib/rdf/query/solutions.rb
CHANGED
@@ -77,6 +77,15 @@ module RDF; class Query
|
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
80
|
+
##
|
81
|
+
# Sets variable names used in these solutions. If not set, the default is determined by the variables used in each solution.
|
82
|
+
#
|
83
|
+
# @param [Array<Symbol, RDF::Query::Variable>] vars
|
84
|
+
# @return [Array<Symbol>]
|
85
|
+
def variable_names=(vars)
|
86
|
+
@variable_names = vars.map(&:to_sym)
|
87
|
+
end
|
88
|
+
|
80
89
|
##
|
81
90
|
# @overload variable?
|
82
91
|
# Returns `false`.
|
@@ -294,5 +303,17 @@ module RDF; class Query
|
|
294
303
|
self
|
295
304
|
end
|
296
305
|
alias_method :limit!, :limit
|
306
|
+
|
307
|
+
##
|
308
|
+
# Equivalence of solution
|
309
|
+
def eql?(other)
|
310
|
+
super && (!other.respond_to?(:variable_names) || variable_names.eql?(other.variable_names))
|
311
|
+
end
|
312
|
+
|
313
|
+
##
|
314
|
+
# Equals of solution
|
315
|
+
def ==(other)
|
316
|
+
super && (!other.respond_to?(:variable_names) || variable_names.eql?(other.variable_names))
|
317
|
+
end
|
297
318
|
end # Solutions
|
298
319
|
end; end # RDF::Query
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arto Bendiken
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2022-
|
13
|
+
date: 2022-03-14 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: link_header
|