pymantic.serializers

pymantic.serializers.nt_escape(node_string)[source]

Properly escape strings for n-triples and n-quads serialization.

pymantic.serializers.serialize_nquads(dataset, f)[source]

Serialize some graph to f as nquads.

pymantic.serializers.serialize_ntriples(graph, f)[source]

Serialize some graph to f as ntriples.

pymantic.serializers.serialize_turtle(graph, f, base=None, profile=None, bnode_name_generator=<function default_bnode_name_generator>)[source]

Serialize a graph to f as turtle, optionally using base IRI base and prefix map from profile. If provided, subject_key will be used to order subjects, and predicate_key predicates within a subject.

pymantic.serializers.turtle_repr(node, profile, name_map, bnode_name_maker)[source]

Turn a node in an RDF graph into its turtle representation.

pymantic.serializers.turtle_sorted_names(l, name_maker)[source]

Sort a list of nodes in a graph by turtle name.

pymantic.serializers.turtle_string_escape(string)[source]

Escape a string appropriately for output in turtle form.