TheoryDeserializer

A Deserializer of whole Theory instances, e.g. to reload a previously persisted knowledge base from disk, or to receive one sent by another process (or tool) as JSON, YAML, or XML. Internally, a TheoryDeserializer parses the input in the requested MimeType into a plain list and then reconstructs the Theory from it via TheoryDeobjectifier.

Usage example:

val deserializer: TheoryDeserializer = TheoryDeserializer.of(MimeType.Json)
val theory: Theory = deserializer.deserialize("""[{"head":"foo","body":"bar"}]""")

See also

for the inverse operation.

Inheritors

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val mimeType: MimeType

Functions

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