Class: YOWL::Ontology
Instance Attribute Summary
Attributes inherited from DocObject
#resource, #schema
Instance Method Summary
collapse
#<=>, #commentOrLabel, #editorialNotes, #hasComment?, #hasDefinition?, #hasDifferentLabel?, #hasEditorialNotes?, #label, #status
Methods inherited from DocObject
#escaped_short_name, #escaped_uri, #get_literal, #hasOtherNamespace?, #hasUri?, #ontology, #repository, #to_s, #uri
Constructor Details
#initialize(resource, schema) ⇒ Ontology
Returns a new instance of Ontology.
5
6
7
|
# File 'lib/yowl/ontology.rb', line 5
def initialize(resource, schema)
super(resource, schema)
end
|
Instance Method Details
#authors ⇒ Object
87
88
89
|
# File 'lib/yowl/ontology.rb', line 87
def authors
@authors ||= init_authors
end
|
#classWithURI(uri_) ⇒ Object
See YOWL::Individual::classWithURI(uri)
181
182
183
184
185
186
187
188
189
190
191
192
193
|
# File 'lib/yowl/ontology.rb', line 181
def classWithURI(uri_)
klass = @schema.classInSchemaWithURI(uri_)
if klass
return klass
end
imports.each do |import|
klass = import.classWithURI(uri_)
if klass
return klass
end
end
return nil
end
|
58
59
60
61
62
63
64
|
# File 'lib/yowl/ontology.rb', line 58
def ()
dctermsAbstract = get_literal(YOWL::Namespaces::DCTERMS.abstract)
if dctermsAbstract
return dctermsAbstract
end
return super
end
|
#created ⇒ Object
70
71
72
73
74
75
76
|
# File 'lib/yowl/ontology.rb', line 70
def created()
dctermsCreated = get_literal(YOWL::Namespaces::DCTERMS.created)
if dctermsCreated
return dctermsCreated
end
return get_literal(YOWL::Namespaces::DC.date)
end
|
#definition ⇒ Object
66
67
68
|
# File 'lib/yowl/ontology.rb', line 66
def definition()
return get_literal(YOWL::Namespaces::SKOS.definition)
end
|
#hasAuthors? ⇒ Boolean
126
127
128
|
# File 'lib/yowl/ontology.rb', line 126
def hasAuthors?
return ! authors.empty?
end
|
#imports ⇒ Object
143
144
145
|
# File 'lib/yowl/ontology.rb', line 143
def imports
@imports ||= init_imports
end
|
#init_ns ⇒ Object
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
# File 'lib/yowl/ontology.rb', line 30
def init_ns()
_uri = @resource.to_s
@schema.prefixes.each do |prefix, namespace|
if _uri == namespace
return namespace
end
_tmp = "#{_uri}/"
if _tmp == namespace
return _tmp
end
_tmp = "#{_uri}#"
if "#{_uri}#" == namespace
return _tmp
end
end
if _uri[-1..1] == '/' or _uri[-1..1] == '#'
return _uri
end
return "#{_uri}#"
end
|
#modified ⇒ Object
78
79
80
|
# File 'lib/yowl/ontology.rb', line 78
def modified()
return get_literal(YOWL::Namespaces::DCTERMS.modified)
end
|
#ns ⇒ Object
25
26
27
28
|
# File 'lib/yowl/ontology.rb', line 25
def ns()
@ns ||= init_ns()
return @ns
end
|
#numberOfClasses ⇒ Object
130
131
132
|
# File 'lib/yowl/ontology.rb', line 130
def numberOfClasses()
return @schema.classes.size()
end
|
#numberOfIndividuals ⇒ Object
138
139
140
|
# File 'lib/yowl/ontology.rb', line 138
def numberOfIndividuals()
return @schema.individuals.size()
end
|
#numberOfProperties ⇒ Object
134
135
136
|
# File 'lib/yowl/ontology.rb', line 134
def numberOfProperties()
return @schema.properties.size()
end
|
#resourceNameHtml ⇒ Object
9
10
11
|
# File 'lib/yowl/ontology.rb', line 9
def resourceNameHtml
return "#{@schema.name}.html"
end
|
#rights ⇒ Object
82
83
84
|
# File 'lib/yowl/ontology.rb', line 82
def rights()
return get_literal(YOWL::Namespaces::DC.rights)
end
|
#see_alsos ⇒ Object
162
163
164
|
# File 'lib/yowl/ontology.rb', line 162
def see_alsos
@see_alsos ||= init_see_alsos
end
|
#short_name ⇒ Object
54
55
56
|
# File 'lib/yowl/ontology.rb', line 54
def short_name()
return @schema.name
end
|
#title ⇒ Object
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/yowl/ontology.rb', line 13
def title()
dctermsTitle = get_literal(YOWL::Namespaces::DCTERMS.title)
if dctermsTitle
return dctermsTitle
end
dcTitle = get_literal(YOWL::Namespaces::DC.title)
if dcTitle
return dcTitle
end
return short_name() end
|