rdf-isomorphic 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ZDdlMDRiNTc4YTZlNzdkZjgwZTNjMTMyYTRjZDBhZjhjOTY4N2IyOA==
5
+ data.tar.gz: !binary |-
6
+ OTkxMjkyMDcyYWNkZWNmM2YxMmU5NDNiOTI0YTQ5M2UwMjM0MDI0NA==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ NmNlNjFiYzY1MmQwN2UyYTNmY2M5NjkzZTczYzUzYjUxYjkwNmEzZGMxZjFm
10
+ MmYxYjBhYmJjNDA1OWQ4MzA4NzY1YmU5MGU4ZDZhYTEwOTY0NWFkNWM1MmJh
11
+ NTRmMTc2YjA0MDc3YzU1MzU1NzIwN2Q2OGYyYWY4MjkwMzJhZmM=
12
+ data.tar.gz: !binary |-
13
+ ZjE3ZTBjNDllYTEzMzU0MjM1Njc5MGUyZDQyMTllOTFlNjg4YWE2NmE2NWRj
14
+ OTk1MjAzMGRiN2UwZTFkNmU1ODA0ODg0ODVjZWEyY2MwMjdhOTEyODFjOTYw
15
+ ZDk2YjBkYjliNWY5OGEwNzg3ZTM0Zjg4MWU0MzUxNjUxMzYwNzc=
data/README CHANGED
@@ -5,6 +5,8 @@ That includes RDF::Repository, RDF::Graph, query results, and more.
5
5
 
6
6
  For more information about RDF.rb, see <http://rdf.rubyforge.org>
7
7
 
8
+ [![Build Status](https://travis-ci.org/ruby-rdf/rdf-isomorphic.png?branch=master)](https://travis-ci.org/ruby-rdf/rdf-isomorphic)
9
+
8
10
  ## Synopsis:
9
11
 
10
12
  require 'rdf/isomorphic'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1
@@ -9,9 +9,10 @@ module RDF
9
9
  #
10
10
  # RDF::Isomorphic provides the functions isomorphic_with and bijection_to for RDF::Enumerable.
11
11
  #
12
- # @see http://rdf.rubyforge.org
12
+ # @see http://ruby-rdf.github.com/rdf
13
13
  # @see http://www.hpl.hp.com/techreports/2001/HPL-2001-293.pdf
14
14
  module Isomorphic
15
+ autoload :VERSION, 'rdf/isomorphic/version'
15
16
 
16
17
  # Returns `true` if this RDF::Enumerable is isomorphic with another.
17
18
  #
@@ -47,7 +48,7 @@ module RDF
47
48
  # @param opts [Hash<Symbol => Any>] options
48
49
  # @return [Hash, nil]
49
50
  def bijection_to(other, opts = {})
50
-
51
+
51
52
  grounded_stmts_match = (count == other.count)
52
53
 
53
54
  grounded_stmts_match &&= each_statement.all? do | stmt |
@@ -107,8 +108,7 @@ module RDF
107
108
  # conflict, so we don't check them. This is a little bit messy in the
108
109
  # middle of the method, and probably slows down isomorphic checks, but
109
110
  # prevents almost-isomorphic cases from getting nutty.
110
- return nil if these_hashes.values.any? { |hash|
111
- !(other_hashes.values.member?(hash)) }
111
+ return nil if these_hashes.values.any? { |hash| !(other_hashes.values.member?(hash)) }
112
112
  return nil if other_hashes.values.any? { |hash| !(these_hashes.values.member?(hash)) }
113
113
 
114
114
  # Using the created hashes, map nodes to other_nodes
@@ -192,7 +192,7 @@ module RDF
192
192
  # We may have to go over the list multiple times. If a node is marked as
193
193
  # grounded, other nodes can then use it to decide their own state of
194
194
  # grounded.
195
- while hash_needed
195
+ while hash_needed
196
196
  starting_grounded_nodes = hashes.size
197
197
  nodes.each do | node |
198
198
  unless hashes.member? node
@@ -207,10 +207,10 @@ module RDF
207
207
  # as grounded, even if we have not tied them back to a root yet.
208
208
  uniques = {}
209
209
  ungrounded_hashes.each do |node, hash|
210
- uniques[hash] = uniques[hash].is_a?(RDF::Node) ? false : node
210
+ uniques[hash] = uniques.has_key?(hash) ? false : node
211
211
  end
212
212
  uniques.each do |hash, node|
213
- hashes[node] = hash unless node == false
213
+ hashes[node] = hash if node
214
214
  end
215
215
  hash_needed = starting_grounded_nodes != hashes.size
216
216
  end
@@ -238,7 +238,7 @@ module RDF
238
238
  if (statement.object == node) || (statement.subject == node)
239
239
  statement_signatures << hash_string_for(statement, hashes, node, canonicalize)
240
240
  [statement.subject, statement.object].each do | resource |
241
- grounded = false unless grounded(resource, hashes) || resource == node
241
+ grounded = false unless grounded?(resource, hashes) || resource == node
242
242
  end
243
243
  end
244
244
  end
@@ -264,7 +264,7 @@ module RDF
264
264
  # in the given mapping of grounded nodes.
265
265
  # @return [Boolean]
266
266
  # @private
267
- def self.grounded(node, hashes)
267
+ def self.grounded?(node, hashes)
268
268
  (!(node.node?)) || (hashes.member? node)
269
269
  end
270
270
 
@@ -1,16 +1,13 @@
1
1
  module RDF::Isomorphic
2
2
  module VERSION
3
- MAJOR = 0
4
- MINOR = 3
5
- TINY = 3
6
- EXTRA = nil
3
+ VERSION_FILE = File.join(File.expand_path(File.dirname(__FILE__)), "..", "..", "..", "VERSION")
4
+ MAJOR, MINOR, TINY, EXTRA = File.read(VERSION_FILE).chop.split(".")
7
5
 
8
- STRING = [MAJOR, MINOR, TINY].join('.')
9
- STRING << ".#{EXTRA}" if EXTRA
6
+ STRING = [MAJOR, MINOR, TINY, EXTRA].compact.join('.')
10
7
 
11
8
  ##
12
9
  # @return [String]
13
- def self.to_s() STRING end
10
+ def self.to_s() STRING end
14
11
 
15
12
  ##
16
13
  # @return [String]
@@ -18,6 +15,6 @@ module RDF::Isomorphic
18
15
 
19
16
  ##
20
17
  # @return [Array(Integer, Integer, Integer)]
21
- def self.to_a() [MAJOR, MINOR, TINY] end
18
+ def self.to_a() STRING.split(".") end
22
19
  end
23
20
  end
metadata CHANGED
@@ -1,94 +1,78 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: rdf-isomorphic
3
- version: !ruby/object:Gem::Version
4
- hash: 23
5
- prerelease:
6
- segments:
7
- - 1
8
- - 0
9
- - 0
10
- version: 1.0.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Ben Lavender
14
8
  - Arto Bendiken
15
9
  autorequire:
16
10
  bindir: bin
17
11
  cert_chain: []
18
-
19
- date: 2013-01-19 00:00:00 Z
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
12
+ date: 2013-04-13 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: rdf
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 15
30
- segments:
31
- - 1
32
- - 0
33
- version: "1.0"
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ! '>='
19
+ - !ruby/object:Gem::Version
20
+ version: '1.0'
34
21
  type: :runtime
35
- version_requirements: *id001
36
- - !ruby/object:Gem::Dependency
37
- name: rdf-spec
38
22
  prerelease: false
39
- requirement: &id002 !ruby/object:Gem::Requirement
40
- none: false
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- hash: 15
45
- segments:
46
- - 1
47
- - 0
48
- version: "1.0"
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ! '>='
26
+ - !ruby/object:Gem::Version
27
+ version: '1.0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: rdf-spec
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ! '>='
33
+ - !ruby/object:Gem::Version
34
+ version: '1.0'
49
35
  type: :development
50
- version_requirements: *id002
51
- - !ruby/object:Gem::Dependency
52
- name: rspec
53
36
  prerelease: false
54
- requirement: &id003 !ruby/object:Gem::Requirement
55
- none: false
56
- requirements:
57
- - - ">="
58
- - !ruby/object:Gem::Version
59
- hash: 63
60
- segments:
61
- - 2
62
- - 12
63
- - 0
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ! '>='
40
+ - !ruby/object:Gem::Version
41
+ version: '1.0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: rspec
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ! '>='
47
+ - !ruby/object:Gem::Version
64
48
  version: 2.12.0
65
49
  type: :development
66
- version_requirements: *id003
67
- - !ruby/object:Gem::Dependency
68
- name: yard
69
50
  prerelease: false
70
- requirement: &id004 !ruby/object:Gem::Requirement
71
- none: false
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- hash: 57
76
- segments:
77
- - 0
78
- - 8
79
- - 3
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: 2.12.0
56
+ - !ruby/object:Gem::Dependency
57
+ name: yard
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ! '>='
61
+ - !ruby/object:Gem::Version
80
62
  version: 0.8.3
81
63
  type: :development
82
- version_requirements: *id004
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: 0.8.3
83
70
  description: RDF.rb plugin for graph bijections and isomorphic equivalence.
84
71
  email: public-rdf-ruby@w3.org
85
72
  executables: []
86
-
87
73
  extensions: []
88
-
89
74
  extra_rdoc_files: []
90
-
91
- files:
75
+ files:
92
76
  - AUTHORS
93
77
  - README
94
78
  - UNLICENSE
@@ -96,40 +80,28 @@ files:
96
80
  - lib/rdf/isomorphic/version.rb
97
81
  - lib/rdf/isomorphic.rb
98
82
  homepage: http://github.com/ruby-rdf/rdf-isomorphic
99
- licenses:
83
+ licenses:
100
84
  - Public Domain
85
+ metadata: {}
101
86
  post_install_message:
102
87
  rdoc_options: []
103
-
104
- require_paths:
88
+ require_paths:
105
89
  - lib
106
- required_ruby_version: !ruby/object:Gem::Requirement
107
- none: false
108
- requirements:
109
- - - ">="
110
- - !ruby/object:Gem::Version
111
- hash: 51
112
- segments:
113
- - 1
114
- - 8
115
- - 2
90
+ required_ruby_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ! '>='
93
+ - !ruby/object:Gem::Version
116
94
  version: 1.8.2
117
- required_rubygems_version: !ruby/object:Gem::Requirement
118
- none: false
119
- requirements:
120
- - - ">="
121
- - !ruby/object:Gem::Version
122
- hash: 3
123
- segments:
124
- - 0
125
- version: "0"
95
+ required_rubygems_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ! '>='
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
126
100
  requirements: []
127
-
128
101
  rubyforge_project: rdf
129
- rubygems_version: 1.8.24
102
+ rubygems_version: 2.0.3
130
103
  signing_key:
131
- specification_version: 3
104
+ specification_version: 4
132
105
  summary: RDF.rb plugin for graph bijections and isomorphic equivalence.
133
106
  test_files: []
134
-
135
107
  has_rdoc: false