{
    "$id": "../sros/relationship.json",
    "$schema": "http://json-schema.org/draft-06/schema#",
    "title": "relationship",
    "description": "The Relationship object is used to link together two SDOs in order to describe how they are related to each other.",
    "type": "object",
    "allOf": [
        {
            "$ref": "../common/core.json"
        },
        {
            "properties": {
                "type": {
                    "type": "string",
                    "description": "The type of this object, which MUST be the literal `relationship`.",
                    "const": "relationship"
                },
                "id": {
                    "title": "id",
                    "pattern": "^relationship--"
                },
                "relationship_type": {
                    "type": "string",
                    "description": "The name used to identify the type of relationship.",
                    "pattern": "^[a-z0-9\\-]+$"
                },
                "description": {
                    "type": "string",
                    "description": "A description that helps provide context about the relationship."
                },
                "source_ref": {
                    "description": "The ID of the source (from) object.",
                    "allOf": [
                        {
                            "$ref": "../common/identifier.json"
                        },
                        {
                            "not": {
                                "pattern": "^(relationship|sighting|bundle|marking-definition)--.+$"
                            }
                        }
                    ]
                },
                "target_ref": {
                    "description": "The ID of the target (to) object.",
                    "allOf": [
                        {
                            "$ref": "../common/identifier.json"
                        },
                        {
                            "not": {
                                "pattern": "^(relationship|sighting|bundle|marking-definition)--.+$"
                            }
                        }
                    ]
                }
            }
        }
    ],
    "required": [
        "relationship_type",
        "source_ref",
        "target_ref"
    ]
}