Class: DOWL::LabelledDocObject

Inherits:
DocObject show all
Defined in:
lib/dowl/util.rb

Direct Known Subclasses

Class, Property

Instance Attribute Summary

Attributes inherited from DocObject

#resource, #schema

Instance Method Summary collapse

Methods inherited from DocObject

#get_literal

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



41
42
43
# File 'lib/dowl/util.rb', line 41

def <=>(other)
  return label().downcase <=> other.label().downcase
end

#commentObject



33
34
35
# File 'lib/dowl/util.rb', line 33

def comment()
  return get_literal(DOWL::Namespaces::RDFS.comment)
end

#labelObject



29
30
31
# File 'lib/dowl/util.rb', line 29

def label()
  return get_literal(DOWL::Namespaces::RDFS.label)
end

#short_nameObject



23
24
25
26
27
# File 'lib/dowl/util.rb', line 23

def short_name()
  uri = @resource.to_s
  ontology_uri = @schema.ontology.uri
  return uri.gsub(ontology_uri, "")
end

#statusObject



37
38
39
# File 'lib/dowl/util.rb', line 37

def status()      
  return get_literal(DOWL::Namespaces::VS.status)
end