TermSerializer
A Serializer of Terms, e.g. to persist a knowledge base fact or a query solution to disk, or to send it to another process (or another tool, possibly written in another language) as JSON, YAML, or XML. Internally, a TermSerializer typically converts the Term into a plain object via TermObjectifier and then writes that object in the requested MimeType.
Usage example:
val serializer: TermSerializer = TermSerializer.of(MimeType.Json)
val term: Term = Struct.of("f", Atom.of("hello"), Integer.of(2))
val json: String = serializer.serialize(term) // {"fun":"f","args":["hello",2]}Content copied to clipboard
See also
for the inverse operation.
A JVM-only WritingTermSerializer variant writes directly to a java.io.Writer.
Inheritors
Properties
Functions
Link copied to clipboard
Serializes several values into a single textual representation of all of them.