class Mexico::FileSystem::Scale

A generic scale.

Constants

DIM_OTHER
DIM_SPACE
DIM_TIME

Attributes

document[RW]

Public Class Methods

new(args={}) click to toggle source

OKunit : SI units or custom units OK dimension : String (x,y,z,t, etc.) OK role : String (free text) continuous? : Boolean

# File lib/mexico/file_system/scale.rb, line 69
def initialize(args={})
  args.each do |k,v|
    if self.respond_to?("#{k}=")
      send("#{k}=", v)
    end
  end
end
to_turtle() click to toggle source

Creates an RDF representation in Turtle notation for this class. @return [String] An RDF representation in Turtle notation for this class.

# File lib/mexico/file_system/scale.rb, line 86
def self.to_turtle
  rdf_writer = RDF::Turtle::Writer
  return rdf_writer.buffer(:base_uri => 'http://phoibos.sfb673.org/',
                           :prefixes => {
                               :cats => 'http://cats.sfb673.org/',
                               :rdfs => RDF::RDFS.to_uri,
                               :foaf => RDF::FOAF.to_uri,
                               :dc => RDF::DC.to_uri,
                               :owl => RDF::OWL.to_uri,
                               :xsd  => RDF::XSD.to_uri} #
  ) do |writer|
    as_rdf.each_statement do |statement|
      writer << statement
    end
  end
end

Public Instance Methods

after_parse() click to toggle source

overrides method in ROXML callback after xml parsing process, to store this element in the document cache.

# File lib/mexico/file_system/scale.rb, line 80
def after_parse
  ::Mexico::FileSystem::FiestaDocument.store(self.identifier, self)
end
identifier=(new_id) click to toggle source
# File lib/mexico/file_system/scale.rb, line 31
def identifier=(new_id)
  @identifier = Mexico::Util::to_xml_id(new_id)
end
is_spatial_axis?() click to toggle source
# File lib/mexico/file_system/scale.rb, line 126
def is_spatial_axis?
  self.dimension == DIM_SPACE
end
is_timeline?() click to toggle source
# File lib/mexico/file_system/scale.rb, line 122
def is_timeline?
  self.dimension == DIM_TIME
end
to_turtle() click to toggle source

Creates an RDF representation in Turtle notation for this object. @return [String] An RDF representation in Turtle notation for this object.

# File lib/mexico/file_system/scale.rb, line 105
def to_turtle
  rdf_writer = RDF::Turtle::Writer
  return rdf_writer.buffer(:base_uri => 'http://phoibos.sfb673.org/',
                           :prefixes => {
                               :cats => 'http://cats.sfb673.org/',
                               :rdfs => RDF::RDFS.to_uri,
                               :foaf => RDF::FOAF.to_uri,
                               :dc => RDF::DC.to_uri,
                               :owl => RDF::OWL.to_uri,
                               :xsd  => RDF::XSD.to_uri} #
  ) do |writer|
    as_rdf.each_statement do |statement|
      writer << statement
    end
  end
end