View Source Ontogen.Bog.Referencable behaviour (Ontogen v0.1.1)
Summary
Functions
Returns the fully instantiated referencable singleton resource of the given schema
loaded from the given graph
.
Returns the IRI of the referencable resource of the given schema
.
Returns the ref name for the referencable singleton instance of the given schema or class IRI.
Checks if the given module
is a Ontogen.Bog.Referencable
.
Types
@type ref() :: String.t()
Callbacks
@callback deref(ref(), RDF.Graph.t()) :: {:ok, Grax.Schema.t()} | {:error, any()}
@callback this(RDF.Graph.t()) :: {:ok, Grax.Schema.t()} | {:error, any()}
@callback this_ref() :: ref()
Functions
Returns the fully instantiated referencable singleton resource of the given schema
loaded from the given graph
.
Returns the IRI of the referencable resource of the given schema
.
@spec from(Grax.Schema.t()) :: {:ok, t()} | {:error, any()}
@spec from!(Grax.Schema.t()) :: t()
@spec load( RDF.Graph.t() | RDF.Description.t(), RDF.IRI.coercible() | RDF.BlankNode.t(), opts :: keyword() ) :: {:ok, t()} | {:error, any()}
@spec load!( RDF.Graph.t() | RDF.Description.t(), RDF.IRI.coercible() | RDF.BlankNode.t(), opts :: keyword() ) :: t()
Returns the ref name for the referencable singleton instance of the given schema or class IRI.
Examples
iex> Ontogen.Bog.Referencable.this_ref(~I<https://w3id.org/ontogen#Service>)
"service"
iex> Ontogen.Bog.Referencable.this_ref(~I<http://xmlns.com/foaf/0.1/Agent>)
"agent"
iex> Ontogen.Bog.Referencable.this_ref(Ontogen.Agent)
"agent"
iex> Ontogen.Bog.Referencable.this_ref(FOAF.Agent)
"agent"
Checks if the given module
is a Ontogen.Bog.Referencable
.
Examples
iex> Ontogen.Bog.Referencable.type?(Ontogen.Repository)
true
iex> Ontogen.Bog.Referencable.type?(Ontogen.Commit)
false