Module: RTM::IO::ToRDF::TopicMap

Defined in:
lib/rtm/io/to_rdf.rb

Instance Method Summary collapse

Instance Method Details

#to_rdfObject

If this topic map is an Ontopia tmapi2 topic map to_rdf_ontopia is called and the RDF reprensentation is returned.

Else, a “Not supported” error is raised.

:call-seq:

to_rdf -> String


19
20
21
22
23
24
# File 'lib/rtm/io/to_rdf.rb', line 19

def to_rdf
  case self
    when net.ontopia.topicmaps.impl.tmapi2.TopicMapImpl then to_rdf_ontopia
    else raise "Not supported for #{self}"
  end
end

#to_rdf_ontopiaObject

Returns the RDF representation according to RDF2TM of this topic map as String.

:call-seq:

to_rdf_ontopia -> String


34
35
36
37
38
39
# File 'lib/rtm/io/to_rdf.rb', line 34

def to_rdf_ontopia
  @out = java.io.StringWriter.new
  w=Java::NetOntopiaTopicmapsUtilsRdf::RDFTopicMapWriter.new @out
  w.write self.getWrapped
  @out.to_s
end