semantic_naming 2.0.3 → 2.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/semantic_naming/source_class.rb +8 -4
- metadata +1 -1
@@ -69,14 +69,18 @@ module N
|
|
69
69
|
all_types_qry.where(:element, RDF.type, :type)
|
70
70
|
all_types = all_types_qry.execute
|
71
71
|
|
72
|
-
all_types_hash = {}
|
73
|
-
all_types.each { |type| all_types_hash[type] = true }
|
74
|
-
|
75
72
|
qry = Query.new(SourceClass).distinct.select(:class, :subclass)
|
76
73
|
qry.where(:subclass, RDFS.subClassOf, :class)
|
77
74
|
subtype_list = qry.execute
|
78
75
|
|
79
|
-
|
76
|
+
all_types_hash = {}
|
77
|
+
all_types.each { |type| all_types_hash[type] = true }
|
78
|
+
|
79
|
+
# TODO: Not very efficient, but then we don't expect many types
|
80
|
+
all_type_list = (all_types + subtype_list.collect { |el| el.last }).uniq
|
81
|
+
|
82
|
+
hierarchy = build_hierarchy_from(subtype_list, all_type_list)
|
83
|
+
|
80
84
|
purge_hierarchy!(hierarchy, all_types_hash)
|
81
85
|
|
82
86
|
hierarchy
|