Class: YOWL::Person

Inherits:
LabelledDocObject show all
Defined in:
lib/yowl/person.rb

Instance Attribute Summary

Attributes inherited from DocObject

#resource, #schema

Instance Method Summary collapse

Methods inherited from LabelledDocObject

#comment, #commentOrLabel, #definition, #editorialNotes, #hasComment?, #hasDefinition?, #hasDifferentLabel?, #hasEditorialNotes?, #label, #see_alsos, #status

Methods inherited from DocObject

#escaped_short_name, #escaped_uri, #get_literal, #hasOtherNamespace?, #hasUri?, #ns, #ontology, #repository, #short_name, #to_s, #uri

Constructor Details

#initialize(resource, schema) ⇒ Person

Returns a new instance of Person.



5
6
7
8
# File 'lib/yowl/person.rb', line 5

def initialize(resource, schema)
  super(resource, schema)
  @name = nil
end

Instance Method Details

#<=>(other) ⇒ Object



22
23
24
# File 'lib/yowl/person.rb', line 22

def <=>(other)
  return name() <=> other.name()
end

#nameObject



14
15
16
17
18
19
20
# File 'lib/yowl/person.rb', line 14

def name()
  name = get_literal(YOWL::Namespaces::FOAF.name)
  if name.nil? or name.empty?
    name = short_name()
  end
  return name
end

#setName(name_) ⇒ Object



10
11
12
# File 'lib/yowl/person.rb', line 10

def setName(name_)
  @name = name_
end