protocol
json_lines_protocol
JSON Lines parser and generator protocol.
Availability:
logtalk_load(json_lines(loader))Author: Paulo Moura
Version: 1:0:0
Date: 2025-05-27
Compilation flags:
staticDependencies:
(none)
Remarks:
(none)
Inherited public predicates:
(none)
Public predicates
parse/2
Parses the JSON Lines contents read from the given source (file(Path), stream(Stream), line(Stream), codes(Codes), chars(Chars), or atom(Atom)) into a list of ground terms.
Compilation flags:
staticTemplate:
parse(Source,Terms)Mode and number of proofs:
parse(++compound,--list(ground)) - one_or_errorExceptions:
Source is a variable:instantiation_errorSource is neither a variable nor a valid source:domain_error(json_lines_source,Source)generate/2
Generates the content using the representation specified in the first argument (file(Path), stream(Stream), codes(Codes), chars(Chars), or atom(Atom)) for the list of ground terms in the second argument.
Compilation flags:
staticTemplate:
generate(Sink,Terms)Mode and number of proofs:
generate(+compound,++list(ground)) - one_or_errorExceptions:
Sink is a variable:instantiation_errorTerms is a variable:instantiation_errorTerms is neither a variable nor a list:type_error(list,Terms)Term is a non-ground element of the list Terms:instantiation_errorTerm is an element of the list Terms but not a valid JSON term:domain_error(json_term,Term)Sink cannot be generated:domain_error(json_lines_sink,Sink)Protected predicates
(none)
Private predicates
(none)
Operators
(none)