Skip to content
Open
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
54 changes: 54 additions & 0 deletions registries/_extension/x-jsonld-context.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
owner: ioggstream
issue:
description: Used to associate a JSON-LD context to a schema, enabling semantic interpretation of JSON data.
schema:
oneOf:
- type: string
format: uri
- type: object
- type: array
items:
oneOf:
- type: string
format: uri
- type: object
objects: [ "schemaObject" ]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on your I-D, I see that this is primarily JSON Schema-oriented. But there are many API constructs where the description is spread across other types of Objects as well.

For example, while you might think of your form-encoded query string as one piece of data to model, it's actually split up over numerous Parameter Objects and Schema Objects.

Will restricting this to Schema Objects actually allow solving all of the semantic description use cases for an API?

layout: default
---

{% capture summary %}
The `x-jsonld-context` extension is used to associate a JSON-LD `@context` to a schema, enabling semantic interpretation of JSON data by mapping terms to IRIs and defining the vocabulary. It can appear as a property in the following objects: `{{page.objects|jsonify}}`.

It can be used in conjunction with `x-jsonld-type`.

This extension is defined in [draft-polli-restapi-ld-keywords](https://datatracker.ietf.org/doc/draft-polli-restapi-ld-keywords/) and is based on the [JSON-LD 1.1](https://www.w3.org/TR/json-ld11/#interpreting-json-as-json-ld) specification.
{% endcapture %}

{% capture example %}
```yaml
openapi: 3.2.0
...
components:
schemas:
Person:
"x-jsonld-context":
"@vocab": "https://schema.org/"
type: object
properties:
familyName: { type: string, maxLength: 255 }
givenName: { type: string, maxLength: 255 }
example:
familyName: "Doe"
givenName: "John"
```

Used by: (informational)

* Italian Agencies
* https://schema.gov.it
* https://api.gov.it
{% endcapture %}

{% include extension-entry.md summary=summary example=example %}

50 changes: 50 additions & 0 deletions registries/_extension/x-jsonld-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
owner: ioggstream
issue:
description: Used to associate a JSON-LD type to a schema, enabling semantic interoperability.
schema:
oneOf:
- type: string
- type: array
items:
type: string
objects: [ "schemaObject" ]
layout: default
---

{% capture summary %}
The `x-jsonld-type` extension is used to associate a JSON-LD `@type` to a schema, enabling semantic interoperability by specifying the type of the resource in terms of ontologies and vocabularies. It can appear as a property in the following objects: `{{page.objects|jsonify}}`.

It can be used in conjunction with `x-jsonld-context`.

This extension is defined in [draft-polli-restapi-ld-keywords](https://datatracker.ietf.org/doc/draft-polli-restapi-ld-keywords/) and is based on the [JSON-LD 1.1](https://www.w3.org/TR/json-ld11/#interpreting-json-as-json-ld) specification.
{% endcapture %}

{% capture example %}
```yaml
openapi: 3.2.0
...
components:
schemas:
Person:
"x-jsonld-type": "https://schema.org/Person"
"x-jsonld-context":
"@vocab": "https://schema.org/"
type: object
properties:
familyName: { type: string, maxLength: 255 }
givenName: { type: string, maxLength: 255 }
example:
familyName: "Doe"
givenName: "John"
```

Used by: (informational)

* Italian Agencies
* https://schema.gov.it
* https://api.gov.it
{% endcapture %}

{% include extension-entry.md summary=summary example=example %}