Copyright © Copyright (c) 2021 Driebit BV
Support routies for handling RDF triples. A typical triple has two variations.
One is for a value:
#{ <<"subject">> => <<"_:n1">>, <<"predicate">> => <<"http://....">>, <<"@value">> => <<"...">>, <<"@type">> => <<"http://....">>, <<"@language">> => <<"nl">> }.
And, if the object is a uri:
#{ <<"subject">> => <<"_:n1">>, <<"predicate">> => <<"http://....">>, <<"@id">> => <<"...">> }.
rdf_doc() = map()
rdf_triple() = map()
uri() = binary()
blank_id/0 | Generate an unique blank node identifier. |
compact/1 | Compact a doc using the known namespaces and simplify values. |
compact/2 | Compact a doc, add namespaces and simplify values. |
namespaces/0 | Default JSON-LD RDF namespace context. |
ns_compact/1 | Compact a namespace in a predicate using the default namespaces. |
ns_compact/2 | Compact a namespace in a predicate. |
ns_expand/1 | Expand a namespace in a predicate using the default namespaces. |
ns_expand/2 | Expand a namespace in a predicate. |
triples_to_docs/1 | Combine triples to one or more documents. |
blank_id() -> binary()
Generate an unique blank node identifier.
Compact a doc using the known namespaces and simplify values.
Compact a doc, add namespaces and simplify values.
namespaces() -> #{binary() := binary()}
Default JSON-LD RDF namespace context.
ns_compact(Pred) -> Pred
Compact a namespace in a predicate using the default namespaces. For example, replaces: http://www.w3.org/2001/XMLSchema#integer with xsd:integer
ns_compact(Pred, Ns) -> Pred
Compact a namespace in a predicate. For example, replaces: http://www.w3.org/2001/XMLSchema#integer with xsd:integer
ns_expand(Pred) -> Pred
Expand a namespace in a predicate using the default namespaces. For example, replaces: xsd:integer with http://www.w3.org/2001/XMLSchema#integer
ns_expand(Pred, Ns) -> Pred
Expand a namespace in a predicate. For example, replaces: xsd:integer with http://www.w3.org/2001/XMLSchema#integer
Combine triples to one or more documents. Every document
with a non-blank id is returned separately. The documents are mapped
using uri => rdf_doc
Generated by EDoc