Internet-Draft | OO-LD Schema | October 2024 |
Stier | Expires 4 April 2025 | [Page] |
TODO Abstract¶
This note is to be removed before publishing as an RFC.¶
The latest revision of this draft can be found at https://OO-LD.github.io/specification/draft-stier-oold-schema.html. Status information for this document may be found at https://datatracker.ietf.org/doc/draft-stier-oold-schema/.¶
Source for this draft and an issue tracker can be found at https://github.com/OO-LD/specification.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 4 April 2025.¶
Copyright (c) 2024 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
The core idea is that an OO-LD document is always both a valid JSON-SCHEMA and a JSON-LD remote context ( != JSON-LD document). In this way a complete OO-LD class / schema hierarchy is consumeable by JSON-SCHEMA-only and JSON-LD-only tools while OO-LD aware tools can provide extended features on top (e.g. UI autocomplete dropdowns for string-IRI fields based e.g. on a SPARQL backend, SHACL shape or JSON-LD frame generation).¶
A minimal example:¶
{ "@context": { "schema": "http://schema.org/", "name": "schema:name" }, "title": "Person", "type": "object", "properties": { "name": { "type": "string", "description": "First and Last name" } } }¶
Please note that OO-LD schema documents MUST not be interpreted as JSON-LD documents because this would apply @context
on the schema itself. The motivation behind this is to have a single document so schemas can be aggregated using both the JSON-SCHEMA $ref
and the JSON-LD remote @context
pointing the same resource.¶
%%{init: {'theme': 'neutral' } }%% classDiagram class OOLD_Class_A { JSON-SCHEMA + JSON-LD @context: ... properties: a... } class OOLD_Class_B { JSON-SCHEMA + JSON-LD @context: ./A allOf: ./A properties: b... } class OOLD_Instance_B { JSON @context: ./B $schema: ./B a: ... b: ... } OOLD_Class_A <-- OOLD_Class_B: extends OOLD_Class_B <-- OOLD_Instance_B: type¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
A JSON document is an information resource (series of octets) described by the application/json media type. OO-LD Schema is only defined over JSON documents. However, any document or memory structure that can be parsed into or processed according to the JSON Schema data model can be interpreted against a OO-LD Schema, including media types like CBOR [RFC7049].¶
A JSON document to which a OO-LD schema is applied is known as an "instance". OO-LD Schema is defined over application/json
or compatible documents, including media types with the +json
structured syntax suffix. Among these, this specification defines the application/schema-instance+json
media type which defines handling for fragments in the URI.¶
A OO-LD Schema document, is a JSON document used to describe an instance. A OO-LD schema SHOULD always be given the media type application/oold-schema+json
rather than application/oold-schema-instance+json
. The application/oold-schema+json
media type is defined to offer a superset of the fragment identifier syntax and semantics provided by application/oold-schema-instance+json
.
A OO-LD Schema document SHOULD contain a @context
keyword, pointing to a valid JSON-LD context definition according to [JSONLD]¶
Both schemas and instances are JSON values. As such, all security considerations defined in RFC 8259 [RFC8259] apply.¶
Instances and schemas are both frequently written by untrusted third parties, to be deployed on public Internet servers. Implementations should take care that the parsing and evaluating against schemas does not consume excessive system resources. Implementations MUST NOT fall into an infinite loop.¶
A malicious party could cause an implementation to repeatedly collect a copy of a very large value as an annotation. Implementations SHOULD guard against excessive consumption of system resources in such a scenario.¶
Servers MUST ensure that malicious parties cannot change the functionality of
existing schemas by uploading a schema with a pre-existing or very similar
$id
.¶
Individual OO-LD Schema extensions are liable to also have their own security considerations. Consult the respective specifications for more information.¶
Schema authors should take care with $comment
contents, as a malicious
implementation can display them to end-users in violation of a spec, or fail to
strip them if such behavior is expected.¶
A malicious schema author could place executable code or other dangerous
material within a $comment
. Implementations MUST NOT parse or otherwise take
action based on $comment
contents.¶
application/oold-schema+json
The proposed MIME media type for OO-LD Schema is defined as follows:¶
Type name:: application¶
Subtype name:: oold-schema+json¶
Required parameters:: N/A¶
Encoding considerations:: Encoding considerations are identical to those
specified for the application/json
media type. See JSON [RFC8259].¶
Security considerations:: See Section 3 above.¶
Interoperability considerations:: TODO¶
Fragment identifier considerations:: TODO¶
application/oold-schema-instance+json
The proposed MIME media type for OO-LD Schema Instances that require a JSON Schema-specific media type is defined as follows:¶
Type name:: application¶
Subtype name:: oold-schema-instance+json¶
Required parameters:: N/A¶
Encoding considerations:: Encoding considerations are identical to those
specified for the application/json
media type. See JSON [RFC8259].¶
Security considerations:: See Section 3 above.¶
Interoperability considerations:: TODO¶
Fragment identifier considerations:: TODO¶
TODO acknowledge.¶