ld-patch 0.2.0 → 0.3.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 371b6d34bdb207618298e9f2f60f5a10b010484f
4
- data.tar.gz: 497d55eef1f34d816511544929f353bd0816e911
3
+ metadata.gz: c8f49cec807395e10261501e6d5913c25fa11967
4
+ data.tar.gz: f4effd1ab9acb46a5b798535f40e9c8605a0930b
5
5
  SHA512:
6
- metadata.gz: 1328080ed6850fc375328667a031a8da28d917f07aa98e6dba09ae3aee14298d358de4d17a1b9f66bd9a3825820b7f528d9b4e942de1807cf9eb37e83cc40832
7
- data.tar.gz: 4cedf17c2981bc4617c25da235ea3011eafd3660ae6d671692a995238f1accc0cdf796aa104d3cf107b8af8d91fee551f1847917190c3e93a7619a8fe92dfa59
6
+ metadata.gz: 0e6386aee4c2736708975fdea80b1117b9a005cb69a90557dd9c28c0697ed51632a7b69f356458003741cd55e183edb5447f8300974e46f79249952ee862da57
7
+ data.tar.gz: 4cfbe0f022d1e0def50ea11f249abff7bbc0b0a9e03a05d8281dac312a155a100acf19a774398a14c75ba75ddcd70fe7505a61e083810bb7a97af0c2a7649868
data/README.md CHANGED
@@ -61,11 +61,11 @@ The parser takes branch and follow tables generated from the [LD Patch Grammar](
61
61
  ## Dependencies
62
62
 
63
63
  * [Ruby](http://ruby-lang.org/) (>= 2.0.0)
64
- * [RDF.rb](http://rubygems.org/gems/rdf) (>= 1.1.15)
65
- * [EBNF][] (>= 0.3.0)
66
- * [SPARQL][] (>= 1.1.7)
67
- * [SXP][] (>= 0.1.5)
68
- * [RDF::XSD][] (>= 1.1.4)
64
+ * [RDF.rb](http://rubygems.org/gems/rdf) (~> 2.0)
65
+ * [EBNF][] (~> 1.0)
66
+ * [SPARQL][] (~> 2.0)
67
+ * [SXP][] (~> 0.1.6)
68
+ * [RDF::XSD][] (~> 2.0)
69
69
 
70
70
  ## Mailing List
71
71
  * <http://lists.w3.org/Archives/Public/public-rdf-ruby/>
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.3.0.beta1
@@ -24,7 +24,7 @@ module LD::Patch::Algebra
24
24
  index = operand(0)
25
25
 
26
26
  results = terms.map do |term|
27
- list = RDF::List.new(term, queryable)
27
+ list = RDF::List.new(subject: term, graph: queryable)
28
28
  list.at(index.to_i)
29
29
  end.flatten
30
30
 
@@ -10,31 +10,25 @@ module LD::Patch::Algebra
10
10
  NAME = :patch
11
11
 
12
12
  ##
13
- # Executes this upate on the given `writable` graph or repository.
13
+ # Executes this upate on the given `transactable` graph or repository.
14
14
  #
15
- # @param [RDF::Queryable] queryable
16
- # the graph or repository to write
15
+ # @param [RDF::Transactable] graph
16
+ # the graph to update.
17
17
  # @param [Hash{Symbol => Object}] options
18
18
  # any additional options
19
- # @return [RDF::Queryable]
20
- # Returns queryable.
19
+ # @return [RDF::Transactable]
20
+ # Returns graph.
21
21
  # @raise [Error]
22
22
  # If any error is caught along the way, and rolls back the transaction
23
- def execute(queryable, options = {})
23
+ def execute(graph, options = {})
24
24
  debug(options) {"Delete"}
25
25
 
26
- # FIXME: due to insufficient transaction support, this is implemented by running through operands twice: the first using a clone of the graph, and the second acting on the graph directly
27
- graph = RDF::Graph.new << queryable
28
- loop do
26
+ graph.transaction(mutable: true) do |tx|
29
27
  operands.inject(RDF::Query::Solutions.new([RDF::Query::Solution.new])) do |bindings, op|
30
28
  # Invoke operand using bindings from prvious operation
31
- op.execute(graph, options.merge(bindings: bindings))
29
+ op.execute(tx, options.merge(bindings: bindings))
32
30
  end
33
-
34
- break if graph.equal?(queryable)
35
- graph = queryable
36
31
  end
37
- queryable
38
32
  end
39
33
  end
40
34
  end
@@ -40,7 +40,7 @@ module LD::Patch::Algebra
40
40
  raise LD::Patch::Error, "UpdateList ambigious value for #{var_or_iri.to_ntriples} and #{predicate.to_ntriples}" if list_heads.length > 1
41
41
  raise LD::Patch::Error, "UpdateList no value found for #{var_or_iri.to_ntriples} and #{predicate.to_ntriples}" if list_heads.empty?
42
42
  lh = list_heads.first
43
- list = RDF::List.new(lh, queryable)
43
+ list = RDF::List.new(subject: lh, graph: queryable)
44
44
  raise LD::Patch::Error, "Invalid list" unless list.valid?
45
45
 
46
46
  start = case
@@ -261,7 +261,7 @@ module LD::Patch
261
261
  else
262
262
  debug("object") {"current: #{current.inspect}"}
263
263
  object = current[:resource] || current[:literal] || current[:iri]
264
- (input[:triples] ||= []) << RDF::Query::Pattern.new(input[:subject], input[:predicate], object)
264
+ (input[:triples] ||= []) << RDF::Query::Pattern.new(subject: input[:subject], predicate: input[:predicate], object: object)
265
265
  end
266
266
  end
267
267
 
metadata CHANGED
@@ -1,35 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ld-patch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregg Kellogg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-02 00:00:00.000000000 Z
11
+ date: 2016-02-22 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: '1.1'
20
17
  - - ">="
21
18
  - !ruby/object:Gem::Version
22
- version: 1.1.15
19
+ version: 2.0.0.beta
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '3'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - "~>"
28
- - !ruby/object:Gem::Version
29
- version: '1.1'
30
27
  - - ">="
31
28
  - !ruby/object:Gem::Version
32
- version: 1.1.15
29
+ version: 2.0.0.beta
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '3'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: ebnf
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -37,6 +37,9 @@ dependencies:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
39
  version: '1.0'
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 1.0.1beta
40
43
  type: :runtime
41
44
  prerelease: false
42
45
  version_requirements: !ruby/object:Gem::Requirement
@@ -44,96 +47,123 @@ dependencies:
44
47
  - - "~>"
45
48
  - !ruby/object:Gem::Version
46
49
  version: '1.0'
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 1.0.1beta
47
53
  - !ruby/object:Gem::Dependency
48
54
  name: sparql
49
55
  requirement: !ruby/object:Gem::Requirement
50
56
  requirements:
51
- - - "~>"
52
- - !ruby/object:Gem::Version
53
- version: '1.1'
54
57
  - - ">="
55
58
  - !ruby/object:Gem::Version
56
- version: 1.1.7
59
+ version: 2.0.0.beta
60
+ - - "<"
61
+ - !ruby/object:Gem::Version
62
+ version: '3'
57
63
  type: :runtime
58
64
  prerelease: false
59
65
  version_requirements: !ruby/object:Gem::Requirement
60
66
  requirements:
61
- - - "~>"
62
- - !ruby/object:Gem::Version
63
- version: '1.1'
64
67
  - - ">="
65
68
  - !ruby/object:Gem::Version
66
- version: 1.1.7
69
+ version: 2.0.0.beta
70
+ - - "<"
71
+ - !ruby/object:Gem::Version
72
+ version: '3'
67
73
  - !ruby/object:Gem::Dependency
68
74
  name: sxp
69
75
  requirement: !ruby/object:Gem::Requirement
70
76
  requirements:
71
- - - "~>"
77
+ - - ">="
72
78
  - !ruby/object:Gem::Version
73
- version: '0.1'
79
+ version: 1.0.0.beta
80
+ - - "<"
81
+ - !ruby/object:Gem::Version
82
+ version: '2'
74
83
  type: :runtime
75
84
  prerelease: false
76
85
  version_requirements: !ruby/object:Gem::Requirement
77
86
  requirements:
78
- - - "~>"
87
+ - - ">="
79
88
  - !ruby/object:Gem::Version
80
- version: '0.1'
89
+ version: 1.0.0.beta
90
+ - - "<"
91
+ - !ruby/object:Gem::Version
92
+ version: '2'
81
93
  - !ruby/object:Gem::Dependency
82
94
  name: rdf-xsd
83
95
  requirement: !ruby/object:Gem::Requirement
84
96
  requirements:
85
- - - "~>"
97
+ - - ">="
86
98
  - !ruby/object:Gem::Version
87
- version: '1.1'
99
+ version: 2.0.0.beta
100
+ - - "<"
101
+ - !ruby/object:Gem::Version
102
+ version: '3'
88
103
  type: :runtime
89
104
  prerelease: false
90
105
  version_requirements: !ruby/object:Gem::Requirement
91
106
  requirements:
92
- - - "~>"
107
+ - - ">="
93
108
  - !ruby/object:Gem::Version
94
- version: '1.1'
109
+ version: 2.0.0.beta
110
+ - - "<"
111
+ - !ruby/object:Gem::Version
112
+ version: '3'
95
113
  - !ruby/object:Gem::Dependency
96
- name: rack
114
+ name: json-ld
97
115
  requirement: !ruby/object:Gem::Requirement
98
116
  requirements:
99
- - - "~>"
117
+ - - ">="
100
118
  - !ruby/object:Gem::Version
101
- version: '1.6'
119
+ version: 2.0.0.beta
120
+ - - "<"
121
+ - !ruby/object:Gem::Version
122
+ version: '3'
102
123
  type: :development
103
124
  prerelease: false
104
125
  version_requirements: !ruby/object:Gem::Requirement
105
126
  requirements:
106
- - - "~>"
127
+ - - ">="
107
128
  - !ruby/object:Gem::Version
108
- version: '1.6'
129
+ version: 2.0.0.beta
130
+ - - "<"
131
+ - !ruby/object:Gem::Version
132
+ version: '3'
109
133
  - !ruby/object:Gem::Dependency
110
- name: linkeddata
134
+ name: rack
111
135
  requirement: !ruby/object:Gem::Requirement
112
136
  requirements:
113
137
  - - "~>"
114
138
  - !ruby/object:Gem::Version
115
- version: '1.1'
139
+ version: '1.6'
116
140
  type: :development
117
141
  prerelease: false
118
142
  version_requirements: !ruby/object:Gem::Requirement
119
143
  requirements:
120
144
  - - "~>"
121
145
  - !ruby/object:Gem::Version
122
- version: '1.1'
146
+ version: '1.6'
123
147
  - !ruby/object:Gem::Dependency
124
148
  name: rdf-spec
125
149
  requirement: !ruby/object:Gem::Requirement
126
150
  requirements:
127
- - - "~>"
151
+ - - ">="
128
152
  - !ruby/object:Gem::Version
129
- version: '1.1'
153
+ version: 2.0.0.beta
154
+ - - "<"
155
+ - !ruby/object:Gem::Version
156
+ version: '3'
130
157
  type: :development
131
158
  prerelease: false
132
159
  version_requirements: !ruby/object:Gem::Requirement
133
160
  requirements:
134
- - - "~>"
161
+ - - ">="
135
162
  - !ruby/object:Gem::Version
136
- version: '1.1'
163
+ version: 2.0.0.beta
164
+ - - "<"
165
+ - !ruby/object:Gem::Version
166
+ version: '3'
137
167
  - !ruby/object:Gem::Dependency
138
168
  name: open-uri-cached
139
169
  requirement: !ruby/object:Gem::Requirement
@@ -160,14 +190,14 @@ dependencies:
160
190
  requirements:
161
191
  - - "~>"
162
192
  - !ruby/object:Gem::Version
163
- version: '3.2'
193
+ version: '3.4'
164
194
  type: :development
165
195
  prerelease: false
166
196
  version_requirements: !ruby/object:Gem::Requirement
167
197
  requirements:
168
198
  - - "~>"
169
199
  - !ruby/object:Gem::Version
170
- version: '3.2'
200
+ version: '3.4'
171
201
  - !ruby/object:Gem::Dependency
172
202
  name: rspec-its
173
203
  requirement: !ruby/object:Gem::Requirement
@@ -202,18 +232,18 @@ dependencies:
202
232
  requirements:
203
233
  - - "~>"
204
234
  - !ruby/object:Gem::Version
205
- version: '1.17'
235
+ version: '1.22'
206
236
  type: :development
207
237
  prerelease: false
208
238
  version_requirements: !ruby/object:Gem::Requirement
209
239
  requirements:
210
240
  - - "~>"
211
241
  - !ruby/object:Gem::Version
212
- version: '1.17'
242
+ version: '1.22'
213
243
  description: |2-
214
244
 
215
245
  Implements the W3C Linked Data Patch Format and operations for RDF.rb.
216
- Makes use of the SPARQL gem for performing updates
246
+ Makes use of the SPARQL gem for performing updates.
217
247
  email: public-rdf-ruby@w3.org
218
248
  executables: []
219
249
  extensions: []
@@ -243,7 +273,7 @@ files:
243
273
  - lib/ld/patch/version.rb
244
274
  homepage: http://github.com/ruby-rdf/ld-patch
245
275
  licenses:
246
- - Public Domain
276
+ - Unlicense
247
277
  metadata: {}
248
278
  post_install_message:
249
279
  rdoc_options: []
@@ -256,12 +286,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
256
286
  version: 2.0.0
257
287
  required_rubygems_version: !ruby/object:Gem::Requirement
258
288
  requirements:
259
- - - ">="
289
+ - - ">"
260
290
  - !ruby/object:Gem::Version
261
- version: '0'
291
+ version: 1.3.1
262
292
  requirements: []
263
293
  rubyforge_project: ld-patch
264
- rubygems_version: 2.4.7
294
+ rubygems_version: 2.5.1
265
295
  signing_key:
266
296
  specification_version: 4
267
297
  summary: W3C Linked Data Patch Format for RDF.rb.