Module: RTM::IO::TmapiXTo::TopicMap

Defined in:
rtm/lib/rtm/io/tmapix_to.rb,
rtm/spec/rtm/io/tmapix_to_spec.rb

Instance Method Summary

Instance Method Details

- (Object) to_ctm(*args)

Serializes an RTM::TopicMap to CTM.

If no argument is given, a String is returned.

The argument file can be provided as a String (which is then interpreted as a filename) or as a java.io.OutputStream.

The argument base_iri may be used to define a new base_iri, if not, the current one is used. Base_iri may be a String.

A property-Hash may be given to set properties of the writer.

:call-seq:

  to_ctm(properties={})
  to_ctm(file, properties={})
  to_ctm(file, base_iri, properties={})


202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# File 'rtm/lib/rtm/io/tmapix_to.rb', line 202

def to_ctm(*args)
  # set default params
  default_params = {
    "writer.features.export.itemidentifier" => false,
    "writer.features.prefixDetection.enabled" => false,
    "writer.features.templateDetection.enabled" => false,
    "writer.features.templateDetection.topicTemplates" => false,
    "writer.features.templateDetection.associationTemplates" => false,
    "writer.features.templateMerger.enabled" => false
  }
  # enhance the args with the default params
  if args.last.is_a?(Hash)
    args.push(default_params.merge(args.pop))
  else
    args.push(default_params)
  end
  to_anything(Java::DeTopicmapslabCtmWriterCore::CTMTopicMapWriter, *args)
end

- (Object) to_jtm(*args) Also known as: to_json

Serializes an RTM::TopicMap to JTM.

If no argument is given, a String is returned.

The argument file can be provided as a String (which is then interpreted as a filename) or as a java.io.OutputStream.

The argument base_iri may be used to define a new base_iri, if not, the current one is used. Base_iri may be a String.

:call-seq:

  to_jtm
  to_jtm(file)
  to_jtm(file, base_iri)


142
143
144
# File 'rtm/lib/rtm/io/tmapix_to.rb', line 142

def to_jtm(*args)
  to_anything(Java::OrgTmapixIo::JTMTopicMapWriter, *args)
end

- (Object) to_ltm(*args)

Serializes an RTM::TopicMap to LTM.

If no argument is given, a String is returned.

The argument file can be provided as a String (which is then interpreted as a filename) or as a java.io.OutputStream.

The argument base_iri may be used to define a new base_iri, if not, the current one is used. Base_iri may be a String.

:call-seq:

  to_ltm
  to_ltm(file)
  to_ltm(file, base_iri)


162
163
164
# File 'rtm/lib/rtm/io/tmapix_to.rb', line 162

def to_ltm(*args)
  to_anything(Java::OrgTmapixIo::LTMTopicMapWriter, *args)
end

- (Object) to_tmxml(*args)

Serializes an RTM::TopicMap to TM/XML.

If no argument is given, a String is returned.

The argument file can be provided as a String (which is then interpreted as a filename) or as a java.io.OutputStream.

The argument base_iri may be used to define a new base_iri, if not, the current one is used. Base_iri may be a String.

:call-seq:

  to_tmxml
  to_tmxml(file)
  to_tmxml(file, base_iri)


181
182
183
# File 'rtm/lib/rtm/io/tmapix_to.rb', line 181

def to_tmxml(*args)
  to_anything(Java::OrgTmapixIo::TMXMLTopicMapWriter, *args)
end

- (Object) to_xtm10(*args) Also known as: to_xtm1

Serializes an RTM::TopicMap to XTM v. 1.0.

If no argument is given, a String is returned.

The argument file can be provided as a String (which is then interpreted as a filename) or as a java.io.OutputStream.

The argument base_iri may be used to define a new base_iri, if not, the current one is used. Base_iri may be a String.

:call-seq:

  to_xtm10
  to_xtm10(file)
  to_xtm10(file, base_iri)


122
123
124
# File 'rtm/lib/rtm/io/tmapix_to.rb', line 122

def to_xtm10(*args)
  to_anything(Java::OrgTmapixIo::XTM10TopicMapWriter, *args)
end

- (Object) to_xtm20(*args) Also known as: to_xtm, to_xtm2

Serializes an RTM::TopicMap to XTM v. 2.0.

If no argument is given, a String is returned.

The argument file can be provided as a String (which is then interpreted as a filename) or as a java.io.OutputStream.

The argument base_iri may be used to define a new base_iri, if not, the current one is used. Base_iri may be a String.

:call-seq:

  to_xtm20
  to_xtm20(file)
  to_xtm20(file, base_iri)


101
102
103
# File 'rtm/lib/rtm/io/tmapix_to.rb', line 101

def to_xtm20(*args)
  to_anything(Java::OrgTmapixIo::XTM20TopicMapWriter, *args)
end