Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,86 @@ insight into the validation engine's behavior and logic flow.

The `Expect` header carries an expectation other than `100-continue`. See [RFC 9110 §10.1.1](https://datatracker.ietf.org/doc/html/rfc9110#section-10.1.1).

### RDF

!!! success "Enterprise"

This endpoint is only available in the [Enterprise](commercial.md)
edition. Learn more about [commercial licensing](commercial.md).

*This endpoint takes a JSON object wrapping an instance as its request body,
validates the instance against the JSON Schema located at the `{path}`
parameter, and promotes it to
[JSON-LD](https://www.w3.org/TR/json-ld11/) (and therefore RDF) using the
schema's `x-jsonld-*` annotations.*

```
POST /self/v1/api/schemas/rdf/{path}
```

The same schema that validates the instance declares how it maps to Linked
Data, keeping a single source of truth for both concerns. The annotation
vocabulary is documented in the [JSON Schema CLI RDF
documentation](https://github.com/sourcemeta/jsonschema/blob/main/docs/rdf.markdown).
A schema without such annotations (including schemas on dialects older than
2019-09, which do not support annotation collection) produces an empty
JSON-LD document. Availability follows the evaluate flag: schemas excluded
from evaluation in the [configuration file](configuration.md) cannot be
promoted.

Unlike the evaluate and trace endpoints, the request body is not the bare
instance, but a JSON object with the following properties:

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `/instance` | JSON | Yes | The instance to validate and promote |
| `/flatten` | Boolean | No | Whether to flatten the resulting document. Defaults to `false` |
| `/context` | Object | No | A JSON-LD context to compact (or, with `flatten`, flatten) the resulting document against |

Without a `context`, the response is the document in [expanded
form](https://www.w3.org/TR/json-ld11/#expanded-document-form) (or [flattened
form](https://www.w3.org/TR/json-ld11/#flattened-document-form) with
`flatten`). With a `context`, the response is in [compacted
form](https://www.w3.org/TR/json-ld11/#compacted-document-form). Remote
contexts are not fetched.

=== "200"
Comment thread
jviotti marked this conversation as resolved.

The instance promoted to JSON-LD, served as `application/ld+json`.

=== "400"

You must pass a request body that matches the request schema, or the
provided `context` cannot be processed (for example because it references
a remote context).

=== "404"

The schema does not exist.

=== "405"

The [configuration file](configuration.md) excludes evaluation for this
schema, or the [configuration file](configuration.md) marks the schema
collection as listed but not served.

=== "413"

The request body is too large. See [RFC 9110 §15.5.14](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.14).

=== "417"

The `Expect` header carries an expectation other than `100-continue`. See [RFC 9110 §10.1.1](https://datatracker.ietf.org/doc/html/rfc9110#section-10.1.1).

=== "422"

The instance does not conform to the schema (the problem details carry
the standard [JSON Schema output
errors](https://json-schema.org/draft/2020-12/json-schema-core#name-output-structure)),
or the schema's JSON-LD annotations cannot be resolved for this instance
(the problem details carry the offending annotation facet and instance
location).

### Metadata

*This endpoint retrieves metadata information about the JSON Schema located at
Expand Down
12 changes: 12 additions & 0 deletions docs/commercial.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ a JSON-RPC tool (not as a layer on top of REST but as a true MCP-first
integration), helping your AI assistants get the most out of your schema single
source of truth.

## Linked Data (RDF)

Enterprise instances can promote JSON instances to
[JSON-LD](https://www.w3.org/TR/json-ld11/) (and therefore RDF) through the
[RDF endpoint](api.md#rdf) and the equivalent MCP tool. The mapping is
declared through `x-jsonld-*` annotations on the very schemas that validate
the data (see the [JSON Schema CLI RDF
documentation](https://github.com/sourcemeta/jsonschema/blob/main/docs/rdf.markdown)),
so the same single source of truth governs both validation and semantics,
letting you feed knowledge graphs and semantic tooling straight from your
schema catalog.

## Authentication

Enterprise instances can gate access behind
Expand Down
6 changes: 5 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,14 @@ without building complex JSON Schema infrastructure from scratch.
performance with minimal compute resources. Run instances on modest hardware,
reducing infrastructure costs while maintaining enterprise-scale throughput
with a stateless horizontally-scalable design
- :material-robot: __MCP Server (Enterprise Only)__ Every instance doubles as a
- :material-robot: __MCP Server (Enterprise)__ Every instance doubles as a
fully-featured [Model Context Protocol](api.md#model-context-protocol)
server, letting AI tooling discover schemas as resources and call every HTTP
API action as a JSON-RPC tool
- :material-graph: __Linked Data Bridge (Enterprise)__ Promote validated
JSON instances to [JSON-LD/RDF](api.md#rdf) using annotations on the very
schemas that validate them, turning the catalog into a bridge between your
JSON data and knowledge graphs
- :material-lock: __Access Control (Enterprise)__ Gate part of your catalog, or
the entire instance, behind [authentication](configuration.md#authentication)
policies, keeping schemas private to the consumers you choose
Expand Down
Loading