{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://blue-core-lod.github.io/bibframe-json/schema/dialect/Ref.json",
  "$comment": "A reference: a bare URI string, as @type: @id writes it, or a node.",
  "examples": [
    "https://bibframe.example/works/9937996a-1083-4357-b05f-4be85f7b7354",
    {
      "@id": "http://id.loc.gov/vocabulary/relators/aut",
      "rdfs:label": [
        "author"
      ]
    }
  ],
  "anyOf": [
    {
      "title": "a bare URI",
      "description": "a reference, as @type: @id writes one",
      "type": "string"
    },
    {
      "additionalProperties": {
        "description": "Every property is an array, even holding one value. This is the guarantee the whole shape rests on.",
        "type": "array"
      },
      "description": "Something the record points at rather than describes.",
      "properties": {
        "@id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "@type": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "string"
            }
          ],
          "$comment": "An array when a node has several types, a string when it has one. @type is a keyword, so no @container reaches it."
        },
        "rdfs:label": {
          "items": {
            "$ref": "Text.json"
          },
          "type": "array"
        },
        "source": {
          "items": {
            "$ref": "Ref.json"
          },
          "type": "array"
        }
      },
      "title": "Ref",
      "type": "object",
      "not": {
        "description": "a blank node must not carry an @id",
        "required": [
          "@id"
        ],
        "properties": {
          "@id": {
            "pattern": "^_:"
          }
        }
      },
      "$comment": "A node, and one that keeps no @id if it is blank -- see forbid_blank_node_id, which every node definition shares.",
      "patternProperties": {
        "^@": {
          "description": "A JSON-LD keyword is not a property, so the array rule does not reach it. @context is the reason: it is a vocabulary rather than data."
        }
      }
    }
  ]
}
