View Source RDF.XML.Decoder (RDF-XML.ex v1.2.0)

A decoder for RDF/XML serializations to RDF.Graphs.

As for all decoders of RDF.Serialization.Formats, you normally won't use these functions directly, but via one of the read_ functions on the RDF.XML format module or the generic RDF.Serialization module.

Options

  • :base: allows to specify the base URI to be used in contexts where relative URIs are used and no base URI is defined with a xml:base definition
  • :bnode_prefix: allows to specify the prefix which auto-generated blank nodes should get (default: "b")

Summary

Functions

Decodes an RDF/XML string to a RDF.Graph.

Decodes an RDF/XML stream to a RDF.Graph.

Functions

Link to this function

decode(string, opts \\ [])

View Source
@spec decode(
  String.t() | Enumerable.t(),
  keyword()
) :: {:ok, RDF.Graph.t()} | {:error, any()}

Decodes an RDF/XML string to a RDF.Graph.

The result is returned in an :ok tuple or an :error tuple in case of an error.

For a description of the available options see the module documentation.

Link to this function

decode_from_stream(stream, opts \\ [])

View Source
@spec decode_from_stream(
  Enumerable.t(),
  keyword()
) :: {:ok, RDF.Graph.t()} | {:error, any()}

Decodes an RDF/XML stream to a RDF.Graph.

For a description of the available options see the module documentation.