View Source RDF.Namespace.IRI (RDF.ex v2.0.1)

Provides the term_to_iri/1 macro to resolve IRI values inside of pattern matches.

Summary

Functions

A macro which allows to resolve IRI values inside of pattern matches.

Functions

Link to this macro

term_to_iri(expr)

View Source (macro)

A macro which allows to resolve IRI values inside of pattern matches.

Terms of a RDF.Namespace (which includes terms of RDF.Vocabulary.Namespace) can't be resolved in pattern matches. This macro allows just that, by wrapping the terms in a pattern match with a call of this macro.

Note: Only literal values are allowed as arguments of this macro, since the argument expression needs to be evaluated at compile-time.

Example

import RDF.Namespace.IRI

case expr do
  term_to_iri(EX.Foo) -> ...
  term_to_iri(EX.bar()) -> ...
  ...
end