Internet-Draft OO-LD Schema October 2024
Stier Expires 4 April 2025 [Page]
Workgroup:
Network Working Group
Internet-Draft:
draft-stier-oold-schema-latest
Published:
Intended Status:
Informational
Expires:
Author:
S. Stier
Your Organization Here

Object Oriented Linked Data Schema

Abstract

TODO Abstract

About This Document

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.

Status of This Memo

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.

Table of Contents

1. Introduction

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

2. Conventions and Definitions

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.

2.1. JSON Document

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].

2.2. Instance Document

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.

2.3. OO-LD Schema Document

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]

3. Security Considerations

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.

4. IANA Considerations

4.1. 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

4.2. 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

5. References

5.1. Normative References

[JSONLD]
"JSON-LD 1.1", n.d., <https://www.w3.org/TR/2020/REC-json-ld11-20200716/>.
[RFC2119]
Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, , <https://www.rfc-editor.org/rfc/rfc2119>.
[RFC8174]
Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, , <https://www.rfc-editor.org/rfc/rfc8174>.
[RFC8259]
Bray, T., Ed., "The JavaScript Object Notation (JSON) Data Interchange Format", STD 90, RFC 8259, DOI 10.17487/RFC8259, , <https://www.rfc-editor.org/rfc/rfc8259>.

5.2. Informative References

[RFC7049]
Bormann, C. and P. Hoffman, "Concise Binary Object Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, , <https://www.rfc-editor.org/rfc/rfc7049>.

Acknowledgments

TODO acknowledge.

Author's Address

Simon Stier
Your Organization Here