pomegranate 0.9

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.
@@ -0,0 +1,45 @@
1
+ # This file is part of Pomegranate
2
+ #
3
+ # Pomegranate is free software: you can redistribute it and/or modify
4
+ # it under the terms of the GNU Lesser General Public License as published by
5
+ # the Free Software Foundation, either version 3 of the License, or
6
+ # (at your option) any later version.
7
+ #
8
+ # Pomegranate is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ # GNU Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public License
14
+ # along with Pomegranate. If not, see <http://www.gnu.org/licenses/>.
15
+
16
+ require 'pathname'
17
+ #require 'ruleby'
18
+ require 'lib/pomegranate'
19
+ # require 'lib/pomegranate/rdfs_rulebook'
20
+ # require 'lib/pomegranate/rdfsplus_rulebook'
21
+
22
+ require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper'
23
+ include Ruleby
24
+
25
+ describe "rdfs:range", 'rule' do
26
+
27
+ before(:all) do
28
+ @e = engine :engine do |e|
29
+ RdfsPlusRulebook.new(e).rules
30
+
31
+ p = Triple.new("mit:majored_in", "rdfs:range", ":major")
32
+ h = Triple.new(":Pius", "mit:majored_in", ":Course_17")
33
+
34
+ e.assert p
35
+ e.assert h
36
+ e.match
37
+ end
38
+ end
39
+
40
+ it "should understand range" do
41
+ fact = Triple.new(":Course_17", "rdf:type", ":major")
42
+ f = @e.facts.select {|t| t.subject == ":Course_17"}
43
+ f.should include(fact)
44
+ end
45
+ end
@@ -0,0 +1,45 @@
1
+ # This file is part of Pomegranate
2
+ #
3
+ # Pomegranate is free software: you can redistribute it and/or modify
4
+ # it under the terms of the GNU Lesser General Public License as published by
5
+ # the Free Software Foundation, either version 3 of the License, or
6
+ # (at your option) any later version.
7
+ #
8
+ # Pomegranate is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ # GNU Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public License
14
+ # along with Pomegranate. If not, see <http://www.gnu.org/licenses/>.
15
+
16
+ require 'pathname'
17
+ #require 'ruleby'
18
+ require 'lib/pomegranate'
19
+ # require 'lib/pomegranate/rdfs_rulebook'
20
+ # require 'lib/pomegranate/rdfsplus_rulebook'
21
+
22
+ require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper'
23
+ include Ruleby
24
+
25
+ describe "rdfs:subclassOf", 'rule' do
26
+
27
+ before(:all) do
28
+ @e = engine :engine do |e|
29
+ RdfsPlusRulebook.new(e).rules
30
+
31
+ p = Triple.new(":Pius", "rdf:type", ":male")
32
+ h = Triple.new(":male", "rdfs:subClassOf", ":human")
33
+ e.assert p
34
+ e.assert h
35
+ e.match
36
+ end
37
+ end
38
+
39
+ it "should understand individual equivalence when a triple object is rdfs:subClassOf another resource" do
40
+ fact = Triple.new(":Pius", "rdf:type", ":human")
41
+ @e.match
42
+ f = @e.facts.select {|t| t.subject == ":Pius"}
43
+ @e.facts.should include(fact)
44
+ end
45
+ end
@@ -0,0 +1,46 @@
1
+ # This file is part of Pomegranate
2
+ #
3
+ # Pomegranate is free software: you can redistribute it and/or modify
4
+ # it under the terms of the GNU Lesser General Public License as published by
5
+ # the Free Software Foundation, either version 3 of the License, or
6
+ # (at your option) any later version.
7
+ #
8
+ # Pomegranate is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ # GNU Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public License
14
+ # along with Pomegranate. If not, see <http://www.gnu.org/licenses/>.
15
+
16
+ require 'pathname'
17
+ #require 'ruleby'
18
+ require 'lib/pomegranate'
19
+ # require 'lib/pomegranate/rdfs_rulebook'
20
+ # require 'lib/pomegranate/rdfsplus_rulebook'
21
+
22
+ require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper'
23
+ include Ruleby
24
+
25
+ describe "rdfs:subPropertyOf", 'rule' do
26
+
27
+ before(:all) do
28
+ @e = engine :engine do |e|
29
+ RdfsPlusRulebook.new(e).rules
30
+
31
+ q = Triple.new(":Pius", "mit:majored_in", ":Course_6");
32
+ r = Triple.new("mit:majored_in", "rdfs:subPropertyOf", "mit:took_some_classes_in")
33
+
34
+ e.assert q
35
+ e.assert r
36
+ e.match
37
+ end
38
+ end
39
+
40
+ it "should understand subproperties when a resource is rdfs:subPropertyOf another resource" do
41
+ fact = Triple.new(":Pius", "mit:took_some_classes_in", ":Course_6");
42
+ @e.match
43
+ f = @e.facts.select {|t| t.subject == ":Pius"}
44
+ @e.facts.should include(fact)
45
+ end
46
+ end
metadata ADDED
@@ -0,0 +1,85 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pomegranate
3
+ version: !ruby/object:Gem::Version
4
+ version: "0.9"
5
+ platform: ruby
6
+ authors:
7
+ - Pius Uzamere
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-12-30 00:00:00 -05:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: ruleby
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0.4"
24
+ version:
25
+ description: Pomegranate is a Ruby library for inferencing over a corpus of RDFS triples. Implements standard RDFS and RDFS-Plus.
26
+ email: pius+github@uyiosa.com
27
+ executables: []
28
+
29
+ extensions: []
30
+
31
+ extra_rdoc_files: []
32
+
33
+ files:
34
+ - README.markdown
35
+ - Rakefile
36
+ - pomegranate.gemspec
37
+ - lib/pomegranate.rb
38
+ - lib/pomegranate/rdfs_rulebook.rb
39
+ - lib/pomegranate/rdfs_plus_rulebook.rb
40
+ - coverage/index.html
41
+ - coverage/lib-pomegranate-rdfs_plus_rulebook_rb.html
42
+ - coverage/lib-pomegranate_rb.html
43
+ has_rdoc: true
44
+ homepage: http://github.com/pius/pomegranate
45
+ licenses: []
46
+
47
+ post_install_message:
48
+ rdoc_options: []
49
+
50
+ require_paths:
51
+ - lib
52
+ required_ruby_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: "0"
57
+ version:
58
+ required_rubygems_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: "0"
63
+ version:
64
+ requirements: []
65
+
66
+ rubyforge_project:
67
+ rubygems_version: 1.3.5
68
+ signing_key:
69
+ specification_version: 3
70
+ summary: RDF and OWL inference engine for Ruby.
71
+ test_files:
72
+ - spec/spec.opts
73
+ - spec/spec_helper.rb
74
+ - spec/unit/owl_equivalent_class_spec.rb
75
+ - spec/unit/owl_equivalent_property_spec.rb
76
+ - spec/unit/owl_functional_property_spec.rb
77
+ - spec/unit/owl_inverse_functional_property_spec.rb
78
+ - spec/unit/owl_inverse_of_spec.rb
79
+ - spec/unit/owl_same_as_spec.rb
80
+ - spec/unit/owl_symmetric_property_spec.rb
81
+ - spec/unit/owl_transitive_property_spec.rb
82
+ - spec/unit/rdfs_domain_spec.rb
83
+ - spec/unit/rdfs_range_spec.rb
84
+ - spec/unit/rdfs_subclass_of_spec.rb
85
+ - spec/unit/rdfs_subproperty_of_spec.rb