oasis-tcs / openc2-jadn

OASIS OpenC2 TC: Specifing a vocabulary to describe the meaning of structured data, to provide hints for user interfaces working with structured data, and to make assertions about what a valid instance must look like. https://github.com/oasis-tcs/openc2-jadn
Other
4 stars 2 forks source link

Inheritance Extensions #72

Open davaya opened 1 month ago

davaya commented 1 month ago

As described for JSON Schema, schemas define static types and are inherently mismatched to the dynamically evaluated class inheritance used in object-oriented programming. Nonetheless, inheritance graphs are used extensively in software and data design.

JADN needs two kinds of type option to support inheritance: 1) Inheritance extensions (extends, restricts, and abstract) that can be processed directly by OOP software or by the JADN unfolding process 2) Inheritance annotations to record that the core type was generated using inheritance. Annotations do not affect schema processing and can be ignored by core JADN processors.

Unfolding converts extensions to core JADN by generating fully-expanded type definitions and replacing the extension with the annotation.