Class: DOWL::LabelledDocObject
Instance Attribute Summary
Attributes inherited from DocObject
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #comment ⇒ Object
-
#initialize(resource, schema) ⇒ LabelledDocObject
constructor
A new instance of LabelledDocObject.
- #label ⇒ Object
- #short_name ⇒ Object
- #status ⇒ Object
Methods inherited from DocObject
Constructor Details
#initialize(resource, schema) ⇒ LabelledDocObject
Returns a new instance of LabelledDocObject.
19 20 21 |
# File 'lib/dowl/util.rb', line 19 def initialize(resource, schema) super(resource, schema) end |
Instance Method Details
#<=>(other) ⇒ Object
45 46 47 |
# File 'lib/dowl/util.rb', line 45 def <=>(other) return label().downcase <=> other.label().downcase end |
#comment ⇒ Object
37 38 39 |
# File 'lib/dowl/util.rb', line 37 def comment() return get_literal(DOWL::Namespaces::RDFS.comment) end |
#label ⇒ Object
33 34 35 |
# File 'lib/dowl/util.rb', line 33 def label() return get_literal(DOWL::Namespaces::RDFS.label) end |
#short_name ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/dowl/util.rb', line 23 def short_name() uri = @resource.to_s ontology_uri = @schema.ontology.uri if ontology_uri.end_with?("#") || ontology_uri.end_with?("/") ontology_uri = ontology_uri[0..-2] end name = uri.gsub(/#{ontology_uri}(\/|#)?/, "") return name end |
#status ⇒ Object
41 42 43 |
# File 'lib/dowl/util.rb', line 41 def status() return get_literal(DOWL::Namespaces::VS.term_status) end |