TermDeserializer

A Deserializer of Terms, e.g. to reload a previously persisted fact or query solution from disk, or to receive one sent by another process (or tool) as JSON, YAML, or XML. Internally, a TermDeserializer typically parses the input in the requested MimeType into a plain object and then reconstructs the Term from it via TermDeobjectifier.

Usage example:

val deserializer: TermDeserializer = TermDeserializer.of(MimeType.Json)
val term: Term = deserializer.deserialize("""{"fun":"f","args":["hello",2]}""")

See also

for the inverse operation.

A JVM-only ReadingTermDeserializer variant reads directly from a java.io.Reader.

Inheritors

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val mimeType: MimeType

The textual format this deserializer consumes.

Functions

Link copied to clipboard
abstract fun deserialize(string: String): Term

Deserializes a single value of type T from its textual representation string.

Link copied to clipboard
abstract fun deserializeMany(string: String): Iterable<Term>

Deserializes several values of type T from a single textual representation string of all of them.