RDF.ex v0.6.1 RDF View Source

The top-level module of RDF.ex.

RDF.ex consists of:

This top-level module provides shortcut functions for the construction of the basic elements and structures of RDF and some general helper functions.

For a general introduction you may refer to the guides on the homepage.

Link to this section Summary

Functions

Checks if the given value is a blank node.

A user-defined RDF.PrefixMap of prefixes to IRI namespaces.

Returns the default_prefixes/0 with additional prefix mappings.

See RDF.Boolean.Value.false/0.

See RDF.NS.RDF.first/3.

See RDF.NS.RDF.first/4.

See RDF.NS.RDF.first/5.

See RDF.NS.RDF.first/6.

See RDF.NS.RDF.nil/0.

See RDF.NS.RDF.object/3.

See RDF.NS.RDF.object/4.

See RDF.NS.RDF.object/5.

See RDF.NS.RDF.object/6.

See RDF.NS.RDF.predicate/3.

See RDF.NS.RDF.predicate/4.

See RDF.NS.RDF.predicate/5.

See RDF.NS.RDF.predicate/6.

Checks if the given value is a RDF resource.

See RDF.NS.RDF.rest/3.

See RDF.NS.RDF.rest/4.

See RDF.NS.RDF.rest/5.

See RDF.NS.RDF.rest/6.

A fixed set prefixes that will always be part of the default_prefixes/0.

See RDF.NS.RDF.subject/3.

See RDF.NS.RDF.subject/4.

See RDF.NS.RDF.subject/5.

See RDF.NS.RDF.subject/6.

Checks if the given value is a RDF term.

See RDF.Boolean.Value.true/0.

See RDF.NS.RDF.type/3.

See RDF.NS.RDF.type/4.

See RDF.NS.RDF.type/5.

See RDF.NS.RDF.type/6.

See RDF.NS.RDF.value/3.

See RDF.NS.RDF.value/4.

See RDF.NS.RDF.value/5.

See RDF.NS.RDF.value/6.

Link to this section Functions

See RDF.BlankNode.new/0.

See RDF.BlankNode.new/1.

Checks if the given value is a blank node.

Examples

iex> RDF.bnode?(RDF.bnode)
true
iex> RDF.bnode?(RDF.iri("http://example.com/resource"))
false
iex> RDF.bnode?(42)
false

See RDF.Boolean.new/1.

See RDF.Boolean.new/2.

See RDF.Dataset.new/0.

See RDF.Dataset.new/1.

See RDF.Dataset.new/2.

See RDF.Date.new/1.

See RDF.Date.new/2.

See RDF.DateTime.new/1.

See RDF.DateTime.new/2.

See RDF.DateTime.new/1.

See RDF.DateTime.new/2.

See RDF.DateTime.new/1.

See RDF.DateTime.new/2.

See RDF.Decimal.new/1.

See RDF.Decimal.new/2.

A user-defined RDF.PrefixMap of prefixes to IRI namespaces.

This prefix map will be used implicitly wherever a prefix map is expected, but not provided. For example, when you don't pass a prefix map to the Turtle serializer, this prefix map will be used.

By default the standard_prefixes/0 are part of this prefix map, but you can define additional default prefixes via the default_prefixes compile-time configuration.

For example:

config :rdf,
  default_prefixes: %{
    ex: "http://example.com/"
  }

If you don't want the standard_prefixes/0 to be part of the default prefixes, or you want to map the standard prefixes to different namespaces (strongly discouraged!), you can set the use_standard_prefixes compile-time configuration flag to false.

config :rdf,
  use_standard_prefixes: false
Link to this function

default_prefixes(prefix_mappings) View Source

Returns the default_prefixes/0 with additional prefix mappings.

The prefix_mappings can be given in any format accepted by RDF.PrefixMap.new/1.

See RDF.Description.new/1.

See RDF.Description.new/2.

Link to this function

description(arg1, arg2, arg3) View Source

See RDF.Description.new/3.

See RDF.Double.new/1.

See RDF.Double.new/2.

See RDF.Boolean.Value.false/0.

See RDF.NS.RDF.first/0.

See RDF.NS.RDF.first/2.

See RDF.NS.RDF.first/3.

See RDF.NS.RDF.first/4.

Link to this function

first(s, o1, o2, o3, o4) View Source

See RDF.NS.RDF.first/5.

Link to this function

first(s, o1, o2, o3, o4, o5) View Source

See RDF.NS.RDF.first/6.

See RDF.Graph.new/0.

See RDF.Graph.new/1.

See RDF.Graph.new/2.

See RDF.Graph.new/3.

Link to this function

graph(arg1, arg2, arg3, arg4) View Source

See RDF.Graph.new/4.

See RDF.Integer.new/1.

See RDF.Integer.new/2.

See RDF.IRI.new/1.

See RDF.IRI.new!/1.

See RDF.IRI.valid?/1.

See RDF.NS.RDF.langString/0.

See RDF.LangString.new/1.

See RDF.LangString.new/2.

See RDF.LangString.new/1.

Link to this function

lang_string(value, opts) View Source

See RDF.LangString.new/2.

See RDF.List.node?/1.

See RDF.List.node?/2.

See RDF.Literal.new/1.

See RDF.Literal.new/2.

See RDF.NS.RDF.nil/0.

See RDF.NS.RDF.object/0.

See RDF.NS.RDF.object/2.

See RDF.NS.RDF.object/3.

See RDF.NS.RDF.object/4.

Link to this function

object(s, o1, o2, o3, o4) View Source

See RDF.NS.RDF.object/5.

Link to this function

object(s, o1, o2, o3, o4, o5) View Source

See RDF.NS.RDF.object/6.

See RDF.NS.RDF.predicate/0.

See RDF.NS.RDF.predicate/2.

See RDF.NS.RDF.predicate/3.

Link to this function

predicate(s, o1, o2, o3) View Source

See RDF.NS.RDF.predicate/4.

Link to this function

predicate(s, o1, o2, o3, o4) View Source

See RDF.NS.RDF.predicate/5.

Link to this function

predicate(s, o1, o2, o3, o4, o5) View Source

See RDF.NS.RDF.predicate/6.

See RDF.PrefixMap.new/1.

See RDF.Quad.new/1.

See RDF.Quad.new/4.

Link to this function

read_file(filename, opts \\ []) View Source

See RDF.Serialization.read_file/2.

Link to this function

read_file!(filename, opts \\ []) View Source

See RDF.Serialization.read_file!/2.

Link to this function

read_string(content, opts) View Source

See RDF.Serialization.read_string/2.

Link to this function

read_string!(content, opts) View Source

See RDF.Serialization.read_string!/2.

Checks if the given value is a RDF resource.

Examples

Supposed EX is a RDF.Vocabulary.Namespace and Foo is not.

iex> RDF.resource?(RDF.iri("http://example.com/resource"))
true
iex> RDF.resource?(EX.resource)
true
iex> RDF.resource?(EX.Resource)
true
iex> RDF.resource?(Foo.Resource)
false
iex> RDF.resource?(RDF.bnode)
true
iex> RDF.resource?(RDF.integer(42))
false
iex> RDF.resource?(42)
false

See RDF.NS.RDF.rest/0.

See RDF.NS.RDF.rest/2.

See RDF.NS.RDF.rest/3.

See RDF.NS.RDF.rest/4.

See RDF.NS.RDF.rest/5.

Link to this function

rest(s, o1, o2, o3, o4, o5) View Source

See RDF.NS.RDF.rest/6.

A fixed set prefixes that will always be part of the default_prefixes/0.

%RDF.PrefixMap{
  map: %{
    rdf: ~I<http://www.w3.org/1999/02/22-rdf-syntax-ns#>,
    rdfs: ~I<http://www.w3.org/2000/01/rdf-schema#>,
    xsd: ~I<http://www.w3.org/2001/XMLSchema#>
  }
}

See default_prefixes/0, if you don't want these standard prefixes to be part of the default prefixes.

See RDF.String.new/1.

See RDF.String.new/2.

See RDF.NS.RDF.subject/0.

See RDF.NS.RDF.subject/2.

See RDF.NS.RDF.subject/3.

See RDF.NS.RDF.subject/4.

Link to this function

subject(s, o1, o2, o3, o4) View Source

See RDF.NS.RDF.subject/5.

Link to this function

subject(s, o1, o2, o3, o4, o5) View Source

See RDF.NS.RDF.subject/6.

Checks if the given value is a RDF term.

Examples

Supposed EX is a RDF.Vocabulary.Namespace and Foo is not.

iex> RDF.term?(RDF.iri("http://example.com/resource"))
true
iex> RDF.term?(EX.resource)
true
iex> RDF.term?(EX.Resource)
true
iex> RDF.term?(Foo.Resource)
false
iex> RDF.term?(RDF.bnode)
true
iex> RDF.term?(RDF.integer(42))
true
iex> RDF.term?(42)
false

See RDF.Time.new/1.

See RDF.Time.new/2.

See RDF.Triple.new/1.

See RDF.Triple.new/3.

See RDF.Boolean.Value.true/0.

See RDF.NS.RDF.type/0.

See RDF.NS.RDF.type/2.

See RDF.NS.RDF.type/3.

See RDF.NS.RDF.type/4.

See RDF.NS.RDF.type/5.

Link to this function

type(s, o1, o2, o3, o4, o5) View Source

See RDF.NS.RDF.type/6.

See RDF.IRI.new/1.

See RDF.IRI.new!/1.

See RDF.IRI.valid?/1.

See RDF.NS.RDF.value/0.

See RDF.NS.RDF.value/2.

See RDF.NS.RDF.value/3.

See RDF.NS.RDF.value/4.

Link to this function

value(s, o1, o2, o3, o4) View Source

See RDF.NS.RDF.value/5.

Link to this function

value(s, o1, o2, o3, o4, o5) View Source

See RDF.NS.RDF.value/6.

Link to this function

write_file(content, filename, opts \\ []) View Source

See RDF.Serialization.write_file/3.

Link to this function

write_file!(content, filename, opts \\ []) View Source

See RDF.Serialization.write_file!/3.

Link to this function

write_string(content, opts) View Source

See RDF.Serialization.write_string/2.

Link to this function

write_string!(content, opts) View Source

See RDF.Serialization.write_string!/2.