gbv / jskos-tools

Tools for working with the JSKOS data format.
https://gbv.github.io/jskos-tools/
MIT License
2 stars 0 forks source link

Issues with DDC notations in ConceptScheme #41

Open stefandesu opened 7 months ago

stefandesu commented 7 months ago

Given the following instance of ConceptScheme:

const ddc = new ConceptScheme({
    uri: "http://dewey.info/scheme/edition/e23/",
    uriPattern: "^http://dewey.info/class/(.+)/e23/$",
    notationPattern: "(([0-9][0-9]?|[0-9]{3}(-[0-9]{3})?|[0-9]{3}\\.[0-9]+(-[0-9]{3}\\.[0-9]+(:[0-9]+)?)?|T[1-9][A-Z]?--[0-9]+(-T[1-9][A-Z]?--[0-9]+(:[0-9]+)?)?|[1-9][A-Z]?--[0-9]+(-[1-9][A-Z]?--[0-9]+(:[0-9]+)?)?)?)",
  })

The following case causes issues:

ddc.uriFromNotation("T1--0901-T1--0905:07")