# `Dmn.Model.Reference`
[🔗](https://github.com/FeeJai/BDM/blob/dmn-v0.1.0/apps/dmn/lib/dmn/model.ex#L106)

A reference to an element: `href="#id"` is an element of the same model, `href="namespace#id"` one of the model with that
namespace, which a model imports (DMN 1.6, 6.3.3). An `id` is an `xsd:ID`, which has no `#`, and a namespace may have one
(`https://example.org/m#v2`), so the `id` is what follows the last `#`.

# `t`

```elixir
@type t() :: %Dmn.Model.Reference{id: String.t(), namespace: String.t() | nil}
```

# `parse`

```elixir
@spec parse(String.t()) :: t() | nil
```

Reads the value of an `href`. `nil` for one that names nothing.

    iex> Dmn.Model.Reference.parse("#_a1")
    %Dmn.Model.Reference{namespace: nil, id: "_a1"}
    iex> Dmn.Model.Reference.parse("https://example.org/m#_b2")
    %Dmn.Model.Reference{namespace: "https://example.org/m", id: "_b2"}
    iex> Dmn.Model.Reference.parse("https://example.org/m#v2#_b2")
    %Dmn.Model.Reference{namespace: "https://example.org/m#v2", id: "_b2"}
    iex> Dmn.Model.Reference.parse("no-fragment")
    nil

---

*Consult [api-reference.md](api-reference.md) for complete listing*
