Skip to content

More rigorously/formally describe ARK identifier syntax #6

Description

@kinseytamsin

Today I ended up doing a deep dive into the ARK identifier syntax in order to figure out how to put together a regular expression for a Wikidata property to only match valid ARK identifiers, and doing this based on the current text of the specification took quite a bit more close reading than is ideal. In the process of trying to make sense of it I put together an ABNF description of the syntax, so I figured I might as well offer it for possible incorporation into the spec. This uses the ABNF syntax described in RFC 5234. It's a bit rough and covers the normalized form except for also representing the ark:/ form of the prefix, but I think it's a reasonable initial draft. Is there any interest in including something like this?

ark = ark-label-part naan "/" name-part
ark-label-part = "ark:" ["/"]
name-part = [shoulder] blade
blade = name-component [qualifiers]
name-component = 1*(character-or-pct-encoded)
naan = 1*(DIGIT / beta)
beta = "b" / "c" / "d" / "f" / "g" / "h" / "j" / "k" / "m" / "n" / "p" / "q" / "r" / "s" / "t" / "v" / "w" / "x" / "z"
  ; must be lowercase in normalized form
shoulder = name-component
qualifiers = 1*qualifier
qualifier = component-path [variant-path] / variant-path
component-path = "/" name-component
variant-path = "." name-component
character-or-pct-encoded = non-reserved / pct-encoded
non-reserved = ALPHA / DIGIT / "=" / "~" / "*" / "+" / "@" / "_" / "$"
pct-encoded = "%" HEXDIG HEXDIG

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions