{
    "$schema": "http://json-schema.org/draft-04/schema",
    "allOf": [
        {
            "properties": {
                "app_name": {
                    "$ref": "#/definitions/traits_trait_app_name_json"
                },
                "auxiliaries": {
                    "description": "A list of auxiliaries.",
                    "items": {
                        "$ref": "#/definitions/utils_auxiliary_json"
                    },
                    "type": "array"
                },
                "branch": {
                    "description": "The name of the branch within Story API that this operation occurs on, if any",
                    "type": "string"
                },
                "date": {
                    "_format": "date-time",
                    "description": "When the operation should be considered performed",
                    "type": "string"
                },
                "id": {
                    "description": "The id of the item being operated",
                    "type": "string"
                },
                "keywords": {
                    "description": "A list of keywords.",
                    "items": {
                        "$ref": "#/definitions/utils_keyword_json"
                    },
                    "type": "array"
                },
                "named_entities": {
                    "description": "A list of named entities.",
                    "items": {
                        "$ref": "#/definitions/utils_named_entity_json"
                    },
                    "type": "array"
                },
                "operation": {
                    "description": "The identifier of the operation being performed",
                    "enum": [
                        "update"
                    ],
                    "type": "string"
                },
                "organization_id": {
                    "description": "The id of the organization",
                    "type": "string"
                },
                "priority": {
                    "$ref": "#/definitions/traits_trait_priority_json"
                },
                "published": {
                    "description": "Identifies this item as published or not",
                    "type": "boolean"
                },
                "topics": {
                    "description": "A list of topics.",
                    "items": {
                        "$ref": "#/definitions/utils_topic_json"
                    },
                    "type": "array"
                },
                "type": {
                    "description": "Identifies this as an ANS operation",
                    "enum": [
                        "clavis-operation"
                    ],
                    "type": "string"
                },
                "version": {
                    "description": "The version of ANS this item is written in",
                    "type": "string"
                }
            },
            "required": [
                "type",
                "operation",
                "id",
                "organization_id",
                "branch",
                "published"
            ]
        }
    ],
    "definitions": {
        "traits_trait_app_name_json": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "description": "The name of the application that generated an operation. This is used by downstream consumers in conjunction with 'priority' to make decisions about optimization.",
            "title": "Application Name",
            "type": "string"
        },
        "traits_trait_priority_json": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "description": "The priority identifier of this operation. This is used by downstream consumers to make decisions about optimization. The value 'standard' indicates an operation generated from a UI or live update. The value 'ingestion' indicates an operation generated by a migration script or background import.  Note that this represents a request for priority consideration from event-generating apps and downstream applications are not obligated to honor it.",
            "enum": [
                "standard",
                "ingestion"
            ],
            "title": "Priority",
            "type": "string"
        },
        "utils_auxiliary_json": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "additionalProperties": false,
            "description": "Models a auxiliary used in targeting a piece of content.",
            "properties": {
                "_id": {
                    "description": "The unique identifier for this auxiliary.",
                    "type": "string"
                },
                "name": {
                    "description": "The general name for this auxiliary.",
                    "type": "string"
                },
                "uid": {
                    "description": "A short identifier for this auxiliary. Usually used in cases where a long form id cannot work.",
                    "type": "string"
                }
            },
            "required": [
                "_id",
                "uid"
            ],
            "title": "Auxiliary",
            "type": "object"
        },
        "utils_keyword_json": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "additionalProperties": false,
            "description": "Models a keyword used in describing a piece of content.",
            "properties": {
                "frequency": {
                    "description": "An optional count of the frequency of the keyword as it appears in the content it describes",
                    "type": "integer"
                },
                "keyword": {
                    "description": "The keyword used to describe a piece of content",
                    "type": "string"
                },
                "score": {
                    "description": "An arbitrary weighting to give the keyword",
                    "type": "number"
                },
                "tag": {
                    "description": "The Part of Speech tag for this keyword.",
                    "type": "string"
                }
            },
            "required": [
                "keyword",
                "score"
            ],
            "title": "Keyword",
            "type": "object"
        },
        "utils_named_entity_json": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "additionalProperties": false,
            "description": "Models a named entity (i.e. name of a person, place, or organization) used in a piece of content.",
            "properties": {
                "_id": {
                    "description": "A unique identifier for the concept of the named entity.",
                    "type": "string"
                },
                "name": {
                    "description": "The actual string of text that was identified as a named entity.",
                    "type": "string"
                },
                "score": {
                    "decription": "An optional relevancy for this named entitiy.",
                    "type": "number"
                },
                "type": {
                    "description": "A description of what the named entity is. E.g. 'organization', 'person', or 'location'.",
                    "type": "string"
                }
            },
            "required": [
                "_id",
                "name",
                "type"
            ],
            "title": "Named Entity",
            "type": "object"
        },
        "utils_topic_json": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "additionalProperties": false,
            "description": "Models a topic used in describing a piece of content.",
            "properties": {
                "_id": {
                    "description": "The unique identifier for this topic.",
                    "type": "string"
                },
                "name": {
                    "description": "The general name for this topic.",
                    "type": "string"
                },
                "score": {
                    "description": "An arbitrary weighting to give the topic",
                    "type": "number"
                },
                "uid": {
                    "description": "A short identifier for this topic. Usually used in cases where a long form id cannot work.",
                    "type": "string"
                }
            },
            "required": [
                "_id",
                "score",
                "uid"
            ],
            "title": "Topic",
            "type": "object"
        }
    },
    "description": "An operation to add Clavis information to a story.",
    "type": "object"
}