rdf-aggregate-repo 2.2.1 → 3.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +21 -16
- data/UNLICENSE +1 -1
- data/VERSION +1 -1
- data/etc/doap.ttl +19 -21
- data/lib/rdf/aggregate_repo/merge_graph.rb +11 -13
- data/lib/rdf/aggregate_repo.rb +9 -9
- metadata +30 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3a7d5bc06eadca59c26ea908e391927f8cf75fbd5ddaceb66f1a0ca58e46a767
|
4
|
+
data.tar.gz: e9c121291ede4b1a7f22c0cfe5bd9146c5617d60cd2e6c64a143af1b9f652bfd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 979c263051562bcbb0e3a36c360c913250e2e940fe57aec560b0133fa4dd294ec96dedf1ec90ae3a22879aff8100dba01ca28d7224f1b09659e6facbcf484319
|
7
|
+
data.tar.gz: 8832ab836d118874d99dc79864fbaf177fe6a3935c73edab273083e3723dac4affec34741cc43b82bd097f8d296ef194aa1ab61aeffcda461165a46858217f10
|
data/README.md
CHANGED
@@ -2,8 +2,10 @@
|
|
2
2
|
|
3
3
|
An aggregate RDF::Dataset supporting a subset of named graphs and zero or more named graphs mapped to the default graph.
|
4
4
|
|
5
|
-
[![Gem Version](https://badge.fury.io/rb/rdf-aggregate-repo.png)](
|
6
|
-
[![Build Status](https://
|
5
|
+
[![Gem Version](https://badge.fury.io/rb/rdf-aggregate-repo.png)](https://badge.fury.io/rb/rdf-aggregate-repo)
|
6
|
+
[![Build Status](https://github.com/ruby-rdf/rdf-aggregate-repo/workflows/CI/badge.svg?branch=develop)](https://github.com/ruby-rdf/rdf-aggregate-repo/actions?query=workflow%3ACI)
|
7
|
+
[![Coverage Status](https://coveralls.io/repos/ruby-rdf/rdf-aggregate-repo/badge.svg?branch=develop)](https://coveralls.io/github/ruby-rdf/rdf-aggregate-repo?branch=develop)
|
8
|
+
[![Gitter chat](https://badges.gitter.im/ruby-rdf/rdf.png)](https://gitter.im/ruby-rdf/rdf)
|
7
9
|
|
8
10
|
## Description
|
9
11
|
|
@@ -12,33 +14,34 @@ Maps named graphs from one or more `RDF::Queryable` instances into a single data
|
|
12
14
|
## Examples
|
13
15
|
|
14
16
|
require 'rdf'
|
17
|
+
require 'rdf/aggregate_repo
|
15
18
|
require 'rdf/nquads'
|
16
|
-
repo = RDF::Repository.load("
|
19
|
+
repo = RDF::Repository.load("https://ruby-rdf.github.io/rdf/etc/doap.nq")
|
17
20
|
|
18
21
|
# Instantiate a new aggregate repo based on an existing repo
|
19
22
|
aggregate = RDF::AggregateRepo.new(repo)
|
20
23
|
|
21
24
|
# Use the default graph from the repo as the default graph of the aggregate
|
22
|
-
aggregate.
|
25
|
+
aggregate.default(false)
|
23
26
|
|
24
27
|
# Use a single named graph
|
25
|
-
aggregate.
|
28
|
+
aggregate.named(RDF::URI("https://greggkellogg.net/foaf#me"))
|
26
29
|
|
27
30
|
# Retrieve all contexts
|
28
|
-
aggreggate.
|
31
|
+
aggreggate.aggregate.graph_names #=> [RDF::URI("https://greggkellogg.net/foaf#me")]
|
29
32
|
|
30
33
|
## Dependencies
|
31
34
|
|
32
|
-
* [Ruby](
|
33
|
-
* [RDF.rb][] (
|
35
|
+
* [Ruby](https://ruby-lang.org/) (>= 2.6)
|
36
|
+
* [RDF.rb][] (~> 3.2)
|
34
37
|
|
35
38
|
## Mailing List
|
36
39
|
|
37
|
-
* <
|
40
|
+
* <https://lists.w3.org/Archives/Public/public-rdf-ruby/>
|
38
41
|
|
39
42
|
## Author
|
40
43
|
|
41
|
-
* [Gregg Kellogg](
|
44
|
+
* [Gregg Kellogg](https://github.com/gkellogg) - <https://greggkellogg.net/>
|
42
45
|
|
43
46
|
## Contributing
|
44
47
|
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.
|
@@ -56,15 +59,17 @@ This repository uses [Git Flow](https://github.com/nvie/gitflow) to mange develo
|
|
56
59
|
enough, be assured we will eventually add you in there.
|
57
60
|
* Do note that in order for us to merge any non-trivial changes (as a rule
|
58
61
|
of thumb, additions larger than about 15 lines of code), we need an
|
59
|
-
explicit [public domain dedication][PDD] on record from you
|
62
|
+
explicit [public domain dedication][PDD] on record from you,
|
63
|
+
which you will be asked to agree to on the first commit to a repo within the organization.
|
64
|
+
Note that the agreement applies to all repos in the [Ruby RDF](https://github.com/ruby-rdf/) organization.
|
60
65
|
|
61
66
|
## License
|
62
67
|
|
63
68
|
This is free and unencumbered public domain software. For more information,
|
64
|
-
see <
|
69
|
+
see <https://unlicense.org/> or the accompanying {file:UNLICENSE} file.
|
65
70
|
|
66
|
-
[RDF.rb]:
|
71
|
+
[RDF.rb]: https://ruby-rdf.github.io/
|
67
72
|
[RDF Datasets]: https://www.w3.org/TR/rdf11-concepts/#dfn-rdf-dataset
|
68
|
-
[YARD]:
|
69
|
-
[YARD-GS]:
|
70
|
-
[PDD]:
|
73
|
+
[YARD]: https://yardoc.org/
|
74
|
+
[YARD-GS]: https://rubydoc.info/docs/yard/file/docs/GettingStarted.md
|
75
|
+
[PDD]: https://unlicense.org/#unlicensing-contributions
|
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 <
|
24
|
+
For more information, please refer to <https://unlicense.org/>
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.2.1
|
data/etc/doap.ttl
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
@base <https://rubygems.org/gems/rdf-aggregate-repo> .
|
1
2
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
2
3
|
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
3
4
|
@prefix dc: <http://purl.org/dc/terms/> .
|
@@ -7,27 +8,24 @@
|
|
7
8
|
@prefix ex: <http://example.org/> .
|
8
9
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
9
10
|
|
10
|
-
|
11
|
+
<> a doap:Project, earl:Software ;
|
11
12
|
doap:name "RDF::AggregateRepo" ;
|
12
|
-
doap:homepage <
|
13
|
-
doap:license <
|
14
|
-
doap:
|
15
|
-
doap:
|
13
|
+
doap:homepage <https://github.com/ruby-rdf/rdf-aggregate-repo> ;
|
14
|
+
doap:license <https://unlicense.org/1.0/> ;
|
15
|
+
doap:description "An aggregate RDF::Repository supporting a subset of named graphs and zero or more named graphs mapped to the default graph."@en ;
|
16
|
+
doap:shortdesc "RDF::AggregateRepo extends RDF.rb with SPARQL dataset construction semantics."@en ;
|
16
17
|
doap:created "2013-04-26"^^xsd:date ;
|
17
18
|
doap:programming-language "Ruby" ;
|
18
|
-
doap:implements <
|
19
|
-
doap:category <
|
20
|
-
<
|
21
|
-
doap:download-page
|
22
|
-
doap:mailing-list <
|
23
|
-
doap:bug-database <
|
24
|
-
doap:blog <
|
25
|
-
doap:developer <
|
26
|
-
doap:maintainer <
|
27
|
-
doap:documenter <
|
28
|
-
foaf:maker <
|
29
|
-
dc:
|
30
|
-
dc:
|
31
|
-
dc:date "2013-04-26"^^xsd:date ;
|
32
|
-
dc:creator <http://greggkellogg.net/foaf#me> ;
|
33
|
-
dc:isPartOf <http://rubygems.org/gems/rdf> .
|
19
|
+
doap:implements <https://www.w3.org/TR/sparql11-query/#specifyingDataset> ;
|
20
|
+
doap:category <https://dbpedia.org/resource/Resource_Description_Framework>,
|
21
|
+
<https://dbpedia.org/resource/Ruby_(programming_language)> ;
|
22
|
+
doap:download-page <> ;
|
23
|
+
doap:mailing-list <https://lists.w3.org/Archives/Public/public-rdf-ruby/> ;
|
24
|
+
doap:bug-database <https://github.com/ruby-rdf/rdf-aggregate-repo/issues> ;
|
25
|
+
doap:blog <https://greggkellogg.net/> ;
|
26
|
+
doap:developer <https://greggkellogg.net/foaf#me> ;
|
27
|
+
doap:maintainer <https://greggkellogg.net/foaf#me> ;
|
28
|
+
doap:documenter <https://greggkellogg.net/foaf#me> ;
|
29
|
+
foaf:maker <https://greggkellogg.net/foaf#me> ;
|
30
|
+
dc:creator <https://greggkellogg.net/foaf#me> ;
|
31
|
+
dc:isPartOf <https://rubygems.org/gems/rdf> .
|
@@ -18,7 +18,7 @@ module RDF
|
|
18
18
|
# name false
|
19
19
|
# end
|
20
20
|
#
|
21
|
-
# @see
|
21
|
+
# @see https://www.w3.org/TR/rdf11-mt/#dfn-merge
|
22
22
|
class MergeGraph
|
23
23
|
include RDF::Value
|
24
24
|
include RDF::Countable
|
@@ -40,16 +40,14 @@ module RDF
|
|
40
40
|
##
|
41
41
|
# Create a new aggregation instance.
|
42
42
|
#
|
43
|
-
# @
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
|
49
|
-
# @yieldreturn [void] ignored
|
50
|
-
def initialize(options = {}, &block)
|
43
|
+
# @param [RDF::Resource] graph_name
|
44
|
+
# @param [RDF::Resource] name alias for `graph_name`
|
45
|
+
# @yield merger
|
46
|
+
# @yieldparam [RDF::MergeGraph] self
|
47
|
+
# @yieldreturn [void] ignored
|
48
|
+
def initialize(graph_name: nil, name: nil, &block)
|
51
49
|
@sources = []
|
52
|
-
@graph_name =
|
50
|
+
@graph_name = graph_name || name
|
53
51
|
|
54
52
|
if block_given?
|
55
53
|
case block.arity
|
@@ -186,12 +184,12 @@ module RDF
|
|
186
184
|
##
|
187
185
|
# @private
|
188
186
|
# @see RDF::Queryable#query_pattern
|
189
|
-
def query_pattern(pattern, options
|
190
|
-
return enum_for(:query_pattern, pattern, options) unless block_given?
|
187
|
+
def query_pattern(pattern, **options, &block)
|
188
|
+
return enum_for(:query_pattern, pattern, **options) unless block_given?
|
191
189
|
pattern = pattern.dup
|
192
190
|
sources.each do |(source, gn)|
|
193
191
|
pattern.graph_name = gn
|
194
|
-
source.send(:query_pattern, pattern, options, &block)
|
192
|
+
source.send(:query_pattern, pattern, **options, &block)
|
195
193
|
end
|
196
194
|
end
|
197
195
|
end
|
data/lib/rdf/aggregate_repo.rb
CHANGED
@@ -52,7 +52,7 @@ module RDF
|
|
52
52
|
##
|
53
53
|
# Create a new aggregation instance.
|
54
54
|
#
|
55
|
-
# @overload initialize(queryable = [], options
|
55
|
+
# @overload initialize(queryable = [], **options)
|
56
56
|
# @param [Array<RDF::Queryable>] queryable ([])
|
57
57
|
# @param [Hash{Symbol => Object}] options ({})
|
58
58
|
# @yield aggregation
|
@@ -268,9 +268,9 @@ module RDF
|
|
268
268
|
# Otherwise, create a MergeGraph from the set of pairs of source and graph_name
|
269
269
|
RDF::MergeGraph.new(name: nil) do |graph|
|
270
270
|
if defaults == [false]
|
271
|
-
|
271
|
+
sources.each do |s|
|
272
272
|
# Add default graph from each source
|
273
|
-
source s, false
|
273
|
+
graph.source s, false
|
274
274
|
end
|
275
275
|
else
|
276
276
|
defaults.each do |graph_name|
|
@@ -297,26 +297,26 @@ module RDF
|
|
297
297
|
# @yieldreturn [void] ignored
|
298
298
|
# @return [void] ignored
|
299
299
|
# @see RDF::Queryable#query_pattern
|
300
|
-
def query_pattern(pattern, options
|
301
|
-
return enum_for(:query_pattern, pattern, options) unless block_given?
|
300
|
+
def query_pattern(pattern, **options, &block)
|
301
|
+
return enum_for(:query_pattern, pattern, **options) unless block_given?
|
302
302
|
case pattern.graph_name
|
303
303
|
when nil
|
304
304
|
# Query against all graphs
|
305
|
-
each_graph {|graph| graph.send(:query_pattern, pattern, options, &block)}
|
305
|
+
each_graph {|graph| graph.send(:query_pattern, pattern, **options, &block)}
|
306
306
|
when FalseClass
|
307
307
|
# Query against default graph only
|
308
|
-
default_graph.send(:query_pattern, pattern, options, &block)
|
308
|
+
default_graph.send(:query_pattern, pattern, **options, &block)
|
309
309
|
when RDF::Query::Variable
|
310
310
|
# Query against all named graphs
|
311
311
|
each_graph do |graph|
|
312
312
|
source = sources.reverse.detect {|s| s.has_graph?(graph.graph_name)}
|
313
|
-
RDF::Graph.new(graph_name: graph.graph_name, data: source).send(:query_pattern, pattern, options, &block)
|
313
|
+
RDF::Graph.new(graph_name: graph.graph_name, data: source).send(:query_pattern, pattern, **options, &block)
|
314
314
|
end
|
315
315
|
else
|
316
316
|
# Query against a specific graph
|
317
317
|
if @named_graphs.include?(pattern.graph_name)
|
318
318
|
source = sources.reverse.detect {|s| s.has_graph?(pattern.graph_name)}
|
319
|
-
RDF::Graph.new(graph_name: pattern.graph_name, data: source).send(:query_pattern, pattern, options, &block)
|
319
|
+
RDF::Graph.new(graph_name: pattern.graph_name, data: source).send(:query_pattern, pattern, **options, &block)
|
320
320
|
end
|
321
321
|
end
|
322
322
|
end
|
metadata
CHANGED
@@ -1,103 +1,85 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdf-aggregate-repo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregg Kellogg
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdf
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '2.2'
|
20
|
-
- - "<"
|
17
|
+
- - "~>"
|
21
18
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
19
|
+
version: '3.2'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
|
-
- - "
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '2.2'
|
30
|
-
- - "<"
|
24
|
+
- - "~>"
|
31
25
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
26
|
+
version: '3.2'
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
28
|
name: rdf-spec
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
36
30
|
requirements:
|
37
|
-
- - "
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
version: '2.2'
|
40
|
-
- - "<"
|
31
|
+
- - "~>"
|
41
32
|
- !ruby/object:Gem::Version
|
42
|
-
version: '
|
33
|
+
version: '3.2'
|
43
34
|
type: :development
|
44
35
|
prerelease: false
|
45
36
|
version_requirements: !ruby/object:Gem::Requirement
|
46
37
|
requirements:
|
47
|
-
- - "
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
version: '2.2'
|
50
|
-
- - "<"
|
38
|
+
- - "~>"
|
51
39
|
- !ruby/object:Gem::Version
|
52
|
-
version: '
|
40
|
+
version: '3.2'
|
53
41
|
- !ruby/object:Gem::Dependency
|
54
42
|
name: rdf-turtle
|
55
43
|
requirement: !ruby/object:Gem::Requirement
|
56
44
|
requirements:
|
57
|
-
- - "
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
version: '2.2'
|
60
|
-
- - "<"
|
45
|
+
- - "~>"
|
61
46
|
- !ruby/object:Gem::Version
|
62
|
-
version: '
|
47
|
+
version: '3.2'
|
63
48
|
type: :development
|
64
49
|
prerelease: false
|
65
50
|
version_requirements: !ruby/object:Gem::Requirement
|
66
51
|
requirements:
|
67
|
-
- - "
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '2.2'
|
70
|
-
- - "<"
|
52
|
+
- - "~>"
|
71
53
|
- !ruby/object:Gem::Version
|
72
|
-
version: '
|
54
|
+
version: '3.2'
|
73
55
|
- !ruby/object:Gem::Dependency
|
74
56
|
name: rspec
|
75
57
|
requirement: !ruby/object:Gem::Requirement
|
76
58
|
requirements:
|
77
59
|
- - "~>"
|
78
60
|
- !ruby/object:Gem::Version
|
79
|
-
version: '3.
|
61
|
+
version: '3.10'
|
80
62
|
type: :development
|
81
63
|
prerelease: false
|
82
64
|
version_requirements: !ruby/object:Gem::Requirement
|
83
65
|
requirements:
|
84
66
|
- - "~>"
|
85
67
|
- !ruby/object:Gem::Version
|
86
|
-
version: '3.
|
68
|
+
version: '3.10'
|
87
69
|
- !ruby/object:Gem::Dependency
|
88
70
|
name: rspec-its
|
89
71
|
requirement: !ruby/object:Gem::Requirement
|
90
72
|
requirements:
|
91
73
|
- - "~>"
|
92
74
|
- !ruby/object:Gem::Version
|
93
|
-
version: '1.
|
75
|
+
version: '1.3'
|
94
76
|
type: :development
|
95
77
|
prerelease: false
|
96
78
|
version_requirements: !ruby/object:Gem::Requirement
|
97
79
|
requirements:
|
98
80
|
- - "~>"
|
99
81
|
- !ruby/object:Gem::Version
|
100
|
-
version: '1.
|
82
|
+
version: '1.3'
|
101
83
|
- !ruby/object:Gem::Dependency
|
102
84
|
name: yard
|
103
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -126,11 +108,16 @@ files:
|
|
126
108
|
- lib/rdf/aggregate_repo.rb
|
127
109
|
- lib/rdf/aggregate_repo/merge_graph.rb
|
128
110
|
- lib/rdf/aggregate_repo/version.rb
|
129
|
-
homepage:
|
111
|
+
homepage: https://github.com/ruby-rdf/rdf-aggregate-repo
|
130
112
|
licenses:
|
131
113
|
- Unlicense
|
132
|
-
metadata:
|
133
|
-
|
114
|
+
metadata:
|
115
|
+
documentation_uri: https://ruby-rdf.github.io/rdf-aggregate-repo
|
116
|
+
bug_tracker_uri: https://github.com/ruby-rdf/rdf-aggregate-repo/issues
|
117
|
+
homepage_uri: https://github.com/ruby-rdf/rdf-aggregate-repo
|
118
|
+
mailing_list_uri: https://lists.w3.org/Archives/Public/public-rdf-ruby/
|
119
|
+
source_code_uri: https://github.com/ruby-rdf/rdf-aggregate-repo
|
120
|
+
post_install_message:
|
134
121
|
rdoc_options: []
|
135
122
|
require_paths:
|
136
123
|
- lib
|
@@ -138,16 +125,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
138
125
|
requirements:
|
139
126
|
- - ">="
|
140
127
|
- !ruby/object:Gem::Version
|
141
|
-
version: 2.
|
128
|
+
version: '2.6'
|
142
129
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
143
130
|
requirements:
|
144
131
|
- - ">="
|
145
132
|
- !ruby/object:Gem::Version
|
146
133
|
version: '0'
|
147
134
|
requirements: []
|
148
|
-
|
149
|
-
|
150
|
-
signing_key:
|
135
|
+
rubygems_version: 3.3.3
|
136
|
+
signing_key:
|
151
137
|
specification_version: 4
|
152
138
|
summary: An aggregate RDF::Repository supporting a subset of named graphs and zero
|
153
139
|
or more named graphs mapped to the default graph.
|