grel 0.1.3 → 0.1.4

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.
Files changed (3) hide show
  1. checksums.yaml +9 -9
  2. data/lib/grel/base.rb +17 -0
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZjVjNTYxM2ZiYjliZGNhMTAyMDMyN2NlNThlZDBjNTYxMWFmZDE4Zg==
4
+ ZTI0OTA3YmQwZDAyMTdjODhmZjkwMmM0M2QxM2U1ZGFiMzczNTQ4Yw==
5
5
  data.tar.gz: !binary |-
6
- MTNmMjJjMmE2MjM1M2UxMjExMDAyMWFmMDExMmYyODdlZjE1MDE1ZA==
7
- !binary "U0hBNTEy":
6
+ MjM5N2JmMDViMzM3NDdhMDQxMjEzYzQyZjE5NmUzYWI3NzczNmNlMg==
7
+ SHA512:
8
8
  metadata.gz: !binary |-
9
- ZTMyOGVmYzVmNjEwYjM4MTZhOGYyNDg3ZjMxNTc5YmM5NzBhYmJhOTBiZmQ0
10
- ZDczYjk2YTZjMmM5YTkxNzNmYmJiOWQyZGQ4ZjI1NzQ1YWVjNWU0YTI0Nzc3
11
- ZGZjMzkyNzBmOGUxMDNiY2Q5MmE1NDY2NjQ3MGQ5ZTQzZWM5YmE=
9
+ NjdhODgzNDcwNDFjNDJjYzUzMTEyNzE4NjRlOGJkNmFmMDZhYzUyYmJmOTJj
10
+ NDk1Mjk5MjNhMTk4YzI4MjVlNzEzYzA1ZDI4MDEyMGM5N2FiNmZkMzM2YWY0
11
+ YWZkZTA5YmZiZDQwZGRhMTk0Nzg5MTM3NzUzMGE3MjQxMzg1ODY=
12
12
  data.tar.gz: !binary |-
13
- NTMxMzJhMzIxZDhmYmM5ZjI4MDRkZDNmMGU0MGQ1YmI4ZWY3YTNkMmFjMDY0
14
- M2UxZGQ1NDczNTNhNGFiN2EwZWU0MTFkM2VjZjFlZDcxMDRjYjNlY2I4MTA2
15
- MTBhN2M0OWM2ZTViNTdkMTE3ZmY4OGU3OTNkNjNhZjQyMmRlOWE=
13
+ NzVkNDNhZmYzMzc4NjI0MDYwZDg5NTk4YzgxZTU1ZDcxNDY4NWRmNWI2ZjMy
14
+ YjVjNmViODcyNzQ2MDMwYWY5ODQ3Mzg0NjBmOWE5M2I3NzI5YTcyYzk3NjA4
15
+ ZjA3MDBjMThiMWQyNmEwZDkyOGM2MmQxNTlhOTA3ZDRmMzNjMzk=
@@ -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.3
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-07-26 00:00:00.000000000 Z
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.0.5
56
+ rubygems_version: 2.1.10
57
57
  signing_key:
58
58
  specification_version: 4
59
59
  summary: Ruby object oriented wrapper for Stardog