grel 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +9 -9
- data/lib/grel/base.rb +17 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZTI0OTA3YmQwZDAyMTdjODhmZjkwMmM0M2QxM2U1ZGFiMzczNTQ4Yw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
7
|
-
|
6
|
+
MjM5N2JmMDViMzM3NDdhMDQxMjEzYzQyZjE5NmUzYWI3NzczNmNlMg==
|
7
|
+
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NjdhODgzNDcwNDFjNDJjYzUzMTEyNzE4NjRlOGJkNmFmMDZhYzUyYmJmOTJj
|
10
|
+
NDk1Mjk5MjNhMTk4YzI4MjVlNzEzYzA1ZDI4MDEyMGM5N2FiNmZkMzM2YWY0
|
11
|
+
YWZkZTA5YmZiZDQwZGRhMTk0Nzg5MTM3NzUzMGE3MjQxMzg1ODY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NzVkNDNhZmYzMzc4NjI0MDYwZDg5NTk4YzgxZTU1ZDcxNDY4NWRmNWI2ZjMy
|
14
|
+
YjVjNmViODcyNzQ2MDMwYWY5ODQ3Mzg0NjBmOWE5M2I3NzI5YTcyYzk3NjA4
|
15
|
+
ZjA3MDBjMThiMWQyNmEwZDkyOGM2MmQxNTlhOTA3ZDRmMzNjMzk=
|
data/lib/grel/base.rb
CHANGED
@@ -299,6 +299,23 @@ module GRel
|
|
299
299
|
self
|
300
300
|
end
|
301
301
|
|
302
|
+
# Replaces the selected triples with a new set of triples provided as an
|
303
|
+
# argument in a single atomic operation
|
304
|
+
def update(new_data, options = {})
|
305
|
+
args = {:describe => true}
|
306
|
+
args = {:accept => "application/rdf+xml"}
|
307
|
+
|
308
|
+
sparql = @last_query_context.to_sparql_describe
|
309
|
+
triples = @connection.query(@db_name,sparql, args).body
|
310
|
+
|
311
|
+
success = @connection.with_transaction(@db_name) do |txId|
|
312
|
+
@connection.remove_in_transaction(@db_name, txId, triples, nil, "application/rdf+xml")
|
313
|
+
@connection.add_in_transaction(@db_name, txId, QL.to_turtle(new_data), nil, "text/turtle")
|
314
|
+
end
|
315
|
+
raise Exception.new("Error updating data") unless success
|
316
|
+
self
|
317
|
+
end
|
318
|
+
|
302
319
|
# Executes the current defined query and returns a list of matching noes from the graph.
|
303
320
|
# Nodes will be correctly linked in the returned list.
|
304
321
|
# if the option +:unlinked+ is provided with true value, only the top level nodes that has not incoming links
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Antonio Garrote
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: stardog-rb
|
@@ -53,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
53
53
|
version: '0'
|
54
54
|
requirements: []
|
55
55
|
rubyforge_project:
|
56
|
-
rubygems_version: 2.
|
56
|
+
rubygems_version: 2.1.10
|
57
57
|
signing_key:
|
58
58
|
specification_version: 4
|
59
59
|
summary: Ruby object oriented wrapper for Stardog
|