semantic_naming 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ontology_graph/graph.rb +1 -0
- data/test/graph_test.rb +9 -0
- metadata +26 -26
data/lib/ontology_graph/graph.rb
CHANGED
@@ -19,6 +19,7 @@ module OntologyGraph
|
|
19
19
|
def add_relation(superclass, subclass)
|
20
20
|
subclass = get_or_create_node(subclass)
|
21
21
|
superclass = get_or_create_node(superclass)
|
22
|
+
return if(subclass.uri == superclass.uri) # don't accept self-relations
|
22
23
|
superclass.add_subclass(subclass)
|
23
24
|
end
|
24
25
|
|
data/test/graph_test.rb
CHANGED
@@ -88,12 +88,21 @@ class URITest < Test::Unit::TestCase
|
|
88
88
|
def build_test_for_weed
|
89
89
|
graph = build_test_graph
|
90
90
|
|
91
|
+
graph.add_relation('a', 'a')
|
91
92
|
graph.add_relation('a', 'f')
|
92
93
|
graph.add_relation('a', 'g')
|
93
94
|
graph.add_relation('a', 'h')
|
94
95
|
graph.add_relation('a', 'i')
|
96
|
+
graph.add_relation('b', 'b')
|
97
|
+
graph.add_relation('c', 'c')
|
98
|
+
graph.add_relation('d', 'd')
|
95
99
|
graph.add_relation('d', 'h')
|
96
100
|
graph.add_relation('d', 'i')
|
101
|
+
graph.add_relation('e', 'e')
|
102
|
+
graph.add_relation('f', 'f')
|
103
|
+
graph.add_relation('g', 'g')
|
104
|
+
graph.add_relation('h', 'h')
|
105
|
+
graph.add_relation('i', 'i')
|
97
106
|
graph.add_relation('g', 'i')
|
98
107
|
graph.add_relation('b', 'f')
|
99
108
|
graph.add_relation('b', 'g')
|
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: semantic_naming
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Daniel Hahn
|
7
|
+
- Daniel Hahn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
@@ -20,37 +20,37 @@ executables: []
|
|
20
20
|
extensions: []
|
21
21
|
|
22
22
|
extra_rdoc_files:
|
23
|
-
- README.rdoc
|
23
|
+
- README.rdoc
|
24
24
|
files:
|
25
|
-
- lib/ontology_graph/class_node.rb
|
26
|
-
- lib/ontology_graph/graph.rb
|
27
|
-
- lib/semantic_naming.rb
|
28
|
-
- lib/semantic_naming/default_namespaces.rb
|
29
|
-
- lib/semantic_naming/namespace.rb
|
30
|
-
- lib/semantic_naming/predicate.rb
|
31
|
-
- lib/semantic_naming/source_class.rb
|
32
|
-
- lib/semantic_naming/uri.rb
|
33
|
-
- README.rdoc
|
25
|
+
- lib/ontology_graph/class_node.rb
|
26
|
+
- lib/ontology_graph/graph.rb
|
27
|
+
- lib/semantic_naming.rb
|
28
|
+
- lib/semantic_naming/default_namespaces.rb
|
29
|
+
- lib/semantic_naming/namespace.rb
|
30
|
+
- lib/semantic_naming/predicate.rb
|
31
|
+
- lib/semantic_naming/source_class.rb
|
32
|
+
- lib/semantic_naming/uri.rb
|
33
|
+
- README.rdoc
|
34
34
|
has_rdoc: true
|
35
35
|
homepage: http://talia.discovery-project.eu/
|
36
36
|
licenses: []
|
37
37
|
|
38
38
|
post_install_message:
|
39
39
|
rdoc_options:
|
40
|
-
- --charset=UTF-8
|
40
|
+
- --charset=UTF-8
|
41
41
|
require_paths:
|
42
|
-
- lib
|
42
|
+
- lib
|
43
43
|
required_ruby_version: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
|
46
|
-
|
47
|
-
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: "0"
|
48
48
|
version:
|
49
49
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
|
52
|
-
|
53
|
-
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: "0"
|
54
54
|
version:
|
55
55
|
requirements: []
|
56
56
|
|
@@ -60,9 +60,9 @@ signing_key:
|
|
60
60
|
specification_version: 3
|
61
61
|
summary: Semantic Naming Extensions for ActiveRDF, Talia and others
|
62
62
|
test_files:
|
63
|
-
- test/class_node_test.rb
|
64
|
-
- test/graph_test.rb
|
65
|
-
- test/namespace_test.rb
|
66
|
-
- test/predicate_test.rb
|
67
|
-
- test/source_class_test.rb
|
68
|
-
- test/uri_test.rb
|
63
|
+
- test/class_node_test.rb
|
64
|
+
- test/graph_test.rb
|
65
|
+
- test/namespace_test.rb
|
66
|
+
- test/predicate_test.rb
|
67
|
+
- test/source_class_test.rb
|
68
|
+
- test/uri_test.rb
|