# `Jido.Character.Ontology.Renderer`
[🔗](https://github.com/agentjido/jido_character/blob/v1.0.0/lib/jido_character/ontology/renderer.ex#L1)

Renders character schemas and data to semantic web formats.

Supports exporting:
- **OWL/RDF-XML** - Schema (TBox) as OWL ontology
- **RDF Triples** - Data (ABox) as N-Triples or Turtle
- **JSON-LD** - Combined schema context + data for APIs

## Namespace

The default namespace is `http://jido.ai/character#`. Override with the `:namespace` option.

## Examples

    # Export schema as OWL
    Jido.Character.Ontology.Renderer.to_owl()

    # Export character as RDF triples
    {:ok, char} = Jido.Character.new(%{name: "Alex"})
    Jido.Character.Ontology.Renderer.to_rdf(char)

    # Export as JSON-LD
    Jido.Character.Ontology.Renderer.to_jsonld(char)

# `classes`

```elixir
@spec classes() :: [{atom(), String.t()}]
```

Returns the list of ontology classes.

# `datatype_properties`

```elixir
@spec datatype_properties() :: [{atom(), atom(), atom(), String.t()}]
```

Returns the list of datatype properties.

# `object_properties`

```elixir
@spec object_properties() :: [{atom(), atom(), atom(), String.t()}]
```

Returns the list of object properties.

# `to_jsonld`

```elixir
@spec to_jsonld(
  map(),
  keyword()
) :: map()
```

Exports a character as JSON-LD with embedded context.

## Options

- `:namespace` - Base namespace URI (default: `http://jido.ai/character#`)

## Examples

    iex> {:ok, char} = Jido.Character.new(%{name: "Alex"})
    iex> jsonld = Jido.Character.Ontology.Renderer.to_jsonld(char)
    iex> is_map(jsonld)
    true

# `to_owl`

```elixir
@spec to_owl(keyword()) :: String.t()
```

Exports the character ontology schema as OWL/RDF-XML.

## Options

- `:namespace` - Base namespace URI (default: `http://jido.ai/character#`)

## Examples

    iex> owl = Jido.Character.Ontology.Renderer.to_owl()
    iex> String.contains?(owl, "owl:Class")
    true

# `to_rdf`

```elixir
@spec to_rdf(
  map(),
  keyword()
) :: String.t()
```

Exports a character as RDF triples.

## Options

- `:namespace` - Base namespace URI (default: `http://jido.ai/character#`)
- `:format` - Output format: `:ntriples` (default) or `:turtle`

## Examples

    iex> {:ok, char} = Jido.Character.new(%{name: "Alex"})
    iex> triples = Jido.Character.Ontology.Renderer.to_rdf(char)
    iex> String.contains?(triples, "rdf:type")
    true

---

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