Class: DOWL::Ontology

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

Instance Attribute Summary

Attributes inherited from DocObject

#resource, #schema

Instance Method Summary collapse

Methods inherited from DocObject

#get_literal

Constructor Details

#initialize(resource, schema) ⇒ Ontology

Returns a new instance of Ontology.



30
31
32
# File 'lib/dowl/ontology.rb', line 30

def initialize(resource, schema)
    super(resource, schema)  
end

Instance Method Details

#authorsObject



54
55
56
57
58
59
60
61
# File 'lib/dowl/ontology.rb', line 54

def authors()      
  authors = []
  @schema.model.query( 
    RDF::Query::Pattern.new( @resource, DOWL::Namespaces::FOAF.maker ) ) do |statement|
      authors << Person.new( statement.object, @schema )
  end         
  return authors.sort     
end

#commentObject



42
43
44
# File 'lib/dowl/ontology.rb', line 42

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

#createdObject



46
47
48
# File 'lib/dowl/ontology.rb', line 46

def created()
  return get_literal(DOWL::Namespaces::DCTERMS.created)
end

#modifiedObject



50
51
52
# File 'lib/dowl/ontology.rb', line 50

def modified()
  return get_literal(DOWL::Namespaces::DCTERMS.modified)
end

#titleObject



38
39
40
# File 'lib/dowl/ontology.rb', line 38

def title()
  return get_literal(DOWL::Namespaces::DCTERMS.title)
end

#uriObject



34
35
36
# File 'lib/dowl/ontology.rb', line 34

def uri()       
  return @resource.to_s
end