sparql 1.99.0 → 1.99.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/sparql/algebra/aggregate.rb +4 -1
- data/lib/sparql/algebra/operator/group_concat.rb +4 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ec364c42e06e4cdc86392e739b67253706707a6
|
4
|
+
data.tar.gz: c3248886ed4b4821d66f03373a6a770547c2b9e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79e904fa34e79c9a49517a690e5a190900b9b96462807c22fc22b7913d329f455628b9d3a6b6c264eb47492438694c16d1f758ca3b87dd089b656bb665441159
|
7
|
+
data.tar.gz: 9d9675ad236cb8fd49e7a09da77e38c43e9fa616d190aaa2e2fead03e9f2d577f4d027332676c3810a0ec620c0c39a5ac9f05504fdac25e3d3cd498876a013bf
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.99.
|
1
|
+
1.99.1
|
@@ -15,6 +15,8 @@ module SPARQL; module Algebra
|
|
15
15
|
# Aggregates this operator accross its operands using
|
16
16
|
# a solutions enumerable.
|
17
17
|
#
|
18
|
+
# The first operand may be :distinct, in which case the result of applying the rest of the operands is uniqued before applying the expression.
|
19
|
+
#
|
18
20
|
# @param [Enumerable<RDF::Query::Solution>] solutions ([])
|
19
21
|
# an enumerable set of query solutions
|
20
22
|
# @param [Hash{Symbol => Object}] options ({})
|
@@ -23,6 +25,7 @@ module SPARQL; module Algebra
|
|
23
25
|
# @raise [TypeError]
|
24
26
|
# @abstract
|
25
27
|
def aggregate(solutions = [], options = {})
|
28
|
+
operands.shift if distinct = (operands.first == :distinct)
|
26
29
|
args_enum = solutions.map do |solution|
|
27
30
|
operands.map do |operand|
|
28
31
|
begin
|
@@ -33,7 +36,7 @@ module SPARQL; module Algebra
|
|
33
36
|
end
|
34
37
|
end.compact
|
35
38
|
end
|
36
|
-
apply(args_enum)
|
39
|
+
apply(distinct ? args_enum.uniq : args_enum)
|
37
40
|
end
|
38
41
|
|
39
42
|
##
|
@@ -16,8 +16,9 @@ module SPARQL; module Algebra
|
|
16
16
|
include Aggregate
|
17
17
|
|
18
18
|
NAME = :group_concat
|
19
|
+
|
19
20
|
##
|
20
|
-
# One or
|
21
|
+
# One, two or three operands, the first may be `distinct`, the last operand, if it exists, is a separator, defaulting to ' '.
|
21
22
|
#
|
22
23
|
# @param [Enumerable<RDF::Query::Solution>] solutions ([])
|
23
24
|
# an enumerable set of query solutions
|
@@ -27,6 +28,7 @@ module SPARQL; module Algebra
|
|
27
28
|
# @raise [TypeError]
|
28
29
|
# @abstract
|
29
30
|
def aggregate(solutions = [], options = {})
|
31
|
+
operands.shift if distinct = (operands.first == :distinct)
|
30
32
|
sep = operands.length == 2 ? operand(0).last : RDF::Literal(' ')
|
31
33
|
args_enum = solutions.map do |solution|
|
32
34
|
begin
|
@@ -36,10 +38,9 @@ module SPARQL; module Algebra
|
|
36
38
|
nil
|
37
39
|
end
|
38
40
|
end
|
39
|
-
apply(args_enum, sep)
|
41
|
+
apply(distinct ? args_enum.uniq : args_enum, sep)
|
40
42
|
end
|
41
43
|
|
42
|
-
|
43
44
|
##
|
44
45
|
# GroupConcat is a set function which performs a string concatenation across the values of an expression with a group. The order of the strings is not specified. The separator character used in the concatenation may be given with the scalar argument SEPARATOR.
|
45
46
|
#
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sparql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.99.
|
4
|
+
version: 1.99.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregg Kellogg
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-03-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rdf
|
@@ -426,7 +426,7 @@ files:
|
|
426
426
|
- lib/sparql/version.rb
|
427
427
|
homepage: http://github.com/ruby-rdf/sparql
|
428
428
|
licenses:
|
429
|
-
-
|
429
|
+
- Unlicense
|
430
430
|
metadata: {}
|
431
431
|
post_install_message:
|
432
432
|
rdoc_options: []
|
@@ -444,7 +444,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
444
444
|
version: '0'
|
445
445
|
requirements: []
|
446
446
|
rubyforge_project: sparql
|
447
|
-
rubygems_version: 2.
|
447
|
+
rubygems_version: 2.5.1
|
448
448
|
signing_key:
|
449
449
|
specification_version: 4
|
450
450
|
summary: SPARQL Query and Update library for Ruby.
|