kalimba-redlander 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kalimba/persistence/redlander.rb +16 -6
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f334dd20b43f4ce21786b1a96300c0738fd6f74
|
4
|
+
data.tar.gz: c7d5319d17aceaff07abd672ccd21092c21bfa8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0492b159a22ee99d07716b38260a29d5d0cfb3517bccfedd770403d2326ef30fc7973007d37e2261e42313259a736ebc7ae607f08635f68842077ef4a20af673
|
7
|
+
data.tar.gz: a500b81ae68939bb4e1d48e2fd1bb2c166522c536dbc06d69792a8abe94dedced554855561f72b6726f938da7188343b1ca9b0ddada608569f6ca20cc294e17b
|
@@ -227,14 +227,21 @@ module Kalimba
|
|
227
227
|
end
|
228
228
|
|
229
229
|
def store_single_value(value, predicate, datatype, options = {})
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
if value
|
234
|
-
|
230
|
+
# TODO: check for the types that are acceptable by the property,
|
231
|
+
# not the types of values themselves!
|
232
|
+
if value.is_a?(Kalimba::Resource)
|
233
|
+
if store_single_resource(value, options)
|
234
|
+
# proceed with the saved association
|
235
|
+
value = value.subject
|
235
236
|
else
|
236
|
-
|
237
|
+
# could not save the association, bail out
|
238
|
+
return false
|
237
239
|
end
|
240
|
+
else
|
241
|
+
value = type_cast_to_rdf(value, datatype)
|
242
|
+
end
|
243
|
+
|
244
|
+
# TODO: This doesn't persist "false". Should it?
|
238
245
|
if value
|
239
246
|
statement = ::Redlander::Statement.new(:subject => subject, :predicate => predicate, :object => ::Redlander::Node.new(value))
|
240
247
|
Kalimba.repository.statements.add(statement)
|
@@ -250,6 +257,9 @@ module Kalimba
|
|
250
257
|
if options[:parent_subject] != resource.subject &&
|
251
258
|
must_be_persisted?(resource)
|
252
259
|
resource.save(:parent_subject => subject)
|
260
|
+
else
|
261
|
+
# no save was required and that's not an error
|
262
|
+
true
|
253
263
|
end
|
254
264
|
end
|
255
265
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kalimba-redlander
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Slava Kravchenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kalimba
|
@@ -68,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
68
68
|
version: '0'
|
69
69
|
requirements: []
|
70
70
|
rubyforge_project:
|
71
|
-
rubygems_version: 2.0.
|
71
|
+
rubygems_version: 2.0.3
|
72
72
|
signing_key:
|
73
73
|
specification_version: 4
|
74
74
|
summary: Redlander adapter for Kalimba
|