RDF.FragmentGraph (CPub v0.3.0) View Source
A set of RDF triples about the same subject or fragments of the subject.
Blank nodes are not permitted.
An RDF.FragmentGraph
defines a grouping of RDF triples about a certain
subject that is suitable for content-addressing (see
https://openengiadina.net/papers/content-addressable-rdf.html)
It is similar to a RDF.Description
but additionally allows statements with
fragments of the base subject as subject (e.g. If ~Ihttp://example.com/ is
the base subject of the RDF.FragmentGraph
then statements with subject
~Ihttp://example.com/#a-fragment are also permitted).
RDF.FragmentGraph
implements:
Link to this section Summary
Functions
Add statement to RDF.FragmentGraph
.
Add object to a predicate of a fragemnt of the RDF.FragmentGraph
.
Delete statement(s) from RDF.FragmentGraph
.
Delete a fragment statement from the RDF.FragmentGraph
.
Checks if the RDF.FragmentGraph
contains a statement about given subject.
Returns a RDF.Description
of the given subject with statements in RDF.FragmentGraph
.
Fetches the description of the given subject.
Finalize the RDF.FragmentGraph
with a custom finalizer. The default finalizer
sets the base subject to the ERIS URN of the content.
Returns a fragment reference to id
.
Return RDF.Graph
for given RDF.FragmentGraph
.
Create a new RDF Fragment Graph.
Returns a set of all objects in RDF.FragmentGraph
Pops the description of the given subject.
Retuns a set of all predicates in RDF.FragmentGraph
Set the base subject of RDF.FragmentGraph
.
Returns a list of all statements in RDF.FragmentGraph
.
Returns a set of all subjects in RDF.FragmentGraph
.
Link to this section Types
Specs
coerce_options() :: [{:base_subject, RDF.IRI.t()}]
Specs
coercible_object() :: RDF.IRI.coercible() | RDF.Literal.t() | RDF.FragmentGraph.FragmentReference.t()
Specs
coercible_predicate() :: RDF.IRI.coercible() | RDF.FragmentGraph.FragmentReference.t()
Specs
coercible_subject() :: RDF.IRI.coercible()
Specs
fragment_identifier() :: String.t()
Specs
fragment_statements() :: %{optional(fragment_identifier()) => statements()}
Specs
object() :: RDF.IRI.t() | RDF.Literal.t() | RDF.FragmentGraph.FragmentReference.t()
Specs
predicate() :: RDF.IRI.t() | RDF.FragmentGraph.FragmentReference.t()
Specs
Specs
subject() :: RDF.IRI.t()
Specs
t() :: %RDF.FragmentGraph{ base_subject: subject(), fragment_statements: fragment_statements(), statements: statements() }
Link to this section Functions
Specs
add( t(), {coercible_predicate(), coercible_object()} | RDF.Statement.t() | [RDF.Statement.t()] | RDF.Data.t() ) :: t()
Add statement to RDF.FragmentGraph
.
Specs
add_fragment_statement( t(), fragment_identifier(), {coercible_predicate(), coercible_object()} ) :: t()
Add object to a predicate of a fragemnt of the RDF.FragmentGraph
.
Specs
coerce_iri(RDF.IRI.t(), coerce_options()) :: :base_subject | RDF.IRI.t() | RDF.FragmentGraph.FragmentReference.t()
Specs
delete( t(), {coercible_predicate(), coercible_object()} | RDF.Statement.t() | [RDF.Statement.t()] | RDF.Data.t(), keyword() ) :: t()
Delete statement(s) from RDF.FragmentGraph
.
Specs
delete_fragment_statement( t(), fragment_identifier(), {coercible_predicate(), coercible_object()} ) :: t()
Delete a fragment statement from the RDF.FragmentGraph
.
Specs
Checks if the RDF.FragmentGraph
contains a statement about given subject.
Specs
description(t(), subject()) :: RDF.Description.t()
Returns a RDF.Description
of the given subject with statements in RDF.FragmentGraph
.
Specs
descriptions(t()) :: [RDF.Description.t()]
Specs
Specs
fetch(t(), RDF.Statement.coercible_subject()) :: {:ok, [RDF.Description.t()]} | :error
Fetches the description of the given subject.
When the subject can not be found :error
is returned.
Specs
Finalize the RDF.FragmentGraph
with a custom finalizer. The default finalizer
sets the base subject to the ERIS URN of the content.
Returns a fragment reference to id
.
This is a shortcut to RDF.FragmentGraph.FragmentReference.new(id)
.
Specs
graph(t()) :: RDF.Graph.t()
Return RDF.Graph
for given RDF.FragmentGraph
.
Specs
include?(t(), RDF.Statement.t(), keyword()) :: bool()
Specs
Specs
merge(t(), RDF.Statement.t(), keyword()) :: RDF.Graph.t()
Specs
new() :: t()
Specs
new(RDF.IRI.coercible() | RDF.Data.t()) :: t()
Create a new RDF Fragment Graph.
Specs
Returns a set of all objects in RDF.FragmentGraph
Specs
Specs
pop(t(), RDF.Statement.coercible_subject()) :: {t() | nil, t()}
Pops the description of the given subject.
Specs
Retuns a set of all predicates in RDF.FragmentGraph
Specs
put(t(), t() | RDF.Graph.input(), keyword()) :: t()
Specs
put_properties(t(), t() | RDF.Graph.input(), keyword()) :: t()
Specs
Specs
set_base_subject(t(), RDF.IRI.coercible()) :: t()
Set the base subject of RDF.FragmentGraph
.
Specs
statement_count(t()) :: non_neg_integer()
Specs
statements(t()) :: [RDF.Statement.t()]
Returns a list of all statements in RDF.FragmentGraph
.
Specs
subject_count(t()) :: non_neg_integer()
Specs
Returns a set of all subjects in RDF.FragmentGraph
.