=encoding utf8
=head1 NAME
rdf/serializer/yamlld - YAML-LD serializer.
=cut
from rdf/serializer import RdfSerializer;
from rdf/jsonld/core import rdf_to_jsonld_data;
from std/data/yaml import YAML;
class YamlLdSerializer with RdfSerializer {
let Boolean pretty with get := true;
let Boolean canonical with get := true;
let Boolean ordered with get := true;
let Boolean use_native_types with get := false;
let Boolean use_rdf_type with get := false;
let rdf_direction with get := null;
method _data ( Array quads ) {
return rdf_to_jsonld_data(quads, {
use_native_types: use_native_types,
use_rdf_type: use_rdf_type,
rdf_direction: rdf_direction,
});
}
method serialize ( Array quads ) {
return ( new YAML( pretty: pretty, canonical: canonical ) ).encode(
self._data(quads),
);
}
}
modules/rdf/serializer/yamlld.zzm
rdf-jsonld-0.0.2 source code
Package
- Name
- rdf-jsonld
- Version
- 0.0.2
- Uploaded
- 2026-06-13 00:21:24
- Repository
- https://github.com/tobyink/zuzu-rdf-jsonld
- Dependencies
-
-
html/parser>= 0 -
json/canonicalization>= 0 -
rdf>= 0 -
std/data/cbor>= 0 -
std/data/json>= 0 -
std/data/yaml>= 0 -
std/io>= 0 -
std/string>= 0
-
- Metadata
- zuzu-distribution.json
- Archive
- Download .tar.gz