Abbreviated URN values

Published

June 14, 2024

The AbbreviatedUrn is an abstract type supporting an abbreviated notation for Cite2Urns. It allows you to work with objects uniquely identified by collection identifier and object identifier, when the collection is registered in a dictionary that can expand the collection identifier to a full Cite2Urn.

The modules implements the AbbrevatedUrn for each uniquely identified component of an Analysis:

  1. LexemeUrn
  2. FormUrn
  3. StemUrn
  4. RuleUrn

An AbbreviatedUrn has a collection identifier, and an object identifier. You can construct an AbbreviatedUrn from a dot-delimited string.

using CitableParserBuilder
lexurn = LexemeUrn("lsj.n125")
collection(lexurn)
"lsj"
objectid(lexurn)
"n125"

Abbreviated URNs and Cite2Urns

You can use the abbreviate function to create an abbreviation string from a Cite2Urn using the collection identifier and the object identifer of the Cite2Urn.

using CitableParserBuilder, CitableObject
conjunctionurn = Cite2Urn("urn:cite2:kanones:morphforms.v1:1000000001")
abbreviate(conjunctionurn)
"morphforms.1000000001"

Of course you can use this string in turn to instantiate an AbbreviatedUrn structure.

frmurn = abbreviate(conjunctionurn) |> FormUrn
morphforms.1000000001
objectid(frmurn)
"1000000001"

To convert an AbbreviatedUrn to a full Cite2Urn, give the expand function a dictionary mapping collection identifiers to full URN strings for the collection

registry = Dict(
    "morphforms" => "urn:cite2:kanones:morphforms.v1:"
)
expanded = expand(frmurn, registry)
urn:cite2:kanones:morphforms.v1:1000000001