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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e1f422e5ac96c89ebdaeeb9d97d52ae3d5bfe526
4
- data.tar.gz: b5fd9203d247be04fccab63466eee59bcc9af078
3
+ metadata.gz: 4e5f2613056c5a3c387e70be11cc9fb50b9cd393
4
+ data.tar.gz: dc0e52ebd00177b57c4313521f315dd19904f1bd
5
5
  SHA512:
6
- metadata.gz: 26f27fa5aae3444a211f339c2dcb5dcf26950b31f6f98697b09977f233fe0e23049a245f2ba1b3262b6104caf27b37e254ea5c829fc30f2daea675250ed4988a
7
- data.tar.gz: 22400ed6fd5ace6f4772ca8b1c0ddb5a98e99be0d38fdeac42a8bce900d7cf65226e44c399fd38e1174770d1f040a0a98b4bd0589751fa27194443fa17591c3d
6
+ metadata.gz: ba8ad6bba1662025aa0d05d5453c33baf936fec13ec0cfff253c90ccfd656863e6e5d5fb15f0006fc55e54f5620dbcc8b51332827f3a3e6606b4d4b13cab2f05
7
+ data.tar.gz: e57aa3d51ff48e29f05be92e7df8fefe974fa2dda4f84e3dbe76af27a495896180c19db3fbb340a72c3bc49630906e0bc76feeaa0992903af54b38caf4a38f78
data/CHANGES.md CHANGED
@@ -1,3 +1,8 @@
1
+ 0.8.3
2
+ -----
3
+ - Do not include all predicates from other subjects in unregistered_predicates
4
+ - Minor corrections to README.md
5
+
1
6
  0.8.2
2
7
  -----
3
8
  * Allow PersistenceStrategy set by property config [Tom Johnson]
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 => subject, :predicate => RDF::DC.relation).each_statement {|s,p,o| puts o}
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 => => ["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"]
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
- preds = registered_predicates
590
- preds << RDF.type
591
- predicates.select { |p| !preds.include? p }
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
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ActiveTriples
3
- VERSION = "0.8.2".freeze
3
+ VERSION = '0.8.3'.freeze
4
4
  end
@@ -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.2
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-14 00:00:00.000000000 Z
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.4.5
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: