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

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

Instance Method Summary collapse

Instance Method Details

#to_ctm(*args) ⇒ Object

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 '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(de.topicmapslab.ctm.writer.core.CTMTopicMapWriter, *args)
end

#to_jtm(*args) ⇒ Object 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 'lib/rtm/io/tmapix_to.rb', line 142

def to_jtm(*args)
  to_anything(org.tmapix.io.JTMTopicMapWriter, *args)
end

#to_ltm(*args) ⇒ Object

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 'lib/rtm/io/tmapix_to.rb', line 162

def to_ltm(*args)
  to_anything(org.tmapix.io.LTMTopicMapWriter, *args)
end

#to_tmxml(*args) ⇒ Object

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 'lib/rtm/io/tmapix_to.rb', line 181

def to_tmxml(*args)
  to_anything(org.tmapix.io.TMXMLTopicMapWriter, *args)
end

#to_xtm10(*args) ⇒ Object 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 'lib/rtm/io/tmapix_to.rb', line 122

def to_xtm10(*args)
  to_anything(org.tmapix.io.XTM10TopicMapWriter, *args)
end

#to_xtm20(*args) ⇒ Object 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 'lib/rtm/io/tmapix_to.rb', line 101

def to_xtm20(*args)
  to_anything(org.tmapix.io.XTM20TopicMapWriter, *args)
end