Sha256: 7dfc1523fb07a86731f2fdcfea5950e265af05ed5e638b34d86a77dbff7aa65a

Contents?: true

Size: 669 Bytes

Versions: 1

Compression:

Stored size: 669 Bytes

Contents

# Copyright: Copyright 2009 Topic Maps Lab, University of Leipzig.
# License:   Apache License, Version 2.0


module RTM::IO

  # RDF Export.
  # RTM::TopicMap gets a to_rdf method.
  module TORDF
    module TopicMap
      
      def to_rdf
        case self
          when net.ontopia.topicmaps.impl.tmapi2.TopicMapImpl then to_rdf_ontopia
          else raise "Not supported for #{self}"
        end
      end
      
      def to_rdf_ontopia
        @out = java.io.StringWriter.new
        w=Java::NetOntopiaTopicmapsUtilsRdf::RDFTopicMapWriter.new @out
        w.write self.getWrapped
        @out.to_s
      end
    end

    RTM.register_extension self 

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rtm-0.2.0 lib/rtm/io/to_rdf.rb