зеркало из https://github.com/microsoft/CDM.git
880 строки
29 KiB
JSON
880 строки
29 KiB
JSON
{
|
|
"$id": "http://microsoft.com/cdm/schema.cdm.json",
|
|
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
"$version": "0.7.0",
|
|
"type": "object",
|
|
"definitions": {
|
|
"import": {
|
|
"type": "object",
|
|
"description": "used to bring referenced entity definitions into scope of this document",
|
|
"properties": {
|
|
"corpusPath": {
|
|
"type": "string",
|
|
"description": "The relative or absolute (from the root of the corpus folder hierarchy) location of a document file and object"
|
|
},
|
|
"uri": {
|
|
"type": "string",
|
|
"description": "deprecated, replaced by corpusPath"
|
|
},
|
|
"moniker": {
|
|
"type": "string",
|
|
"description": "A prefix that can be added to disambiguate different imported objects that may share a name. References to object defined in this imported document (or in the documents it further imports) must start with the moniker name such as myMoniker/MyEntity"
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"oneOf": [
|
|
{
|
|
"required": [
|
|
"corpusPath"
|
|
]
|
|
},
|
|
{
|
|
"required": [
|
|
"uri"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"constant": {
|
|
"oneOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"$ref": "#/definitions/relationshipClassReference"
|
|
},
|
|
{
|
|
"$ref": "#/definitions/traitClassReference"
|
|
},
|
|
{
|
|
"$ref": "#/definitions/dataTypeClassReference"
|
|
},
|
|
{
|
|
"$ref": "#/definitions/attributeGroupClassReference"
|
|
},
|
|
{
|
|
"$ref": "#/definitions/entityClassReference"
|
|
},
|
|
{
|
|
"$ref": "#/definitions/entityAttribute"
|
|
},
|
|
{
|
|
"$ref": "#/definitions/typeAttribute"
|
|
}
|
|
]
|
|
},
|
|
"traitArgument": {
|
|
"type": "object",
|
|
"description": "",
|
|
"properties": {
|
|
"explanation": {
|
|
"type": "string",
|
|
"description": "Used to document the usage or meaning of the 'argument' within the context of this entity definition system."
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"value": {
|
|
"$ref": "#/definitions/constant"
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"value"
|
|
]
|
|
},
|
|
"traitReference": {
|
|
"oneOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"$ref": "#/definitions/trait"
|
|
}
|
|
]
|
|
},
|
|
"traitClassReference": {
|
|
"type": "object",
|
|
"description": "",
|
|
"properties": {
|
|
"traitReference": {
|
|
"$ref": "#/definitions/traitReference"
|
|
},
|
|
"arguments": {
|
|
"type": "array",
|
|
"items": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/definitions/traitArgument"
|
|
},
|
|
{
|
|
"$ref": "#/definitions/constant"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"traitReference"
|
|
]
|
|
},
|
|
"relationshipReference": {
|
|
"oneOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"$ref": "#/definitions/relationship"
|
|
}
|
|
]
|
|
},
|
|
"relationshipClassReference": {
|
|
"type": "object",
|
|
"description": "",
|
|
"properties": {
|
|
"relationshipReference": {
|
|
"$ref": "#/definitions/relationshipReference"
|
|
},
|
|
"appliedTraits": {
|
|
"type": "array",
|
|
"items": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/definitions/traitClassReference"
|
|
},
|
|
{
|
|
"type": "string"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"relationshipReference"
|
|
]
|
|
},
|
|
"dataTypeReference": {
|
|
"oneOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"$ref": "#/definitions/dataType"
|
|
}
|
|
]
|
|
},
|
|
"dataTypeClassReference": {
|
|
"type": "object",
|
|
"description": "",
|
|
"properties": {
|
|
"dataTypeReference": {
|
|
"$ref": "#/definitions/dataTypeReference"
|
|
},
|
|
"appliedTraits": {
|
|
"type": "array",
|
|
"items": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/definitions/traitClassReference"
|
|
},
|
|
{
|
|
"type": "string"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"dataTypeReference"
|
|
]
|
|
},
|
|
"attributeGroupReference": {
|
|
"oneOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"$ref": "#/definitions/attributeGroup"
|
|
}
|
|
]
|
|
},
|
|
"attributeGroupClassReference": {
|
|
"type": "object",
|
|
"description": "",
|
|
"properties": {
|
|
"attributeGroupReference": {
|
|
"$ref": "#/definitions/attributeGroupReference"
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"attributeGroupReference"
|
|
]
|
|
},
|
|
"entityReference": {
|
|
"oneOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"$ref": "#/definitions/entity"
|
|
},
|
|
{
|
|
"$ref": "#/definitions/constantEntity"
|
|
}
|
|
]
|
|
},
|
|
"entityClassReference": {
|
|
"type": "object",
|
|
"description": "",
|
|
"properties": {
|
|
"entityReference": {
|
|
"$ref": "#/definitions/entityReference"
|
|
},
|
|
"appliedTraits": {
|
|
"type": "array",
|
|
"items": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/definitions/traitClassReference"
|
|
},
|
|
{
|
|
"type": "string"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"entityReference"
|
|
]
|
|
},
|
|
"relationship": {
|
|
"type": "object",
|
|
"description": "",
|
|
"properties": {
|
|
"explanation": {
|
|
"type": "string",
|
|
"description": "Used to document the usage or meaning of the 'relationship' within the context of this entity definition system."
|
|
},
|
|
"relationshipName": {
|
|
"type": "string"
|
|
},
|
|
"extendsRelationship": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/definitions/relationshipClassReference"
|
|
},
|
|
{
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"exhibitsTraits": {
|
|
"type": "array",
|
|
"items": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/definitions/traitClassReference"
|
|
},
|
|
{
|
|
"type": "string"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"relationshipName"
|
|
]
|
|
},
|
|
"dataType": {
|
|
"type": "object",
|
|
"description": "",
|
|
"properties": {
|
|
"explanation": {
|
|
"type": "string",
|
|
"description": "Used to document the usage or meaning of the 'dataType' within the context of this entity definition system."
|
|
},
|
|
"dataTypeName": {
|
|
"type": "string"
|
|
},
|
|
"extendsDataType": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/definitions/dataTypeClassReference"
|
|
},
|
|
{
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"exhibitsTraits": {
|
|
"type": "array",
|
|
"items": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/definitions/traitClassReference"
|
|
},
|
|
{
|
|
"type": "string"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"dataTypeName"
|
|
]
|
|
},
|
|
"typeAttribute": {
|
|
"type": "object",
|
|
"description": "",
|
|
"properties": {
|
|
"explanation": {
|
|
"type": "string",
|
|
"description": "Used to document the usage or meaning of the 'typed attribute' within the context of this entity definition system."
|
|
},
|
|
"relationship": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/definitions/relationshipClassReference"
|
|
},
|
|
{
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"dataType": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/definitions/dataTypeClassReference"
|
|
},
|
|
{
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"appliedTraits": {
|
|
"type": "array",
|
|
"items": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/definitions/traitClassReference"
|
|
},
|
|
{
|
|
"type": "string"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"attributeContext": {
|
|
"type": "string"
|
|
},
|
|
"dataFormat": {
|
|
"type": "string"
|
|
},
|
|
"displayName": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"sourceName": {
|
|
"type": "string"
|
|
},
|
|
"sourceOrdering": {
|
|
"type": "number"
|
|
},
|
|
"isPrimaryKey": {
|
|
"type": "boolean"
|
|
},
|
|
"isReadOnly": {
|
|
"type": "boolean"
|
|
},
|
|
"isNullable": {
|
|
"type": "boolean"
|
|
},
|
|
"defaultValue": {
|
|
"oneOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object"
|
|
}
|
|
},
|
|
{
|
|
"type": "object"
|
|
}
|
|
]
|
|
},
|
|
"maximumValue": {
|
|
"type": "string"
|
|
},
|
|
"minimumValue": {
|
|
"type": "string"
|
|
},
|
|
"maximumLength": {
|
|
"type": "number"
|
|
},
|
|
"valueConstrainedToList": {
|
|
"type": "boolean"
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"name"
|
|
]
|
|
},
|
|
"entityAttribute": {
|
|
"type": "object",
|
|
"description": "",
|
|
"properties": {
|
|
"explanation": {
|
|
"type": "string",
|
|
"description": "Used to document the usage or meaning of the 'entity attribute' within the context of this entity definition system."
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"relationship": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/definitions/relationshipClassReference"
|
|
},
|
|
{
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"entity": {
|
|
"description": "the id of an entity, a structured entity reference or an array of either of those two",
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/definitions/entityClassReference"
|
|
},
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "array",
|
|
"items": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/definitions/entityClassReference"
|
|
},
|
|
{
|
|
"type": "string"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"appliedTraits": {
|
|
"type": "array",
|
|
"items": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/definitions/traitClassReference"
|
|
},
|
|
{
|
|
"type": "string"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"entity",
|
|
"name"
|
|
]
|
|
},
|
|
"attributeGroup": {
|
|
"type": "object",
|
|
"description": "",
|
|
"properties": {
|
|
"explanation": {
|
|
"type": "string",
|
|
"description": "Used to document the usage or meaning of the 'attribute group' within the context of this entity definition system."
|
|
},
|
|
"attributeGroupName": {
|
|
"type": "string"
|
|
},
|
|
"members": {
|
|
"type": "array",
|
|
"items": {
|
|
"oneOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"$ref": "#/definitions/attributeGroupClassReference"
|
|
},
|
|
{
|
|
"$ref": "#/definitions/typeAttribute"
|
|
},
|
|
{
|
|
"$ref": "#/definitions/entityAttribute"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"exhibitsTraits": {
|
|
"type": "array",
|
|
"items": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/definitions/traitClassReference"
|
|
},
|
|
{
|
|
"type": "string"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"attributeGroupName",
|
|
"members"
|
|
]
|
|
},
|
|
"traitParameter": {
|
|
"type": "object",
|
|
"description": "",
|
|
"properties": {
|
|
"explanation": {
|
|
"type": "string",
|
|
"description": "Used to document the usage or meaning of the 'trait parameter' within the context of this entity definition system."
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"defaultValue": {
|
|
"$ref": "#/definitions/constant"
|
|
},
|
|
"required": {
|
|
"type": "boolean",
|
|
"default": false
|
|
},
|
|
"dataType": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/definitions/dataTypeClassReference"
|
|
},
|
|
{
|
|
"type": "string"
|
|
}
|
|
],
|
|
"default": "string"
|
|
},
|
|
"direction": {
|
|
"enum": [
|
|
"in",
|
|
"out",
|
|
"both"
|
|
],
|
|
"default": "in"
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"name"
|
|
]
|
|
},
|
|
"trait": {
|
|
"type": "object",
|
|
"description": "",
|
|
"properties": {
|
|
"explanation": {
|
|
"type": "string",
|
|
"description": "Used to document the usage or meaning of the 'trait' within the context of this entity definition system."
|
|
},
|
|
"traitName": {
|
|
"type": "string"
|
|
},
|
|
"extendsTrait": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/definitions/traitClassReference"
|
|
},
|
|
{
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"hasParameters": {
|
|
"type": "array",
|
|
"items": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/definitions/traitParameter"
|
|
},
|
|
{
|
|
"type": "string"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"elevated": {
|
|
"type": "boolean",
|
|
"description": "elevated traits that are applied to attributes will be inherited by the containing entity."
|
|
},
|
|
"modifiesAttributes": {
|
|
"type": "boolean",
|
|
"description": "if true, the trait might add, change or remove attributes from an entity."
|
|
},
|
|
"ugly": {
|
|
"type": "boolean",
|
|
"description": "ugly traits are usually internal or structural and shouldn't be shown in UI."
|
|
},
|
|
"associatedProperties": {
|
|
"type": "array",
|
|
"description": "the list of Entity or Attribute properties that this trait informs and reflects.",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"traitName"
|
|
]
|
|
},
|
|
"attributeContext": {
|
|
"type": "object",
|
|
"description": "A container representing shared lineage, ownership and context in a hierachy describing the relatioships among an entities attributes.",
|
|
"properties": {
|
|
"explanation": {
|
|
"type": "string",
|
|
"description": "Used to document the usage or meaning of the 'entity' within the context of this entity definition system."
|
|
},
|
|
"type": {
|
|
"enum": [
|
|
"entity",
|
|
"extendedEntity",
|
|
"attributeGroup",
|
|
"entityAsAttribute"
|
|
]
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"parent": {
|
|
"type": "string"
|
|
},
|
|
"definition": {
|
|
"type": "string"
|
|
},
|
|
"appliedTraits": {
|
|
"type": "array",
|
|
"items": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/definitions/traitClassReference"
|
|
},
|
|
{
|
|
"type": "string"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"contents": {
|
|
"type": "array",
|
|
"items": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/definitions/attributeContext"
|
|
},
|
|
{
|
|
"type": "string"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"type",
|
|
"name"
|
|
]
|
|
},
|
|
"entity": {
|
|
"type": "object",
|
|
"description": "",
|
|
"properties": {
|
|
"explanation": {
|
|
"type": "string",
|
|
"description": "Used to document the usage or meaning of the 'entity' within the context of this entity definition system."
|
|
},
|
|
"entityName": {
|
|
"type": "string"
|
|
},
|
|
"extendsEntity": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/definitions/entityClassReference"
|
|
},
|
|
{
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"exhibitsTraits": {
|
|
"type": "array",
|
|
"items": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/definitions/traitClassReference"
|
|
},
|
|
{
|
|
"type": "string"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"attributeContext": {
|
|
"$ref": "#/definitions/attributeContext"
|
|
},
|
|
"hasAttributes": {
|
|
"type": "array",
|
|
"items": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/definitions/typeAttribute"
|
|
},
|
|
{
|
|
"$ref": "#/definitions/entityAttribute"
|
|
},
|
|
{
|
|
"$ref": "#/definitions/attributeGroupClassReference"
|
|
},
|
|
{
|
|
"type": "string"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"version": {
|
|
"type": "string"
|
|
},
|
|
"sourceName": {
|
|
"type": "string"
|
|
},
|
|
"displayName": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"cdmSchemas": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"entityName"
|
|
]
|
|
},
|
|
"constantEntity": {
|
|
"type": "object",
|
|
"description": "Used to structure and describe a set of related constant values that may be used as trait arguments",
|
|
"properties": {
|
|
"explanation": {
|
|
"type": "string",
|
|
"description": "Used to document the usage or meaning of the 'entity' within the context of this entity definition system."
|
|
},
|
|
"constantEntityName": {
|
|
"type": "string"
|
|
},
|
|
"entityShape": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/definitions/entityClassReference"
|
|
},
|
|
{
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"constantValues": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"entityShape",
|
|
"constantValues"
|
|
]
|
|
}
|
|
},
|
|
"properties": {
|
|
"$schema": {
|
|
"type": "string",
|
|
"examples": [
|
|
"../schema.cdm.json"
|
|
]
|
|
},
|
|
"jsonSchemaSemanticVersion": {
|
|
"type": "string",
|
|
"description": "the semantic version (major.minor.patch) number of the $schema document dictating the shape of the json document describing the entity shapes",
|
|
"examples": [
|
|
"0.3.0"
|
|
]
|
|
},
|
|
"imports": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/import"
|
|
}
|
|
},
|
|
"definitions": {
|
|
"type": "array",
|
|
"items": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/definitions/relationship"
|
|
},
|
|
{
|
|
"$ref": "#/definitions/trait"
|
|
},
|
|
{
|
|
"$ref": "#/definitions/dataType"
|
|
},
|
|
{
|
|
"$ref": "#/definitions/attributeGroup"
|
|
},
|
|
{
|
|
"$ref": "#/definitions/entity"
|
|
},
|
|
{
|
|
"$ref": "#/definitions/constantEntity"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
} |