active-triples 0.8.2 → 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +5 -0
- data/README.md +2 -2
- data/lib/active_triples/rdf_source.rb +5 -3
- data/lib/active_triples/version.rb +1 -1
- data/spec/active_triples/rdf_source_spec.rb +11 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e5f2613056c5a3c387e70be11cc9fb50b9cd393
|
4
|
+
data.tar.gz: dc0e52ebd00177b57c4313521f315dd19904f1bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba8ad6bba1662025aa0d05d5453c33baf936fec13ec0cfff253c90ccfd656863e6e5d5fb15f0006fc55e54f5620dbcc8b51332827f3a3e6606b4d4b13cab2f05
|
7
|
+
data.tar.gz: e57aa3d51ff48e29f05be92e7df8fefe974fa2dda4f84e3dbe76af27a495896180c19db3fbb340a72c3bc49630906e0bc76feeaa0992903af54b38caf4a38f78
|
data/CHANGES.md
CHANGED
data/README.md
CHANGED
@@ -68,7 +68,7 @@ related << RDF::Statement(related, RDF::DC.subject, 'ActiveTriples')
|
|
68
68
|
|
69
69
|
related.query(:subject => related, :predicate => RDF::DC.relation).each_statement {|s,p,o| puts o}
|
70
70
|
# => http://example.org/things#123
|
71
|
-
related.query(:subject =>
|
71
|
+
related.query(:subject => related, :predicate => RDF::DC.subject).each_statement {|s,p,o| puts o}
|
72
72
|
# => http://example.org/things#123
|
73
73
|
```
|
74
74
|
|
@@ -92,7 +92,7 @@ require 'linkeddata' # to support various serializations
|
|
92
92
|
osu = ActiveTriples::Resource.new 'http://dbpedia.org/resource/Oregon_State_University'
|
93
93
|
osu.fetch
|
94
94
|
|
95
|
-
osu.rdf_label
|
95
|
+
osu.rdf_label # => ["Oregon State University", "Oregon State University", "Université d'État de l'Oregon", "Oregon State University", "Oregon State University", "オレゴン州立大学", "Universidad Estatal de Oregón", "Oregon State University", "俄勒岡州立大學", "Universidade do Estado do Oregon"]
|
96
96
|
```
|
97
97
|
|
98
98
|
Typed Data
|
@@ -586,9 +586,11 @@ module ActiveTriples
|
|
586
586
|
#
|
587
587
|
# @return [Array<RDF::URI>]
|
588
588
|
def unregistered_predicates
|
589
|
-
|
590
|
-
|
591
|
-
|
589
|
+
registered_preds = registered_predicates
|
590
|
+
registered_preds << RDF.type
|
591
|
+
unregistered_preds = []
|
592
|
+
each_statement { |s,p,o| unregistered_preds << p unless (s != rdf_subject) || (registered_preds.include? p) }
|
593
|
+
unregistered_preds
|
592
594
|
end
|
593
595
|
|
594
596
|
def default_labels
|
@@ -171,6 +171,17 @@ describe ActiveTriples::RDFSource do
|
|
171
171
|
expect(subject.attributes['creator']).to contain_exactly 'moomin'
|
172
172
|
end
|
173
173
|
end
|
174
|
+
|
175
|
+
context 'with statements for other subjects' do
|
176
|
+
before do
|
177
|
+
subject << RDF::Statement(RDF::URI('http://example.org/OTHER_SUBJECT'), RDF::URI('http://example.org/ontology/OTHER_PRED'), 'OTHER_OBJECT')
|
178
|
+
end
|
179
|
+
|
180
|
+
it "should not include predicate-values for statements with rdf_subject != this object's rdf_subject" do
|
181
|
+
expect(subject.attributes.keys).not_to include 'http://example.org/ontology/OTHER_PRED'
|
182
|
+
expect(subject.attributes.values).not_to include ['OTHER_OBJECT']
|
183
|
+
end
|
184
|
+
end
|
174
185
|
end
|
175
186
|
|
176
187
|
describe '#fetch' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active-triples
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Johnson
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-04
|
12
|
+
date: 2016-05-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rdf
|
@@ -289,8 +289,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
289
289
|
version: '0'
|
290
290
|
requirements: []
|
291
291
|
rubyforge_project:
|
292
|
-
rubygems_version: 2.
|
292
|
+
rubygems_version: 2.2.0
|
293
293
|
signing_key:
|
294
294
|
specification_version: 4
|
295
295
|
summary: RDF graphs in ActiveModel wrappers.
|
296
296
|
test_files: []
|
297
|
+
has_rdoc:
|