CDM/schemaDocuments/schema.0.9.cdm.json

1066 строки
38 KiB
JSON

{
"$id": "http://microsoft.com/cdm/schema.0.9.cdm.json",
"$schema": "http://json-schema.org/draft-06/schema#",
"$version": "0.9.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/purposeClassReference"
},
{
"$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"
]
},
"purposeReference": {
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/definitions/purpose"
}
]
},
"purposeClassReference": {
"type": "object",
"description": "",
"properties": {
"purposeReference": {
"$ref": "#/definitions/purposeReference"
},
"appliedTraits": {
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/definitions/traitClassReference"
},
{
"type": "string"
}
]
}
}
},
"additionalProperties": false,
"required": [
"purposeReference"
]
},
"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"
]
},
"purpose": {
"type": "object",
"description": "",
"properties": {
"explanation": {
"type": "string",
"description": "Used to document the usage or meaning of the 'purpose' within the context of this entity definition system."
},
"purposeName": {
"type": "string"
},
"extendsPurpose": {
"oneOf": [
{
"$ref": "#/definitions/purposeClassReference"
},
{
"type": "string"
}
]
},
"exhibitsTraits": {
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/definitions/traitClassReference"
},
{
"type": "string"
}
]
}
}
},
"additionalProperties": false,
"required": [
"purposeName"
]
},
"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"
]
},
"resolutionGuidance": {
"type": "object",
"description": "Parameters that describe how an attribute should be resolved.",
"properties": {
"removeAttribute": {
"type": "boolean",
"description": "If true, this attribute definiton will be removed from the final resolved attribute list of an entity.",
"default": false
},
"imposedDirectives": {
"type": "array",
"description": "A list of strings, one for each 'directive' that should be always imposed at this attribute definition",
"items": {
"type": "string"
}
},
"removedDirectives": {
"type": "array",
"description": "A list of strings, one for each 'directive' that should be removed if previously imposed",
"items": {
"type": "string"
}
},
"addSupportingAttribute": {
"description": "The supplied attribute definition will be added to the Entity after this attribute definition with a trait indicating its supporting role on this.",
"oneOf": [
{
"$ref": "#/definitions/attributeGroupClassReference"
},
{
"$ref": "#/definitions/typeAttribute"
},
{
"$ref": "#/definitions/entityAttribute"
}
]
},
"cardinality": {
"description": "If 'one' then there is a single instance of the attribute or entity used. 'many' indicates multiple instances and the 'expansion' properties will describe array enumeration to use when needed.",
"enum": [
"one",
"many"
],
"default": "one"
},
"renameFormat": {
"type": "string",
"description": "format specifier for generated attribute names. May contain a single occurence of ('{a} or 'A'), ('{m}' or '{M}') and '{o}' for the base (a/A)ttribute name, any (m/M)ember attributes from entities and array (o)rdinal. examples: '{a}{o}.{m}' could produce 'address2.city', '{a}{o}' gives 'city1'. Using '{A}' or '{M}' will uppercase the first letter of the name portions.",
"default": "{a}{o}{M}"
},
"expansion": {
"type": "object",
"description": "Parameters that control array expansion if inline repeating of attributes is needed.",
"properties": {
"startingOrdinal": {
"type": "integer",
"default": 0
},
"maximumExpansion": {
"explanation": "the greatest number of time that the attribute pattern should be repeated.",
"type": "integer",
"default": 5
},
"countAttribute": {
"description": "The supplied attribute definition will be added to the Entity to represent the total number of instances found in the data.",
"oneOf": [
{
"$ref": "#/definitions/entityAttribute"
},
{
"$ref": "#/definitions/attributeGroupClassReference"
},
{
"$ref": "#/definitions/typeAttribute"
}
]
}
},
"additionalProperties": false,
"required": []
},
"entityByReference": {
"allowReference": true,
"type": "object",
"description": "Parameters that control the use of foreign keys to reference entity instances instead of imbedding the entity in a nested way",
"properties": {
"allowReference": {
"type": "boolean",
"default": true,
"description": "if true, a foreign key attribute may be used in replace of the entity when needed or requested."
},
"alwaysIncludeForeignKey": {
"type": "boolean",
"default": false,
"description": "if true, a foreign key attribute will be added to the entity even when the entity attribute is imbedded in a nested way."
},
"referenceOnlyAfterDepth": {
"type": "integer",
"description": "After a given depth of non-reference nesting using entity attributes, the 'referenceOnly' directive will be imposed",
"default": 2
},
"foreignKeyAttribute": {
"description": "The supplied attribute definition will be added to the Entity to hold a foreign key value for the referenced entity.",
"oneOf": [
{
"$ref": "#/definitions/attributeGroupClassReference"
},
{
"$ref": "#/definitions/typeAttribute"
},
{
"$ref": "#/definitions/entityAttribute"
}
]
}
},
"additionalProperties": false,
"required": []
},
"selectsSubAttribute": {
"type": "object",
"description": "used to select either 'one' or 'all' of the attributes from an entity when it is being used as an attribute of another entity. If the 'structured' directive is set, this trait causes resolved attributes to end up in groups rather than a flattend list",
"properties": {
"selects": {
"enum": [
"one",
"some",
"all"
],
"default": "all"
},
"selectedTypeAttribute": {
"description": "The supplied attribute definition will be added to the Entity to hold a description of the single attribute that was selected from the sub-entity.",
"oneOf": [
{
"$ref": "#/definitions/attributeGroupClassReference"
},
{
"$ref": "#/definitions/typeAttribute"
},
{
"$ref": "#/definitions/entityAttribute"
}
]
},
"selectsSomeTakeNames": {
"type": "array",
"description": "When selects='some', an ordered list of strings, one for each attribute name to take from the source entity in the order desired.",
"items": {
"type": "string"
}
},
"selectsSomeAvoidNames": {
"type": "array",
"description": "When selects='some', a list of strings, one for each attribute name to not take from the source entity in the order desired.",
"items": {
"type": "string"
}
}
},
"additionalProperties": false,
"required": []
}
},
"additionalProperties": false,
"required": []
},
"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."
},
"purpose": {
"oneOf": [
{
"$ref": "#/definitions/purposeClassReference"
},
{
"type": "string"
}
]
},
"name": {
"type": "string"
},
"dataType": {
"oneOf": [
{
"$ref": "#/definitions/dataTypeClassReference"
},
{
"type": "string"
}
]
},
"appliedTraits": {
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/definitions/traitClassReference"
},
{
"type": "string"
}
]
}
},
"resolutionGuidance": {
"type": "object",
"$ref": "#/definitions/resolutionGuidance"
},
"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"
},
"purpose": {
"oneOf": [
{
"$ref": "#/definitions/purposeClassReference"
},
{
"type": "string"
}
]
},
"displayName": {
"type": "string"
},
"description": {
"type": "string"
},
"resolutionGuidance": {
"type": "object",
"$ref": "#/definitions/resolutionGuidance"
},
"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"
}
]
},
"extendsEntityResolutionGuidance" : {
"type": "object",
"$ref": "#/definitions/resolutionGuidance"
},
"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.0.9.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/purpose"
},
{
"$ref": "#/definitions/trait"
},
{
"$ref": "#/definitions/dataType"
},
{
"$ref": "#/definitions/attributeGroup"
},
{
"$ref": "#/definitions/entity"
},
{
"$ref": "#/definitions/constantEntity"
}
]
}
}
}
}