@metreeca/trio - v0.1.1
    Preparing search index...

    Function encodeNTriples

    • Encodes an RDF graph into an N-Triples document.

      Emits one statement per triple, each terminated by . and a line feed, so the empty graph encodes to the empty string. A literal carrying the redundant xsd:string datatype collapses to the bare quoted form.

      Terms are taken as valid: IRIs, blank-node labels, lexical forms and language tags are validated by the data model factories, which are the only supported way to build a Graph, so the encoder escapes rather than checks. A record assembled without them is serialised as it stands, malformed components included.

      Parameters

      • graph: Graph

        The graph to serialise

      Returns string

      The N-Triples document