Sha256: 341ff58b579abeae8415f0f5d13410c37a708389496af4e24296f2b879d5fab5
Contents?: true
Size: 1.16 KB
Versions: 1
Compression:
Stored size: 1.16 KB
Contents
module DOWL class Class < DOWL::LabelledDocObject include Comparable attr_reader :resource def initialize(resource, schema) super(resource, schema) end def uri return @resource.uri.to_s end def sub_class_of() parent = @schema.model.first_value( RDF::Query::Pattern.new( @resource, DOWL::Namespaces::RDFS.subClassOf ) ) if parent uri = parent.to_s if @schema.classes[uri] return @schema.classes[uri] else return uri end end return nil end def see_alsos() links = [] @schema.model.query( RDF::Query::Pattern.new( @resource, DOWL::Namespaces::RDFS.seeAlso ) ) do |statement| links << statement.object.to_s end return links end def to_s return short_name end def sub_classes() list = [] @schema.model.query( RDF::Query::Pattern.new( nil, DOWL::Namespaces::RDFS.subClassOf, @resource) ) do |statement| list << DOWL::Class.new(statement.subject, @schema) end return list end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
dowl-0.2 | lib/dowl/class.rb |