ch.openlegal.defs

martingajdos.ch

{
  "id": "ch.openlegal.defs",
  "defs": {
    "target": {
      "type": "object",
      "required": [
        "source"
      ],
      "properties": {
        "source": {
          "type": "string",
          "format": "uri",
          "description": "The annotated resource: an at:// URI of a ch.openlegal.document, or an ELI / AKN-CH URI for an off-network law."
        },
        "version": {
          "type": "string",
          "description": "Which version was annotated (WADM state): an ELI version URI, or the CID of the target record. Absent = latest."
        },
        "selector": {
          "refs": [
            "ch.openlegal.defs#fragmentSelector",
            "ch.openlegal.defs#textQuoteSelector",
            "ch.openlegal.defs#textPositionSelector"
          ],
          "type": "union",
          "closed": false,
          "description": "How to locate the annotated span within the source (WADM selector). Open union so new selector kinds degrade gracefully."
        }
      },
      "description": "What an annotation is about (WADM target). Either an on-network document or an external law, optionally narrowed by a selector and pinned to a version."
    },
    "textBody": {
      "type": "object",
      "required": [
        "text"
      ],
      "properties": {
        "text": {
          "type": "string",
          "maxLength": 20000,
          "description": "The body text.",
          "maxGraphemes": 10000
        },
        "langs": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "language"
          },
          "maxLength": 3,
          "description": "BCP-47 language tags for the body."
        },
        "facets": {
          "type": "array",
          "items": {
            "ref": "app.bsky.richtext.facet",
            "type": "ref"
          },
          "description": "Richtext facets over `text` (links, mentions, and ch.openlegal.citation features)."
        }
      },
      "description": "A textual annotation body (WADM TextualBody), reusing Bluesky richtext for inline citations/links."
    },
    "fragmentSelector": {
      "type": "object",
      "required": [
        "value"
      ],
      "properties": {
        "value": {
          "type": "string",
          "maxLength": 512,
          "description": "The fragment identifier, e.g. an AKN eId ('art_8__para_1') or a media-fragment."
        },
        "conformsTo": {
          "type": "string",
          "format": "uri",
          "default": "https://docs.oasis-open.org/legaldocml/ns/akn/3.0",
          "description": "The spec the fragment conforms to (AKN by default)."
        }
      },
      "description": "WADM FragmentSelector — an intrinsic anchor within the document. For Swiss law this is the Akoma Ntoso eId."
    },
    "textQuoteSelector": {
      "type": "object",
      "required": [
        "exact"
      ],
      "properties": {
        "exact": {
          "type": "string",
          "maxLength": 4096,
          "description": "The exact quoted text.",
          "maxGraphemes": 2000
        },
        "prefix": {
          "type": "string",
          "maxLength": 512,
          "description": "Text immediately before the quote."
        },
        "suffix": {
          "type": "string",
          "maxLength": 512,
          "description": "Text immediately after the quote."
        }
      },
      "description": "WADM TextQuoteSelector — robust anchoring by the quoted text plus surrounding context."
    },
    "textPositionSelector": {
      "type": "object",
      "required": [
        "start",
        "end"
      ],
      "properties": {
        "end": {
          "type": "integer",
          "minimum": 0,
          "description": "End offset (exclusive)."
        },
        "start": {
          "type": "integer",
          "minimum": 0,
          "description": "Start offset (inclusive)."
        }
      },
      "description": "WADM TextPositionSelector — character offsets into the normalised text."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "description": "Shared objects for openlegal.ch legal-annotation lexicons. Field shapes follow the W3C Web Annotation Data Model (WADM); AT Protocol lexicon + IPLD is the wire format (not WADM JSON-LD). A projection to WADM JSON-LD is served separately (ap/wa.context.jsonld)."
}

Validate Record

Validate a record against ch.openlegal.defs

Validation Options
Automatically resolve and include external schemas for full validation
Treat any remaining unresolved references as valid

Metadata

DID
did:plc:63agxubxktwdumdrwhegyk2h
CID
bafyreibufjze6pyzbom2tsx5sg5lhveqswvtgwzkjeigojgvmajw76aoky
Indexed At
2026-07-20 14:37 UTC
AT-URI
at://did:plc:63agxubxktwdumdrwhegyk2h/com.atproto.lexicon.schema/ch.openlegal.defs

Referenced Schemas (1)

Lexicon Garden

@