CenitHub
Chapter 2
Libraries, Schemas & Data Types
Libraries, Schemas & Data Types
Libraries are collections of
schemas and data types.
Schemas define data types.
File data types can be validated
against a schema.
Library
Schema
Data Type
File Data Type
Schemas
Define a data type is as simple as a
JSON Schema.
http://json-schema.org
Basic JSON Schema
Title defines a title for the data type,
use is optional.
Type object is mandatory for enhanced
data types interaction.
Properties is mandatory for enhanced
data types interaction.
Required properties definition is
optional.
Basic JSON Schema
Title defines a title for the data type,
use is optional.
Type object is mandatory for enhanced
data types interaction.
Properties is mandatory for enhanced
data types interaction.
Required properties definition is
optional.
Basic JSON Schema
Title defines a title for the data type,
use is optional.
Type object is mandatory for enhanced
data types interaction.
Properties is mandatory for enhanced
data types interaction.
Required properties definition is
optional.
Basic JSON Schema
Title defines a title for the data type,
use is optional.
Type object is mandatory for enhanced
data types interaction.
Properties is mandatory for enhanced
data types interaction.
Required properties definition is
optional.
The new schema action
Every schema have an URI and must be included in a library.
Loading Data types
When loading a data type Cenit
creates a class model on the fly that
can be used as any other model in the
administration view.
Loading Data types
List of Data types
List of Costumers
Enhancing Schemas
Enhancing Schemas
Reusing Schemas
costumer.json address.json
XML Schemas
Defining data types from
XML Schemas is supported.
This example defines a data
type element:Costumer
with an embedded
definition of Address.
XML Schemas
Cenit defines a data type for
every top level type or
element, so a single XML
Schema may define multiple
data types.
This example defines two
data types, type:Address and
element:Costumer
Reusing XML Schemas
address.xsd
costumer.xsd
Cenit automatically links data types
when referencing XML Schemas.
Versioning Schemas
URIs and data type names must be unique in the same library but data types
versions with the same URI or name can be defined in different libraries.
Data Type Storage
Data type records derived from schemas are stored as JSONs structured
documents.
Limitations:
- Mapping XML documents to JSON is not always feasible.
- What about data structured in other formats?
- What about data non structured at all?
File Data Types
File data types allow to store files
as records.
Files content can be validated
against a validator.
If no validator is selected then the
file content can have any structure.
File Data Types & Validators
By default every schema is also a
validator.
Every file records can be fully
validated against a XML Schema or
a JSON Schema.
File Data Types & Validators
Cenit prevents to store invalid data so every file content is validated when uploading
and before storing.
Custom Validators: EDI
Cenit allows to customize file
validators.
EDI Validators use schemas as
grammars for EDI formats based on
model storage by segments
containing record fields:
Costumer*Jhon*Stark*stark@mail.com
billing_addres*1*Street*City
shipping_addres*2*Street*City
Custom Validators: EDI
Several formats can be described
by using JSON Schemas as
grammars:
₋ ASCX12
₋ EDIFACT
₋ TRADACOM
₋ CATAIR
₋ …
Grammar of X12 IEA Segment
CenitHub
Chapter 2
Libraries, Schemas & Data Types

CenitHub Presentations | 2- Libraries, Schemas & Data Types

  • 1.
  • 2.
    Libraries, Schemas &Data Types Libraries are collections of schemas and data types. Schemas define data types. File data types can be validated against a schema. Library Schema Data Type File Data Type
  • 3.
    Schemas Define a datatype is as simple as a JSON Schema. http://json-schema.org
  • 4.
    Basic JSON Schema Titledefines a title for the data type, use is optional. Type object is mandatory for enhanced data types interaction. Properties is mandatory for enhanced data types interaction. Required properties definition is optional.
  • 5.
    Basic JSON Schema Titledefines a title for the data type, use is optional. Type object is mandatory for enhanced data types interaction. Properties is mandatory for enhanced data types interaction. Required properties definition is optional.
  • 6.
    Basic JSON Schema Titledefines a title for the data type, use is optional. Type object is mandatory for enhanced data types interaction. Properties is mandatory for enhanced data types interaction. Required properties definition is optional.
  • 7.
    Basic JSON Schema Titledefines a title for the data type, use is optional. Type object is mandatory for enhanced data types interaction. Properties is mandatory for enhanced data types interaction. Required properties definition is optional.
  • 8.
    The new schemaaction Every schema have an URI and must be included in a library.
  • 9.
    Loading Data types Whenloading a data type Cenit creates a class model on the fly that can be used as any other model in the administration view.
  • 10.
    Loading Data types Listof Data types List of Costumers
  • 11.
  • 12.
  • 13.
  • 14.
    XML Schemas Defining datatypes from XML Schemas is supported. This example defines a data type element:Costumer with an embedded definition of Address.
  • 15.
    XML Schemas Cenit definesa data type for every top level type or element, so a single XML Schema may define multiple data types. This example defines two data types, type:Address and element:Costumer
  • 16.
    Reusing XML Schemas address.xsd costumer.xsd Cenitautomatically links data types when referencing XML Schemas.
  • 17.
    Versioning Schemas URIs anddata type names must be unique in the same library but data types versions with the same URI or name can be defined in different libraries.
  • 18.
    Data Type Storage Datatype records derived from schemas are stored as JSONs structured documents. Limitations: - Mapping XML documents to JSON is not always feasible. - What about data structured in other formats? - What about data non structured at all?
  • 19.
    File Data Types Filedata types allow to store files as records. Files content can be validated against a validator. If no validator is selected then the file content can have any structure.
  • 20.
    File Data Types& Validators By default every schema is also a validator. Every file records can be fully validated against a XML Schema or a JSON Schema.
  • 21.
    File Data Types& Validators Cenit prevents to store invalid data so every file content is validated when uploading and before storing.
  • 22.
    Custom Validators: EDI Cenitallows to customize file validators. EDI Validators use schemas as grammars for EDI formats based on model storage by segments containing record fields: Costumer*Jhon*Stark*stark@mail.com billing_addres*1*Street*City shipping_addres*2*Street*City
  • 23.
    Custom Validators: EDI Severalformats can be described by using JSON Schemas as grammars: ₋ ASCX12 ₋ EDIFACT ₋ TRADACOM ₋ CATAIR ₋ … Grammar of X12 IEA Segment
  • 24.