glossarist 0.4.50 → 0.4.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compiled-format.d.ts +43 -0
- package/dist/compiled-format.d.ts.map +1 -0
- package/{src/compiled-format.ts → dist/compiled-format.js} +28 -46
- package/dist/compiled-format.js.map +1 -0
- package/dist/concept-collection.d.ts +39 -0
- package/dist/concept-collection.d.ts.map +1 -0
- package/dist/concept-collection.js +127 -0
- package/dist/concept-collection.js.map +1 -0
- package/dist/concept-diff.d.ts +14 -0
- package/dist/concept-diff.d.ts.map +1 -0
- package/{src/concept-diff.ts → dist/concept-diff.js} +2 -20
- package/dist/concept-diff.js.map +1 -0
- package/dist/concept-parser.d.ts +11 -0
- package/dist/concept-parser.d.ts.map +1 -0
- package/dist/concept-parser.js +209 -0
- package/dist/concept-parser.js.map +1 -0
- package/dist/concept-reader.d.ts +55 -0
- package/dist/concept-reader.d.ts.map +1 -0
- package/{src/concept-reader.ts → dist/concept-reader.js} +70 -76
- package/dist/concept-reader.js.map +1 -0
- package/dist/concept-serializer.d.ts +9 -0
- package/dist/concept-serializer.d.ts.map +1 -0
- package/dist/concept-serializer.js +87 -0
- package/dist/concept-serializer.js.map +1 -0
- package/dist/concept-writer.d.ts +10 -0
- package/dist/concept-writer.d.ts.map +1 -0
- package/dist/concept-writer.js +28 -0
- package/dist/concept-writer.js.map +1 -0
- package/dist/dataset-asset.d.ts +49 -0
- package/dist/dataset-asset.d.ts.map +1 -0
- package/{src/dataset-asset.ts → dist/dataset-asset.js} +16 -33
- package/dist/dataset-asset.js.map +1 -0
- package/dist/diff/canonical-json.d.ts +7 -0
- package/dist/diff/canonical-json.d.ts.map +1 -0
- package/dist/diff/canonical-json.js +28 -0
- package/dist/diff/canonical-json.js.map +1 -0
- package/dist/diff/change.d.ts +67 -0
- package/dist/diff/change.d.ts.map +1 -0
- package/dist/diff/change.js +131 -0
- package/dist/diff/change.js.map +1 -0
- package/dist/diff/collection-diff.d.ts +50 -0
- package/dist/diff/collection-diff.d.ts.map +1 -0
- package/dist/diff/collection-diff.js +182 -0
- package/dist/diff/collection-diff.js.map +1 -0
- package/dist/diff/concept-diff.d.ts +188 -0
- package/dist/diff/concept-diff.d.ts.map +1 -0
- package/dist/diff/concept-diff.js +624 -0
- package/dist/diff/concept-diff.js.map +1 -0
- package/dist/diff/diff-patch.d.ts +7 -0
- package/dist/diff/diff-patch.d.ts.map +1 -0
- package/dist/diff/diff-patch.js +225 -0
- package/dist/diff/diff-patch.js.map +1 -0
- package/dist/diff/diff-renderer.d.ts +44 -0
- package/dist/diff/diff-renderer.d.ts.map +1 -0
- package/dist/diff/diff-renderer.js +263 -0
- package/dist/diff/diff-renderer.js.map +1 -0
- package/dist/diff/identity.d.ts +2 -0
- package/dist/diff/identity.d.ts.map +1 -0
- package/dist/diff/identity.js +29 -0
- package/dist/diff/identity.js.map +1 -0
- package/dist/diff/index.d.ts +8 -0
- package/dist/diff/index.d.ts.map +1 -0
- package/dist/diff/index.js +8 -0
- package/dist/diff/index.js.map +1 -0
- package/dist/diff/list-diff.d.ts +36 -0
- package/dist/diff/list-diff.d.ts.map +1 -0
- package/dist/diff/list-diff.js +185 -0
- package/dist/diff/list-diff.js.map +1 -0
- package/dist/diff/similarity.d.ts +4 -0
- package/dist/diff/similarity.d.ts.map +1 -0
- package/dist/diff/similarity.js +20 -0
- package/dist/diff/similarity.js.map +1 -0
- package/dist/diff/text-diff.d.ts +42 -0
- package/dist/diff/text-diff.d.ts.map +1 -0
- package/dist/diff/text-diff.js +134 -0
- package/dist/diff/text-diff.js.map +1 -0
- package/dist/entity-directory.d.ts +13 -0
- package/dist/entity-directory.d.ts.map +1 -0
- package/dist/entity-directory.js +35 -0
- package/dist/entity-directory.js.map +1 -0
- package/dist/errors.d.ts +15 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +23 -0
- package/dist/errors.js.map +1 -0
- package/dist/gcr-reader.d.ts +57 -0
- package/dist/gcr-reader.d.ts.map +1 -0
- package/dist/gcr-reader.js +264 -0
- package/dist/gcr-reader.js.map +1 -0
- package/dist/gcr-writer.d.ts +23 -0
- package/dist/gcr-writer.d.ts.map +1 -0
- package/dist/gcr-writer.js +84 -0
- package/dist/gcr-writer.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -0
- package/dist/managed-concept-collection.d.ts +31 -0
- package/dist/managed-concept-collection.d.ts.map +1 -0
- package/dist/managed-concept-collection.js +87 -0
- package/dist/managed-concept-collection.js.map +1 -0
- package/dist/migration/hyperedge-migrator.d.ts +33 -0
- package/dist/migration/hyperedge-migrator.d.ts.map +1 -0
- package/dist/migration/hyperedge-migrator.js +70 -0
- package/dist/migration/hyperedge-migrator.js.map +1 -0
- package/dist/models/abstract-hyperedge.d.ts +35 -0
- package/dist/models/abstract-hyperedge.d.ts.map +1 -0
- package/dist/models/abstract-hyperedge.js +112 -0
- package/dist/models/abstract-hyperedge.js.map +1 -0
- package/dist/models/base.d.ts +58 -0
- package/dist/models/base.d.ts.map +1 -0
- package/dist/models/base.js +77 -0
- package/dist/models/base.js.map +1 -0
- package/dist/models/bibliography-data.d.ts +20 -0
- package/dist/models/bibliography-data.d.ts.map +1 -0
- package/dist/models/bibliography-data.js +43 -0
- package/dist/models/bibliography-data.js.map +1 -0
- package/dist/models/bibliography-entry.d.ts +19 -0
- package/dist/models/bibliography-entry.d.ts.map +1 -0
- package/dist/models/bibliography-entry.js +34 -0
- package/dist/models/bibliography-entry.js.map +1 -0
- package/dist/models/citation.d.ts +40 -0
- package/dist/models/citation.d.ts.map +1 -0
- package/dist/models/citation.js +82 -0
- package/dist/models/citation.js.map +1 -0
- package/dist/models/completeness.d.ts +9 -0
- package/dist/models/completeness.d.ts.map +1 -0
- package/{src/models/completeness.ts → dist/models/completeness.js} +4 -9
- package/dist/models/completeness.js.map +1 -0
- package/dist/models/concept-date.d.ts +20 -0
- package/dist/models/concept-date.d.ts.map +1 -0
- package/dist/models/concept-date.js +36 -0
- package/dist/models/concept-date.js.map +1 -0
- package/dist/models/concept-ref.d.ts +32 -0
- package/dist/models/concept-ref.d.ts.map +1 -0
- package/dist/models/concept-ref.js +53 -0
- package/dist/models/concept-ref.js.map +1 -0
- package/dist/models/concept-reference.d.ts +22 -0
- package/dist/models/concept-reference.d.ts.map +1 -0
- package/dist/models/concept-reference.js +39 -0
- package/dist/models/concept-reference.js.map +1 -0
- package/dist/models/concept-source.d.ts +53 -0
- package/dist/models/concept-source.d.ts.map +1 -0
- package/dist/models/concept-source.js +66 -0
- package/dist/models/concept-source.js.map +1 -0
- package/dist/models/concept-system-type.d.ts +6 -0
- package/dist/models/concept-system-type.d.ts.map +1 -0
- package/dist/models/concept-system-type.js +22 -0
- package/dist/models/concept-system-type.js.map +1 -0
- package/dist/models/concept-system.d.ts +44 -0
- package/dist/models/concept-system.d.ts.map +1 -0
- package/dist/models/concept-system.js +115 -0
- package/dist/models/concept-system.js.map +1 -0
- package/dist/models/concept-type.d.ts +7 -0
- package/dist/models/concept-type.d.ts.map +1 -0
- package/{src/models/concept-type.ts → dist/models/concept-type.js} +8 -19
- package/dist/models/concept-type.js.map +1 -0
- package/dist/models/concept.d.ts +94 -0
- package/dist/models/concept.d.ts.map +1 -0
- package/dist/models/concept.js +368 -0
- package/dist/models/concept.js.map +1 -0
- package/dist/models/dataset-color.d.ts +28 -0
- package/dist/models/dataset-color.d.ts.map +1 -0
- package/dist/models/dataset-color.js +74 -0
- package/dist/models/dataset-color.js.map +1 -0
- package/dist/models/definition-type.d.ts +9 -0
- package/dist/models/definition-type.d.ts.map +1 -0
- package/{src/models/definition-type.ts → dist/models/definition-type.js} +6 -15
- package/dist/models/definition-type.js.map +1 -0
- package/dist/models/designation-relationship.d.ts +17 -0
- package/dist/models/designation-relationship.d.ts.map +1 -0
- package/dist/models/designation-relationship.js +30 -0
- package/dist/models/designation-relationship.js.map +1 -0
- package/dist/models/designation.d.ts +110 -0
- package/dist/models/designation.d.ts.map +1 -0
- package/dist/models/designation.js +224 -0
- package/dist/models/designation.js.map +1 -0
- package/dist/models/detailed-definition.d.ts +34 -0
- package/dist/models/detailed-definition.d.ts.map +1 -0
- package/dist/models/detailed-definition.js +63 -0
- package/dist/models/detailed-definition.js.map +1 -0
- package/dist/models/enum.d.ts +21 -0
- package/dist/models/enum.d.ts.map +1 -0
- package/dist/models/enum.js +39 -0
- package/dist/models/enum.js.map +1 -0
- package/dist/models/equivalence-degree.d.ts +7 -0
- package/dist/models/equivalence-degree.d.ts.map +1 -0
- package/dist/models/equivalence-degree.js +20 -0
- package/dist/models/equivalence-degree.js.map +1 -0
- package/dist/models/figure.d.ts +40 -0
- package/dist/models/figure.d.ts.map +1 -0
- package/dist/models/figure.js +82 -0
- package/dist/models/figure.js.map +1 -0
- package/dist/models/formula.d.ts +15 -0
- package/dist/models/formula.d.ts.map +1 -0
- package/dist/models/formula.js +27 -0
- package/dist/models/formula.js.map +1 -0
- package/dist/models/gcr-metadata.d.ts +62 -0
- package/dist/models/gcr-metadata.d.ts.map +1 -0
- package/dist/models/gcr-metadata.js +102 -0
- package/dist/models/gcr-metadata.js.map +1 -0
- package/dist/models/gcr-statistics.d.ts +30 -0
- package/dist/models/gcr-statistics.d.ts.map +1 -0
- package/dist/models/gcr-statistics.js +53 -0
- package/dist/models/gcr-statistics.js.map +1 -0
- package/dist/models/generic-hyperedge.d.ts +32 -0
- package/dist/models/generic-hyperedge.d.ts.map +1 -0
- package/dist/models/generic-hyperedge.js +51 -0
- package/dist/models/generic-hyperedge.js.map +1 -0
- package/dist/models/generic-member.d.ts +14 -0
- package/dist/models/generic-member.d.ts.map +1 -0
- package/dist/models/generic-member.js +51 -0
- package/dist/models/generic-member.js.map +1 -0
- package/dist/models/grammar-info.d.ts +34 -0
- package/dist/models/grammar-info.d.ts.map +1 -0
- package/dist/models/grammar-info.js +59 -0
- package/dist/models/grammar-info.js.map +1 -0
- package/dist/models/hyperedge-colors.d.ts +19 -0
- package/dist/models/hyperedge-colors.d.ts.map +1 -0
- package/dist/models/hyperedge-colors.js +61 -0
- package/dist/models/hyperedge-colors.js.map +1 -0
- package/dist/models/hyperedge-index.d.ts +34 -0
- package/dist/models/hyperedge-index.d.ts.map +1 -0
- package/dist/models/hyperedge-index.js +85 -0
- package/dist/models/hyperedge-index.js.map +1 -0
- package/dist/models/hyperedge-member.d.ts +28 -0
- package/dist/models/hyperedge-member.d.ts.map +1 -0
- package/dist/models/hyperedge-member.js +92 -0
- package/dist/models/hyperedge-member.js.map +1 -0
- package/dist/models/hyperedge-registry.d.ts +47 -0
- package/dist/models/hyperedge-registry.d.ts.map +1 -0
- package/dist/models/hyperedge-registry.js +118 -0
- package/dist/models/hyperedge-registry.js.map +1 -0
- package/dist/models/index.d.ts +53 -0
- package/dist/models/index.d.ts.map +1 -0
- package/{src/models/index.ts → dist/models/index.js} +11 -63
- package/dist/models/index.js.map +1 -0
- package/dist/models/locality.d.ts +17 -0
- package/dist/models/locality.d.ts.map +1 -0
- package/dist/models/locality.js +26 -0
- package/dist/models/locality.js.map +1 -0
- package/dist/models/localized-concept.d.ts +102 -0
- package/dist/models/localized-concept.d.ts.map +1 -0
- package/dist/models/localized-concept.js +195 -0
- package/dist/models/localized-concept.js.map +1 -0
- package/dist/models/localized-string.d.ts +5 -0
- package/dist/models/localized-string.d.ts.map +1 -0
- package/dist/models/localized-string.js +20 -0
- package/dist/models/localized-string.js.map +1 -0
- package/dist/models/multiplicity.d.ts +42 -0
- package/dist/models/multiplicity.d.ts.map +1 -0
- package/dist/models/multiplicity.js +84 -0
- package/dist/models/multiplicity.js.map +1 -0
- package/dist/models/non-verb-rep.d.ts +20 -0
- package/dist/models/non-verb-rep.d.ts.map +1 -0
- package/dist/models/non-verb-rep.js +32 -0
- package/dist/models/non-verb-rep.js.map +1 -0
- package/dist/models/non-verbal-entity.d.ts +30 -0
- package/dist/models/non-verbal-entity.d.ts.map +1 -0
- package/dist/models/non-verbal-entity.js +48 -0
- package/dist/models/non-verbal-entity.js.map +1 -0
- package/dist/models/non-verbal-reference.d.ts +23 -0
- package/dist/models/non-verbal-reference.d.ts.map +1 -0
- package/dist/models/non-verbal-reference.js +44 -0
- package/dist/models/non-verbal-reference.js.map +1 -0
- package/dist/models/non-verbal-references.d.ts +12 -0
- package/dist/models/non-verbal-references.d.ts.map +1 -0
- package/dist/models/non-verbal-references.js +20 -0
- package/dist/models/non-verbal-references.js.map +1 -0
- package/dist/models/partitive-count.d.ts +10 -0
- package/dist/models/partitive-count.d.ts.map +1 -0
- package/{src/models/partitive-count.ts → dist/models/partitive-count.js} +5 -9
- package/dist/models/partitive-count.js.map +1 -0
- package/dist/models/partitive-enumeration.d.ts +5 -0
- package/dist/models/partitive-enumeration.d.ts.map +1 -0
- package/dist/models/partitive-enumeration.js +16 -0
- package/dist/models/partitive-enumeration.js.map +1 -0
- package/dist/models/partitive-hyperedge.d.ts +43 -0
- package/dist/models/partitive-hyperedge.d.ts.map +1 -0
- package/dist/models/partitive-hyperedge.js +63 -0
- package/dist/models/partitive-hyperedge.js.map +1 -0
- package/dist/models/partitive-member.d.ts +14 -0
- package/dist/models/partitive-member.d.ts.map +1 -0
- package/dist/models/partitive-member.js +44 -0
- package/dist/models/partitive-member.js.map +1 -0
- package/dist/models/partitive-presence.d.ts +9 -0
- package/dist/models/partitive-presence.d.ts.map +1 -0
- package/{src/models/partitive-presence.ts → dist/models/partitive-presence.js} +4 -8
- package/dist/models/partitive-presence.js.map +1 -0
- package/dist/models/plurality-marker.d.ts +5 -0
- package/dist/models/plurality-marker.d.ts.map +1 -0
- package/dist/models/plurality-marker.js +20 -0
- package/dist/models/plurality-marker.js.map +1 -0
- package/dist/models/pronunciation.d.ts +19 -0
- package/dist/models/pronunciation.d.ts.map +1 -0
- package/dist/models/pronunciation.js +34 -0
- package/dist/models/pronunciation.js.map +1 -0
- package/dist/models/register.d.ts +104 -0
- package/dist/models/register.d.ts.map +1 -0
- package/dist/models/register.js +297 -0
- package/dist/models/register.js.map +1 -0
- package/dist/models/registrable.d.ts +25 -0
- package/dist/models/registrable.d.ts.map +1 -0
- package/dist/models/registrable.js +23 -0
- package/dist/models/registrable.js.map +1 -0
- package/dist/models/related-concept.d.ts +33 -0
- package/dist/models/related-concept.d.ts.map +1 -0
- package/dist/models/related-concept.js +95 -0
- package/dist/models/related-concept.js.map +1 -0
- package/dist/models/relation-categories.d.ts +38 -0
- package/dist/models/relation-categories.d.ts.map +1 -0
- package/dist/models/relation-categories.js +135 -0
- package/dist/models/relation-categories.js.map +1 -0
- package/dist/models/relation-colors.d.ts +35 -0
- package/dist/models/relation-colors.d.ts.map +1 -0
- package/dist/models/relation-colors.js +68 -0
- package/dist/models/relation-colors.js.map +1 -0
- package/dist/models/relation-loader.d.ts +41 -0
- package/dist/models/relation-loader.d.ts.map +1 -0
- package/dist/models/relation-loader.js +101 -0
- package/dist/models/relation-loader.js.map +1 -0
- package/dist/models/section.d.ts +22 -0
- package/dist/models/section.d.ts.map +1 -0
- package/dist/models/section.js +47 -0
- package/dist/models/section.js.map +1 -0
- package/dist/models/sequential-hyperedge.d.ts +32 -0
- package/dist/models/sequential-hyperedge.d.ts.map +1 -0
- package/dist/models/sequential-hyperedge.js +49 -0
- package/dist/models/sequential-hyperedge.js.map +1 -0
- package/dist/models/sequential-member.d.ts +8 -0
- package/dist/models/sequential-member.d.ts.map +1 -0
- package/{src/models/sequential-member.ts → dist/models/sequential-member.js} +4 -9
- package/dist/models/sequential-member.js.map +1 -0
- package/dist/models/shared-non-verbal-entity.d.ts +16 -0
- package/dist/models/shared-non-verbal-entity.d.ts.map +1 -0
- package/dist/models/shared-non-verbal-entity.js +28 -0
- package/dist/models/shared-non-verbal-entity.js.map +1 -0
- package/dist/models/table.d.ts +15 -0
- package/dist/models/table.d.ts.map +1 -0
- package/dist/models/table.js +27 -0
- package/dist/models/table.js.map +1 -0
- package/dist/rdf/agents-emitter.d.ts +37 -0
- package/dist/rdf/agents-emitter.d.ts.map +1 -0
- package/dist/rdf/agents-emitter.js +107 -0
- package/dist/rdf/agents-emitter.js.map +1 -0
- package/dist/rdf/bibliography-emitter.d.ts +16 -0
- package/dist/rdf/bibliography-emitter.d.ts.map +1 -0
- package/dist/rdf/bibliography-emitter.js +84 -0
- package/dist/rdf/bibliography-emitter.js.map +1 -0
- package/dist/rdf/bnode-id.d.ts +2 -0
- package/dist/rdf/bnode-id.d.ts.map +1 -0
- package/dist/rdf/bnode-id.js +57 -0
- package/dist/rdf/bnode-id.js.map +1 -0
- package/dist/rdf/build-activity-emitter.d.ts +42 -0
- package/dist/rdf/build-activity-emitter.d.ts.map +1 -0
- package/dist/rdf/build-activity-emitter.js +103 -0
- package/dist/rdf/build-activity-emitter.js.map +1 -0
- package/dist/rdf/curie.d.ts +7 -0
- package/dist/rdf/curie.d.ts.map +1 -0
- package/dist/rdf/curie.js +45 -0
- package/dist/rdf/curie.js.map +1 -0
- package/dist/rdf/dataset-emitter.d.ts +37 -0
- package/dist/rdf/dataset-emitter.d.ts.map +1 -0
- package/dist/rdf/dataset-emitter.js +126 -0
- package/dist/rdf/dataset-emitter.js.map +1 -0
- package/dist/rdf/deterministic-id.d.ts +3 -0
- package/dist/rdf/deterministic-id.d.ts.map +1 -0
- package/dist/rdf/deterministic-id.js +68 -0
- package/dist/rdf/deterministic-id.js.map +1 -0
- package/dist/rdf/document-writer.d.ts +11 -0
- package/dist/rdf/document-writer.d.ts.map +1 -0
- package/dist/rdf/document-writer.js +77 -0
- package/dist/rdf/document-writer.js.map +1 -0
- package/dist/rdf/gloss-concept.d.ts +27 -0
- package/dist/rdf/gloss-concept.d.ts.map +1 -0
- package/dist/rdf/gloss-concept.js +95 -0
- package/dist/rdf/gloss-concept.js.map +1 -0
- package/dist/rdf/gloss-designation.d.ts +17 -0
- package/dist/rdf/gloss-designation.d.ts.map +1 -0
- package/dist/rdf/gloss-designation.js +46 -0
- package/dist/rdf/gloss-designation.js.map +1 -0
- package/dist/rdf/gloss-detailed-definition.d.ts +14 -0
- package/dist/rdf/gloss-detailed-definition.d.ts.map +1 -0
- package/dist/rdf/gloss-detailed-definition.js +53 -0
- package/dist/rdf/gloss-detailed-definition.js.map +1 -0
- package/dist/rdf/gloss-generic-hyperedge.d.ts +27 -0
- package/dist/rdf/gloss-generic-hyperedge.d.ts.map +1 -0
- package/{src/rdf/gloss-generic-hyperedge.ts → dist/rdf/gloss-generic-hyperedge.js} +36 -50
- package/dist/rdf/gloss-generic-hyperedge.js.map +1 -0
- package/dist/rdf/gloss-localized-concept.d.ts +24 -0
- package/dist/rdf/gloss-localized-concept.d.ts.map +1 -0
- package/dist/rdf/gloss-localized-concept.js +71 -0
- package/dist/rdf/gloss-localized-concept.js.map +1 -0
- package/dist/rdf/gloss-non-verbal-rep.d.ts +33 -0
- package/dist/rdf/gloss-non-verbal-rep.d.ts.map +1 -0
- package/dist/rdf/gloss-non-verbal-rep.js +163 -0
- package/dist/rdf/gloss-non-verbal-rep.js.map +1 -0
- package/dist/rdf/gloss-partitive-member.d.ts +8 -0
- package/dist/rdf/gloss-partitive-member.d.ts.map +1 -0
- package/{src/rdf/gloss-partitive-member.ts → dist/rdf/gloss-partitive-member.js} +23 -41
- package/dist/rdf/gloss-partitive-member.js.map +1 -0
- package/dist/rdf/gloss-partitive-relation.d.ts +26 -0
- package/dist/rdf/gloss-partitive-relation.d.ts.map +1 -0
- package/dist/rdf/gloss-partitive-relation.js +73 -0
- package/dist/rdf/gloss-partitive-relation.js.map +1 -0
- package/dist/rdf/gloss-source.d.ts +23 -0
- package/dist/rdf/gloss-source.d.ts.map +1 -0
- package/dist/rdf/gloss-source.js +52 -0
- package/dist/rdf/gloss-source.js.map +1 -0
- package/dist/rdf/group-emitter.d.ts +46 -0
- package/dist/rdf/group-emitter.d.ts.map +1 -0
- package/dist/rdf/group-emitter.js +107 -0
- package/dist/rdf/group-emitter.js.map +1 -0
- package/dist/rdf/image-variant-emitter.d.ts +12 -0
- package/dist/rdf/image-variant-emitter.d.ts.map +1 -0
- package/dist/rdf/image-variant-emitter.js +55 -0
- package/dist/rdf/image-variant-emitter.js.map +1 -0
- package/dist/rdf/index.d.ts +26 -0
- package/dist/rdf/index.d.ts.map +1 -0
- package/{src/rdf/index.ts → dist/rdf/index.js} +8 -37
- package/dist/rdf/index.js.map +1 -0
- package/dist/rdf/normalize-enum.d.ts +3 -0
- package/dist/rdf/normalize-enum.d.ts.map +1 -0
- package/{src/rdf/normalize-enum.ts → dist/rdf/normalize-enum.js} +11 -10
- package/dist/rdf/normalize-enum.js.map +1 -0
- package/dist/rdf/predicates.d.ts +277 -0
- package/dist/rdf/predicates.d.ts.map +1 -0
- package/dist/rdf/predicates.js +279 -0
- package/dist/rdf/predicates.js.map +1 -0
- package/dist/rdf/prefixes.d.ts +16 -0
- package/dist/rdf/prefixes.d.ts.map +1 -0
- package/{src/rdf/prefixes.ts → dist/rdf/prefixes.js} +10 -12
- package/dist/rdf/prefixes.js.map +1 -0
- package/dist/rdf/provenance-emitter.d.ts +28 -0
- package/dist/rdf/provenance-emitter.d.ts.map +1 -0
- package/dist/rdf/provenance-emitter.js +74 -0
- package/dist/rdf/provenance-emitter.js.map +1 -0
- package/dist/rdf/sections-builder.d.ts +17 -0
- package/dist/rdf/sections-builder.d.ts.map +1 -0
- package/dist/rdf/sections-builder.js +137 -0
- package/dist/rdf/sections-builder.js.map +1 -0
- package/dist/rdf/shacl-entry.d.ts +2 -0
- package/dist/rdf/shacl-entry.d.ts.map +1 -0
- package/{src/rdf/shacl-entry.ts → dist/rdf/shacl-entry.js} +1 -1
- package/dist/rdf/shacl-entry.js.map +1 -0
- package/dist/rdf/shacl.d.ts +10 -0
- package/dist/rdf/shacl.d.ts.map +1 -0
- package/{src/rdf/shacl.ts → dist/rdf/shacl.js} +38 -57
- package/dist/rdf/shacl.js.map +1 -0
- package/dist/rdf/terms.d.ts +10 -0
- package/dist/rdf/terms.d.ts.map +1 -0
- package/{src/rdf/terms.ts → dist/rdf/terms.js} +6 -3
- package/dist/rdf/terms.js.map +1 -0
- package/dist/rdf/version-emitter.d.ts +57 -0
- package/dist/rdf/version-emitter.d.ts.map +1 -0
- package/dist/rdf/version-emitter.js +68 -0
- package/dist/rdf/version-emitter.js.map +1 -0
- package/dist/rdf/vocabulary-emitter.d.ts +32 -0
- package/dist/rdf/vocabulary-emitter.d.ts.map +1 -0
- package/dist/rdf/vocabulary-emitter.js +46 -0
- package/dist/rdf/vocabulary-emitter.js.map +1 -0
- package/dist/rdf/write-turtle-sync.d.ts +7 -0
- package/dist/rdf/write-turtle-sync.d.ts.map +1 -0
- package/dist/rdf/write-turtle-sync.js +130 -0
- package/dist/rdf/write-turtle-sync.js.map +1 -0
- package/dist/reference-mention.d.ts +49 -0
- package/dist/reference-mention.d.ts.map +1 -0
- package/dist/reference-mention.js +98 -0
- package/dist/reference-mention.js.map +1 -0
- package/dist/reference-resolver.d.ts +52 -0
- package/dist/reference-resolver.d.ts.map +1 -0
- package/dist/reference-resolver.js +311 -0
- package/dist/reference-resolver.js.map +1 -0
- package/dist/render-classification.d.ts +19 -0
- package/dist/render-classification.d.ts.map +1 -0
- package/dist/render-classification.js +82 -0
- package/dist/render-classification.js.map +1 -0
- package/dist/sort.d.ts +5 -0
- package/dist/sort.d.ts.map +1 -0
- package/dist/sort.js +25 -0
- package/dist/sort.js.map +1 -0
- package/dist/transforms/concept-to-gloss.transform.d.ts +32 -0
- package/dist/transforms/concept-to-gloss.transform.d.ts.map +1 -0
- package/dist/transforms/concept-to-gloss.transform.js +60 -0
- package/dist/transforms/concept-to-gloss.transform.js.map +1 -0
- package/dist/transforms/index.d.ts +2 -0
- package/dist/transforms/index.d.ts.map +1 -0
- package/{src/transforms/index.ts → dist/transforms/index.js} +1 -0
- package/dist/transforms/index.js.map +1 -0
- package/dist/utils/assertions.d.ts +4 -0
- package/dist/utils/assertions.d.ts.map +1 -0
- package/dist/utils/assertions.js +17 -0
- package/dist/utils/assertions.js.map +1 -0
- package/dist/utils/external-detection.d.ts +38 -0
- package/dist/utils/external-detection.d.ts.map +1 -0
- package/dist/utils/external-detection.js +55 -0
- package/dist/utils/external-detection.js.map +1 -0
- package/dist/uuid.d.ts +4 -0
- package/dist/uuid.d.ts.map +1 -0
- package/dist/uuid.js +23 -0
- package/dist/uuid.js.map +1 -0
- package/dist/v1-reader.d.ts +8 -0
- package/dist/v1-reader.d.ts.map +1 -0
- package/dist/v1-reader.js +56 -0
- package/dist/v1-reader.js.map +1 -0
- package/dist/validators/asset-index.d.ts +23 -0
- package/dist/validators/asset-index.d.ts.map +1 -0
- package/dist/validators/asset-index.js +58 -0
- package/dist/validators/asset-index.js.map +1 -0
- package/dist/validators/binary-has-part-redundancy-rule.d.ts +8 -0
- package/dist/validators/binary-has-part-redundancy-rule.d.ts.map +1 -0
- package/dist/validators/binary-has-part-redundancy-rule.js +57 -0
- package/dist/validators/binary-has-part-redundancy-rule.js.map +1 -0
- package/dist/validators/concept-validator.d.ts +21 -0
- package/dist/validators/concept-validator.d.ts.map +1 -0
- package/dist/validators/concept-validator.js +76 -0
- package/dist/validators/concept-validator.js.map +1 -0
- package/dist/validators/delimiting-coherence-rule.d.ts +8 -0
- package/dist/validators/delimiting-coherence-rule.d.ts.map +1 -0
- package/dist/validators/delimiting-coherence-rule.js +72 -0
- package/dist/validators/delimiting-coherence-rule.js.map +1 -0
- package/dist/validators/extensional-completeness.d.ts +18 -0
- package/dist/validators/extensional-completeness.d.ts.map +1 -0
- package/dist/validators/extensional-completeness.js +41 -0
- package/dist/validators/extensional-completeness.js.map +1 -0
- package/dist/validators/external-concept-shape-rule.d.ts +8 -0
- package/dist/validators/external-concept-shape-rule.d.ts.map +1 -0
- package/dist/validators/external-concept-shape-rule.js +48 -0
- package/dist/validators/external-concept-shape-rule.js.map +1 -0
- package/dist/validators/gcr-validator.d.ts +11 -0
- package/dist/validators/gcr-validator.d.ts.map +1 -0
- package/dist/validators/gcr-validator.js +76 -0
- package/dist/validators/gcr-validator.js.map +1 -0
- package/dist/validators/hyperedge-coherence-rule.d.ts +9 -0
- package/dist/validators/hyperedge-coherence-rule.d.ts.map +1 -0
- package/dist/validators/hyperedge-coherence-rule.js +78 -0
- package/dist/validators/hyperedge-coherence-rule.js.map +1 -0
- package/dist/validators/index.d.ts +21 -0
- package/dist/validators/index.d.ts.map +1 -0
- package/{src/validators/index.ts → dist/validators/index.js} +25 -51
- package/dist/validators/index.js.map +1 -0
- package/dist/validators/partitive-relation-coherence-rule.d.ts +2 -0
- package/dist/validators/partitive-relation-coherence-rule.d.ts.map +1 -0
- package/{src/validators/partitive-relation-coherence-rule.ts → dist/validators/partitive-relation-coherence-rule.js} +1 -1
- package/dist/validators/partitive-relation-coherence-rule.js.map +1 -0
- package/dist/validators/ref-keys.d.ts +8 -0
- package/dist/validators/ref-keys.d.ts.map +1 -0
- package/dist/validators/ref-keys.js +27 -0
- package/dist/validators/ref-keys.js.map +1 -0
- package/dist/validators/register-validator.d.ts +10 -0
- package/dist/validators/register-validator.d.ts.map +1 -0
- package/dist/validators/register-validator.js +18 -0
- package/dist/validators/register-validator.js.map +1 -0
- package/dist/validators/relationship-type-rule.d.ts +13 -0
- package/dist/validators/relationship-type-rule.d.ts.map +1 -0
- package/dist/validators/relationship-type-rule.js +34 -0
- package/dist/validators/relationship-type-rule.js.map +1 -0
- package/dist/validators/sourced-from-locality-rule.d.ts +8 -0
- package/dist/validators/sourced-from-locality-rule.d.ts.map +1 -0
- package/dist/validators/sourced-from-locality-rule.js +37 -0
- package/dist/validators/sourced-from-locality-rule.js.map +1 -0
- package/dist/validators/v3-rules.d.ts +60 -0
- package/dist/validators/v3-rules.d.ts.map +1 -0
- package/dist/validators/v3-rules.js +327 -0
- package/dist/validators/v3-rules.js.map +1 -0
- package/dist/validators/validation-error.d.ts +13 -0
- package/dist/validators/validation-error.d.ts.map +1 -0
- package/dist/validators/validation-error.js +17 -0
- package/dist/validators/validation-error.js.map +1 -0
- package/dist/validators/validation-result.d.ts +17 -0
- package/dist/validators/validation-result.d.ts.map +1 -0
- package/dist/validators/validation-result.js +47 -0
- package/dist/validators/validation-result.js.map +1 -0
- package/dist/validators/validation-rule.d.ts +10 -0
- package/dist/validators/validation-rule.d.ts.map +1 -0
- package/dist/validators/validation-rule.js +17 -0
- package/dist/validators/validation-rule.js.map +1 -0
- package/package.json +37 -42
- package/src/concept-collection.ts +0 -172
- package/src/concept-parser.ts +0 -235
- package/src/concept-reader.d.ts +0 -13
- package/src/concept-serializer.ts +0 -110
- package/src/concept-writer.d.ts +0 -7
- package/src/concept-writer.ts +0 -47
- package/src/diff/canonical-json.ts +0 -29
- package/src/diff/change.ts +0 -175
- package/src/diff/collection-diff.ts +0 -245
- package/src/diff/concept-diff.ts +0 -853
- package/src/diff/diff-patch.ts +0 -276
- package/src/diff/diff-renderer.ts +0 -348
- package/src/diff/identity.ts +0 -33
- package/src/diff/index.d.ts +0 -242
- package/src/diff/index.ts +0 -50
- package/src/diff/list-diff.ts +0 -231
- package/src/diff/similarity.ts +0 -20
- package/src/diff/text-diff.ts +0 -167
- package/src/entity-directory.ts +0 -43
- package/src/errors.d.ts +0 -11
- package/src/errors.ts +0 -24
- package/src/gcr-reader.d.ts +0 -65
- package/src/gcr-reader.ts +0 -512
- package/src/gcr-writer.d.ts +0 -22
- package/src/gcr-writer.ts +0 -99
- package/src/index.d.ts +0 -124
- package/src/index.ts +0 -92
- package/src/managed-concept-collection.ts +0 -130
- package/src/migration/hyperedge-migrator.ts +0 -104
- package/src/models/abstract-hyperedge.ts +0 -164
- package/src/models/base.ts +0 -110
- package/src/models/bibliography-data.ts +0 -64
- package/src/models/bibliography-entry.ts +0 -40
- package/src/models/citation.ts +0 -98
- package/src/models/concept-date.ts +0 -48
- package/src/models/concept-ref.ts +0 -64
- package/src/models/concept-reference.ts +0 -50
- package/src/models/concept-source.ts +0 -96
- package/src/models/concept-system-type.ts +0 -39
- package/src/models/concept-system.ts +0 -152
- package/src/models/concept.ts +0 -499
- package/src/models/dataset-color.ts +0 -88
- package/src/models/designation-relationship.ts +0 -39
- package/src/models/designation.ts +0 -297
- package/src/models/detailed-definition.ts +0 -92
- package/src/models/enum.ts +0 -60
- package/src/models/equivalence-degree.ts +0 -34
- package/src/models/figure.ts +0 -110
- package/src/models/formula.ts +0 -36
- package/src/models/gcr-metadata.ts +0 -118
- package/src/models/gcr-statistics.ts +0 -76
- package/src/models/generic-hyperedge.ts +0 -72
- package/src/models/generic-member.ts +0 -80
- package/src/models/grammar-info.ts +0 -78
- package/src/models/hyperedge-colors.ts +0 -87
- package/src/models/hyperedge-index.ts +0 -101
- package/src/models/hyperedge-member.ts +0 -121
- package/src/models/hyperedge-registry.ts +0 -145
- package/src/models/index.d.ts +0 -586
- package/src/models/locality.ts +0 -34
- package/src/models/localized-concept.ts +0 -284
- package/src/models/localized-string.ts +0 -32
- package/src/models/multiplicity.ts +0 -134
- package/src/models/non-verb-rep.ts +0 -48
- package/src/models/non-verbal-entity.ts +0 -65
- package/src/models/non-verbal-reference.ts +0 -73
- package/src/models/non-verbal-references.ts +0 -29
- package/src/models/partitive-enumeration.ts +0 -27
- package/src/models/partitive-hyperedge.ts +0 -90
- package/src/models/partitive-member.ts +0 -56
- package/src/models/plurality-marker.ts +0 -31
- package/src/models/pronunciation.ts +0 -40
- package/src/models/register.ts +0 -315
- package/src/models/registrable.ts +0 -48
- package/src/models/related-concept.ts +0 -117
- package/src/models/relation-categories.ts +0 -167
- package/src/models/relation-colors.ts +0 -90
- package/src/models/relation-loader.ts +0 -115
- package/src/models/section.ts +0 -61
- package/src/models/sequential-hyperedge.ts +0 -70
- package/src/models/shared-non-verbal-entity.ts +0 -36
- package/src/models/table.ts +0 -36
- package/src/rdf/agents-emitter.ts +0 -137
- package/src/rdf/bibliography-emitter.ts +0 -126
- package/src/rdf/bnode-id.ts +0 -55
- package/src/rdf/build-activity-emitter.ts +0 -129
- package/src/rdf/curie.ts +0 -46
- package/src/rdf/dataset-emitter.ts +0 -170
- package/src/rdf/deterministic-id.ts +0 -69
- package/src/rdf/document-writer.ts +0 -87
- package/src/rdf/gloss-concept.ts +0 -115
- package/src/rdf/gloss-designation.ts +0 -72
- package/src/rdf/gloss-detailed-definition.ts +0 -69
- package/src/rdf/gloss-localized-concept.ts +0 -79
- package/src/rdf/gloss-non-verbal-rep.ts +0 -202
- package/src/rdf/gloss-partitive-relation.ts +0 -89
- package/src/rdf/gloss-source.ts +0 -56
- package/src/rdf/group-emitter.ts +0 -133
- package/src/rdf/image-variant-emitter.ts +0 -80
- package/src/rdf/index.d.ts +0 -371
- package/src/rdf/predicates.d.ts +0 -527
- package/src/rdf/predicates.ts +0 -287
- package/src/rdf/provenance-emitter.ts +0 -87
- package/src/rdf/sections-builder.ts +0 -190
- package/src/rdf/shacl-entry.d.ts +0 -6
- package/src/rdf/version-emitter.ts +0 -97
- package/src/rdf/vocabulary-emitter.ts +0 -67
- package/src/rdf/write-turtle-sync.ts +0 -179
- package/src/reference-mention.ts +0 -114
- package/src/reference-resolver.ts +0 -361
- package/src/render-classification.ts +0 -85
- package/src/sort.ts +0 -22
- package/src/transforms/concept-to-gloss.transform.ts +0 -81
- package/src/transforms/index.d.ts +0 -26
- package/src/uuid.ts +0 -32
- package/src/v1-reader.ts +0 -66
- package/src/validators/asset-index.ts +0 -72
- package/src/validators/binary-has-part-redundancy-rule.ts +0 -67
- package/src/validators/concept-validator.ts +0 -93
- package/src/validators/delimiting-coherence-rule.ts +0 -105
- package/src/validators/external-concept-shape-rule.ts +0 -60
- package/src/validators/gcr-validator.ts +0 -76
- package/src/validators/hyperedge-coherence-rule.ts +0 -98
- package/src/validators/index.d.ts +0 -43
- package/src/validators/ref-keys.ts +0 -31
- package/src/validators/register-validator.ts +0 -18
- package/src/validators/relationship-type-rule.ts +0 -39
- package/src/validators/sourced-from-locality-rule.ts +0 -53
- package/src/validators/v3-rules.ts +0 -382
- package/src/validators/validation-error.ts +0 -19
- package/src/validators/validation-result.ts +0 -52
- package/src/validators/validation-rule.ts +0 -21
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
// AbstractHyperedge — shared base for directed 1→N hyperedges
|
|
2
|
-
// (PartitiveHyperedge, GenericHyperedge, SequentialHyperedge, future
|
|
3
|
-
// AssociativeHyperedge, etc.).
|
|
4
|
-
//
|
|
5
|
-
// Carries the common shape:
|
|
6
|
-
// - comprehensive: ConceptRef
|
|
7
|
-
// - members: 2+ MECE dimensioned concept refs (≥2 per ISO 704)
|
|
8
|
-
// - completeness: complete | partial
|
|
9
|
-
// - criterion: localized subdivision criterion (ISO 12620)
|
|
10
|
-
// - sources / notes / status: administrative metadata
|
|
11
|
-
//
|
|
12
|
-
// See docs/design/abstract-hyperedge.md (concept-model repo).
|
|
13
|
-
|
|
14
|
-
import { GlossaristModel } from './base.js';
|
|
15
|
-
import { ConceptRef } from './concept-ref.js';
|
|
16
|
-
import type { ConceptRefJson } from './concept-ref.js';
|
|
17
|
-
import { DEFAULT_COMPLETENESS, isValidCompleteness } from './completeness.js';
|
|
18
|
-
import type { Completeness } from './completeness.js';
|
|
19
|
-
import type { HyperedgeMember } from './hyperedge-member.js';
|
|
20
|
-
import type { LocalizedString } from './generic-member.js';
|
|
21
|
-
|
|
22
|
-
export interface AbstractHyperedgeJson {
|
|
23
|
-
comprehensive: ConceptRefJson;
|
|
24
|
-
members: ReadonlyArray<unknown>;
|
|
25
|
-
completeness: Completeness;
|
|
26
|
-
criterion?: LocalizedString;
|
|
27
|
-
sources?: ReadonlyArray<unknown>;
|
|
28
|
-
notes?: Record<string, unknown> | null;
|
|
29
|
-
status?: string | null;
|
|
30
|
-
/** PartitiveHyperedge wire alias (only present on PartitiveHyperedge JSON). */
|
|
31
|
-
partitives?: ReadonlyArray<unknown>;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export type CriterionInput = string | LocalizedString | null | undefined;
|
|
35
|
-
|
|
36
|
-
export abstract class AbstractHyperedge extends GlossaristModel {
|
|
37
|
-
readonly comprehensive: ConceptRef;
|
|
38
|
-
readonly members: ReadonlyArray<HyperedgeMember>;
|
|
39
|
-
readonly completeness: Completeness;
|
|
40
|
-
readonly criterion: LocalizedString | null;
|
|
41
|
-
readonly sources: ReadonlyArray<unknown>;
|
|
42
|
-
readonly notes: Record<string, unknown> | null;
|
|
43
|
-
readonly status: string | null;
|
|
44
|
-
|
|
45
|
-
constructor(
|
|
46
|
-
data: AbstractHyperedgeJson = {
|
|
47
|
-
comprehensive: {},
|
|
48
|
-
members: [],
|
|
49
|
-
completeness: 'complete',
|
|
50
|
-
},
|
|
51
|
-
) {
|
|
52
|
-
super();
|
|
53
|
-
this.comprehensive = _ensureComprehensive(data.comprehensive);
|
|
54
|
-
this.members = _ensureMembers(
|
|
55
|
-
data.members,
|
|
56
|
-
this.constructor.name,
|
|
57
|
-
) as ReadonlyArray<HyperedgeMember>;
|
|
58
|
-
this.completeness = _resolveCompleteness(data.completeness);
|
|
59
|
-
this.criterion = _normalizeCriterion(data.criterion);
|
|
60
|
-
this.sources = Array.isArray(data.sources) ? [...data.sources] : [];
|
|
61
|
-
this.notes = (data.notes as Record<string, unknown> | null) ?? null;
|
|
62
|
-
this.status = data.status ?? null;
|
|
63
|
-
|
|
64
|
-
_assertNoSelfLoop(this.comprehensive, this.members);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
get isComplete(): boolean { return this.completeness === 'complete'; }
|
|
68
|
-
get isPartial(): boolean { return this.completeness === 'partial'; }
|
|
69
|
-
get isCoordinate(): boolean { return this.members.length >= 2; }
|
|
70
|
-
|
|
71
|
-
hasCriterion(): boolean { return this.criterion != null; }
|
|
72
|
-
|
|
73
|
-
override identity(): string {
|
|
74
|
-
const Ctor = this.constructor as unknown as { identityOf: (v: unknown) => string };
|
|
75
|
-
return Ctor.identityOf(this);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
override toJSON(): AbstractHyperedgeJson {
|
|
79
|
-
const obj: AbstractHyperedgeJson = {
|
|
80
|
-
comprehensive: this.comprehensive.toJSON(),
|
|
81
|
-
members: this.members.map((m) => m.toJSON()),
|
|
82
|
-
completeness: this.completeness,
|
|
83
|
-
};
|
|
84
|
-
if (this.criterion != null) obj.criterion = { ...this.criterion };
|
|
85
|
-
if (this.sources.length > 0) obj.sources = [...this.sources];
|
|
86
|
-
if (this.notes != null) obj.notes = { ...this.notes };
|
|
87
|
-
if (this.status != null) obj.status = this.status;
|
|
88
|
-
return obj;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function _ensureComprehensive(
|
|
93
|
-
value: ConceptRefJson | ConceptRef | null | undefined,
|
|
94
|
-
): ConceptRef {
|
|
95
|
-
const ref = value instanceof ConceptRef ? value : new ConceptRef(value ?? {});
|
|
96
|
-
if (!ref.source && !ref.id && !ref.text) {
|
|
97
|
-
throw new Error(
|
|
98
|
-
'AbstractHyperedge.comprehensive must be a non-empty ConceptReference ' +
|
|
99
|
-
'(source, id, or text required)',
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
return ref;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function _ensureMembers(
|
|
106
|
-
values: ReadonlyArray<unknown> | null | undefined,
|
|
107
|
-
typeName: string,
|
|
108
|
-
): ReadonlyArray<unknown> {
|
|
109
|
-
if (!Array.isArray(values)) {
|
|
110
|
-
throw new Error(
|
|
111
|
-
`${typeName}.members must be an array (got ${values === null ? 'null' : typeof values})`,
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
if (values.length < 2) {
|
|
115
|
-
throw new Error(
|
|
116
|
-
`${typeName} requires ≥2 partitives (ISO 704); got ${values.length}`,
|
|
117
|
-
);
|
|
118
|
-
}
|
|
119
|
-
return values;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function _resolveCompleteness(
|
|
123
|
-
value: Completeness | null | undefined,
|
|
124
|
-
): Completeness {
|
|
125
|
-
const c = value ?? DEFAULT_COMPLETENESS;
|
|
126
|
-
if (!isValidCompleteness(c)) {
|
|
127
|
-
throw new Error(
|
|
128
|
-
`completeness has invalid value ${JSON.stringify(value)}`,
|
|
129
|
-
);
|
|
130
|
-
}
|
|
131
|
-
return c;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function _normalizeCriterion(value: CriterionInput): LocalizedString | null {
|
|
135
|
-
if (value == null) return null;
|
|
136
|
-
if (typeof value === 'string') {
|
|
137
|
-
return value.length > 0 ? { default: value } : null;
|
|
138
|
-
}
|
|
139
|
-
if (typeof value === 'object') {
|
|
140
|
-
const entries = Object.entries(value).filter(
|
|
141
|
-
([, v]) => typeof v === 'string',
|
|
142
|
-
);
|
|
143
|
-
return entries.length > 0
|
|
144
|
-
? (Object.fromEntries(entries) as LocalizedString)
|
|
145
|
-
: null;
|
|
146
|
-
}
|
|
147
|
-
return null;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
function _assertNoSelfLoop(
|
|
151
|
-
comprehensive: ConceptRef,
|
|
152
|
-
members: ReadonlyArray<{ ref?: { source?: string | null; id?: string | null } }>,
|
|
153
|
-
): void {
|
|
154
|
-
const cKey = `${comprehensive.source ?? ''}:${comprehensive.id ?? ''}`;
|
|
155
|
-
for (const m of members) {
|
|
156
|
-
const ref = m.ref;
|
|
157
|
-
const pKey = `${ref?.source ?? ''}:${ref?.id ?? ''}`;
|
|
158
|
-
if (pKey === cKey && (ref?.source || ref?.id)) {
|
|
159
|
-
throw new Error(
|
|
160
|
-
'Relation.members cannot include the comprehensive (no self-loops)',
|
|
161
|
-
);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}
|
package/src/models/base.ts
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GlossaristModel — abstract base for every domain model.
|
|
3
|
-
*
|
|
4
|
-
* Subclasses implement `toJSON()` (wire shape) and `identity()`
|
|
5
|
-
* (stable string key for diff/dedupe). `equals()` and `clone()`
|
|
6
|
-
* default to comparing via JSON serialization; subclasses may
|
|
7
|
-
* override for performance.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Any value that can be the output of `JSON.stringify`. Used as the
|
|
12
|
-
* return type of {@link GlossaristModel.toJSON} so subclasses with
|
|
13
|
-
* non-object JSON output (e.g. `NonVerbalReference.toJSON()` returns
|
|
14
|
-
* a bare string for the no-display case) can override without
|
|
15
|
-
* breaking variance. The object case accepts any object to avoid
|
|
16
|
-
* forcing `<Model>Json` interfaces to declare explicit string index
|
|
17
|
-
* signatures (TS interfaces don't have implicit index signatures).
|
|
18
|
-
*/
|
|
19
|
-
export type JsonValue =
|
|
20
|
-
| string
|
|
21
|
-
| number
|
|
22
|
-
| boolean
|
|
23
|
-
| null
|
|
24
|
-
| JsonValue[]
|
|
25
|
-
| object;
|
|
26
|
-
|
|
27
|
-
export abstract class GlossaristModel {
|
|
28
|
-
/** Wire-shape serialization. Subclasses MUST override. */
|
|
29
|
-
toJSON(): JsonValue {
|
|
30
|
-
throw new Error(`${this.constructor.name} must implement toJSON()`);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/** Stable identity string for diff, dedupe, registry keys. */
|
|
34
|
-
identity(): string {
|
|
35
|
-
throw new Error(`${this.constructor.name} must implement identity()`);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/** Default: structural equality via JSON. Override for semantic equality. */
|
|
39
|
-
equals(other: this): boolean {
|
|
40
|
-
if (!(other instanceof this.constructor)) return false;
|
|
41
|
-
return JSON.stringify(this.toJSON()) === JSON.stringify(other.toJSON());
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/** Deep clone via JSON round-trip. Subclasses with non-JSON-safe
|
|
45
|
-
* fields must override. */
|
|
46
|
-
clone(): this {
|
|
47
|
-
const Ctor = this.constructor as new (data: unknown) => this;
|
|
48
|
-
return new Ctor(JSON.parse(JSON.stringify(this.toJSON())));
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Subclasses MUST override. Declared on the abstract base so callers
|
|
53
|
-
* who only have `typeof GlossaristModel` get a typed call site
|
|
54
|
-
* (rather than the static disappearing under `abstract`).
|
|
55
|
-
*/
|
|
56
|
-
static fromJSON(_data: unknown): GlossaristModel {
|
|
57
|
-
throw new Error(`${this.name} must implement fromJSON()`);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Lazily wrap a raw array (plain hashes) into model instances.
|
|
62
|
-
* Used by Concept's lazy `figures`/`tables`/`formulas` getters so
|
|
63
|
-
* the wrap cost is only paid on first access.
|
|
64
|
-
*
|
|
65
|
-
* `cacheKey` and `rawKey` are private field names on `this`. The
|
|
66
|
-
* bracket access here is the only legitimate reflective pattern in
|
|
67
|
-
* the codebase (lazy field init). It is bracket-typed through a
|
|
68
|
-
* local alias rather than the public surface.
|
|
69
|
-
*
|
|
70
|
-
* Underscore-prefixed (not `protected`) so JS subclasses during the
|
|
71
|
-
* TS migration transition can call it without TS4094 on anonymous
|
|
72
|
-
* class expressions. Once all subclasses are .ts this can move to
|
|
73
|
-
* `protected`.
|
|
74
|
-
*/
|
|
75
|
-
_lazy<TItem>(
|
|
76
|
-
cacheKey: string,
|
|
77
|
-
rawKey: string,
|
|
78
|
-
wrapFn: (raw: unknown) => TItem,
|
|
79
|
-
): TItem[] {
|
|
80
|
-
const cache = this as unknown as Record<string, TItem[] | null | undefined>;
|
|
81
|
-
const raw = this as unknown as Record<string, unknown[] | undefined>;
|
|
82
|
-
if (cache[cacheKey] === null || cache[cacheKey] === undefined) {
|
|
83
|
-
const rawArr = raw[rawKey] ?? [];
|
|
84
|
-
cache[cacheKey] = rawArr.map((r) => wrapFn(r));
|
|
85
|
-
}
|
|
86
|
-
return cache[cacheKey] ?? [];
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Helper for `toJSON()`: serialize a lazy-or-raw array under
|
|
91
|
-
* `jsonKey` only when it has items. Model instances go through
|
|
92
|
-
* `toJSON()`; primitives pass through.
|
|
93
|
-
*/
|
|
94
|
-
_serialize(
|
|
95
|
-
obj: Record<string, unknown>,
|
|
96
|
-
jsonKey: string,
|
|
97
|
-
cacheKey: string,
|
|
98
|
-
rawKey: string,
|
|
99
|
-
): void {
|
|
100
|
-
const self = this as unknown as Record<string, unknown[] | null | undefined>;
|
|
101
|
-
const cached = self[cacheKey];
|
|
102
|
-
const raw = self[rawKey];
|
|
103
|
-
const items = cached ?? (Array.isArray(raw) && raw.length > 0 ? raw : []);
|
|
104
|
-
if (items.length > 0) {
|
|
105
|
-
obj[jsonKey] = items.map((i) =>
|
|
106
|
-
i instanceof GlossaristModel ? i.toJSON() : i,
|
|
107
|
-
);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import * as yaml from 'js-yaml';
|
|
2
|
-
import { GlossaristModel } from './base.js';
|
|
3
|
-
import { BibliographyEntry } from './bibliography-entry.js';
|
|
4
|
-
import type { BibliographyEntryJson } from './bibliography-entry.js';
|
|
5
|
-
|
|
6
|
-
export interface BibliographyDataJson {
|
|
7
|
-
bibliography?: ReadonlyArray<BibliographyEntryJson | BibliographyEntry>;
|
|
8
|
-
entries?: ReadonlyArray<BibliographyEntryJson | BibliographyEntry>;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export class BibliographyData extends GlossaristModel {
|
|
12
|
-
private readonly _rawEntries: ReadonlyArray<BibliographyEntryJson | BibliographyEntry>;
|
|
13
|
-
private _entries: ReadonlyArray<BibliographyEntry> | null = null;
|
|
14
|
-
|
|
15
|
-
constructor(data: BibliographyDataJson | ReadonlyArray<BibliographyEntryJson | BibliographyEntry> = {}) {
|
|
16
|
-
super();
|
|
17
|
-
let entriesData: ReadonlyArray<BibliographyEntryJson | BibliographyEntry> | undefined;
|
|
18
|
-
if (Array.isArray(data)) {
|
|
19
|
-
entriesData = data;
|
|
20
|
-
} else {
|
|
21
|
-
entriesData = (data as BibliographyDataJson)?.bibliography ?? (data as BibliographyDataJson)?.entries ?? [];
|
|
22
|
-
}
|
|
23
|
-
this._rawEntries = Array.isArray(entriesData) ? entriesData : [];
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
get entries(): ReadonlyArray<BibliographyEntry> {
|
|
27
|
-
return this._lazy<BibliographyEntry>(
|
|
28
|
-
'_entries',
|
|
29
|
-
'_rawEntries',
|
|
30
|
-
(e) => (e instanceof BibliographyEntry ? e : new BibliographyEntry(e as BibliographyEntryJson)),
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
find(id: string): BibliographyEntry | null {
|
|
35
|
-
return this.entries.find((e) => e.id === id) ?? null;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
get keys(): ReadonlyArray<string | null> {
|
|
39
|
-
return this.entries.map((e) => e.id);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
override toJSON(): BibliographyDataJson {
|
|
43
|
-
if (this.entries.length === 0) return { bibliography: [] };
|
|
44
|
-
return { bibliography: this.entries.map((e) => e.toJSON()) };
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
toYAML(): string {
|
|
48
|
-
return yaml.dump(this.toJSON());
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
static fromYAML(yamlString: string): BibliographyData {
|
|
52
|
-
const parsed = yaml.load(yamlString) as
|
|
53
|
-
| BibliographyDataJson
|
|
54
|
-
| ReadonlyArray<BibliographyEntryJson>
|
|
55
|
-
| undefined;
|
|
56
|
-
return new BibliographyData(parsed ?? {});
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
static override fromJSON(
|
|
60
|
-
data: BibliographyDataJson | ReadonlyArray<BibliographyEntryJson>,
|
|
61
|
-
): BibliographyData {
|
|
62
|
-
return new BibliographyData(data);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { GlossaristModel } from './base.js';
|
|
2
|
-
|
|
3
|
-
export interface BibliographyEntryJson {
|
|
4
|
-
id?: string | null;
|
|
5
|
-
reference?: string | null;
|
|
6
|
-
title?: string | null;
|
|
7
|
-
link?: string | null;
|
|
8
|
-
type?: string | null;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export class BibliographyEntry extends GlossaristModel {
|
|
12
|
-
readonly id: string | null;
|
|
13
|
-
readonly reference: string | null;
|
|
14
|
-
readonly title: string | null;
|
|
15
|
-
readonly link: string | null;
|
|
16
|
-
readonly type: string | null;
|
|
17
|
-
|
|
18
|
-
constructor(data: BibliographyEntryJson = {}) {
|
|
19
|
-
super();
|
|
20
|
-
this.id = data.id ?? null;
|
|
21
|
-
this.reference = data.reference ?? null;
|
|
22
|
-
this.title = data.title ?? null;
|
|
23
|
-
this.link = data.link ?? null;
|
|
24
|
-
this.type = data.type ?? null;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
override toJSON(): BibliographyEntryJson {
|
|
28
|
-
const obj: BibliographyEntryJson = {};
|
|
29
|
-
if (this.id != null) obj.id = this.id;
|
|
30
|
-
if (this.reference != null) obj.reference = this.reference;
|
|
31
|
-
if (this.title != null) obj.title = this.title;
|
|
32
|
-
if (this.link != null) obj.link = this.link;
|
|
33
|
-
if (this.type != null) obj.type = this.type;
|
|
34
|
-
return obj;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
static override fromJSON(data: BibliographyEntryJson): BibliographyEntry {
|
|
38
|
-
return new BibliographyEntry(data);
|
|
39
|
-
}
|
|
40
|
-
}
|
package/src/models/citation.ts
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { GlossaristModel } from './base.js';
|
|
2
|
-
import { Locality } from './locality.js';
|
|
3
|
-
import type { LocalityJson } from './locality.js';
|
|
4
|
-
|
|
5
|
-
export interface CitationRefJson {
|
|
6
|
-
source?: string | null;
|
|
7
|
-
id?: string | null;
|
|
8
|
-
version?: string | null;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface CitationJson {
|
|
12
|
-
ref?: CitationRefJson | CitationRef | null;
|
|
13
|
-
locality?: LocalityJson | Locality | null;
|
|
14
|
-
link?: string | null;
|
|
15
|
-
original?: string | null;
|
|
16
|
-
custom_locality?: string | null;
|
|
17
|
-
customLocality?: string | null;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export class CitationRef extends GlossaristModel {
|
|
21
|
-
readonly source: string | null;
|
|
22
|
-
readonly id: string | null;
|
|
23
|
-
readonly version: string | null;
|
|
24
|
-
|
|
25
|
-
constructor(data: CitationRefJson = {}) {
|
|
26
|
-
super();
|
|
27
|
-
this.source = data.source ?? null;
|
|
28
|
-
this.id = data.id ?? null;
|
|
29
|
-
this.version = data.version ?? null;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
override toString(): string {
|
|
33
|
-
const parts: string[] = [];
|
|
34
|
-
if (this.source) parts.push(this.source);
|
|
35
|
-
if (this.id) parts.push(this.id);
|
|
36
|
-
return parts.join(' ');
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
override toJSON(): CitationRefJson {
|
|
40
|
-
const obj: CitationRefJson = {};
|
|
41
|
-
if (this.source != null) obj.source = this.source;
|
|
42
|
-
if (this.id != null) obj.id = this.id;
|
|
43
|
-
if (this.version != null) obj.version = this.version;
|
|
44
|
-
return obj;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
static override fromJSON(data: CitationRefJson): CitationRef {
|
|
48
|
-
return new CitationRef(data);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export class Citation extends GlossaristModel {
|
|
53
|
-
/** Backward-compat alias for {@link CitationRef}. Original codebase
|
|
54
|
-
* exposed the Ref class via `Citation.Ref`; keep that working. */
|
|
55
|
-
static readonly Ref = CitationRef;
|
|
56
|
-
|
|
57
|
-
readonly ref: CitationRef | null;
|
|
58
|
-
readonly locality: Locality | null;
|
|
59
|
-
readonly link: string | null;
|
|
60
|
-
readonly original: string | null;
|
|
61
|
-
readonly customLocality: string | null;
|
|
62
|
-
|
|
63
|
-
constructor(data: CitationJson | null = {}) {
|
|
64
|
-
super();
|
|
65
|
-
const d = data ?? {};
|
|
66
|
-
this.ref = d.ref
|
|
67
|
-
? d.ref instanceof CitationRef
|
|
68
|
-
? d.ref
|
|
69
|
-
: new CitationRef(d.ref)
|
|
70
|
-
: null;
|
|
71
|
-
this.locality = d.locality
|
|
72
|
-
? d.locality instanceof Locality
|
|
73
|
-
? d.locality
|
|
74
|
-
: new Locality(d.locality)
|
|
75
|
-
: null;
|
|
76
|
-
this.link = d.link ?? null;
|
|
77
|
-
this.original = d.original ?? null;
|
|
78
|
-
this.customLocality = d.custom_locality ?? d.customLocality ?? null;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
override toString(): string {
|
|
82
|
-
return this.ref ? this.ref.toString() : '';
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
override toJSON(): CitationJson {
|
|
86
|
-
const obj: CitationJson = {};
|
|
87
|
-
if (this.ref != null) obj.ref = this.ref.toJSON();
|
|
88
|
-
if (this.locality != null) obj.locality = this.locality.toJSON();
|
|
89
|
-
if (this.link != null) obj.link = this.link;
|
|
90
|
-
if (this.original != null) obj.original = this.original;
|
|
91
|
-
if (this.customLocality != null) obj.custom_locality = this.customLocality;
|
|
92
|
-
return obj;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
static override fromJSON(data: CitationJson): Citation {
|
|
96
|
-
return new Citation(data);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { GlossaristModel } from './base.js';
|
|
2
|
-
|
|
3
|
-
export type ConceptDateType = 'accepted' | 'amended' | 'retired' | string;
|
|
4
|
-
|
|
5
|
-
export const DATE_TYPES: ReadonlyArray<string> = Object.freeze([
|
|
6
|
-
'accepted',
|
|
7
|
-
'amended',
|
|
8
|
-
'retired',
|
|
9
|
-
]);
|
|
10
|
-
|
|
11
|
-
export interface ConceptDateJson {
|
|
12
|
-
date?: string | null;
|
|
13
|
-
type?: ConceptDateType | null;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export class ConceptDate extends GlossaristModel {
|
|
17
|
-
readonly date: string | null;
|
|
18
|
-
readonly type: ConceptDateType | null;
|
|
19
|
-
|
|
20
|
-
constructor(data: ConceptDateJson = {}) {
|
|
21
|
-
super();
|
|
22
|
-
this.date = data.date ?? null;
|
|
23
|
-
this.type = data.type ?? null;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
get parsedDate(): Date | null {
|
|
27
|
-
return this.date ? new Date(this.date) : null;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
static identityOf(value: { type?: ConceptDateType | null } | null | undefined): string {
|
|
31
|
-
return value?.type ?? '';
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
override identity(): string {
|
|
35
|
-
return ConceptDate.identityOf(this);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
override toJSON(): ConceptDateJson {
|
|
39
|
-
const obj: ConceptDateJson = {};
|
|
40
|
-
if (this.date != null) obj.date = this.date;
|
|
41
|
-
if (this.type != null) obj.type = this.type;
|
|
42
|
-
return obj;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
static override fromJSON(data: ConceptDateJson): ConceptDate {
|
|
46
|
-
return new ConceptDate(data);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { GlossaristModel } from './base.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Wire shape for ConceptRef. All three fields are optional on input
|
|
5
|
-
* (any one is enough to identify a concept; usually source+id pair).
|
|
6
|
-
* `text` is a free-form fallback for references that have no
|
|
7
|
-
* machine-readable source.
|
|
8
|
-
*/
|
|
9
|
-
export interface ConceptRefJson {
|
|
10
|
-
source?: string | null;
|
|
11
|
-
id?: string | null;
|
|
12
|
-
text?: string | null;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* ConceptRef — a reference to a concept by (source, id) pair, or by
|
|
17
|
-
* free-form text when no machine-readable source exists.
|
|
18
|
-
*
|
|
19
|
-
* Identity: `${source ?? ''}|${id ?? ''}`. Two refs with the same
|
|
20
|
-
* (source, id) are equal regardless of `text`.
|
|
21
|
-
*/
|
|
22
|
-
export class ConceptRef extends GlossaristModel {
|
|
23
|
-
readonly source: string | null;
|
|
24
|
-
readonly id: string | null;
|
|
25
|
-
readonly text: string | null;
|
|
26
|
-
|
|
27
|
-
constructor(data: ConceptRefJson = {}) {
|
|
28
|
-
super();
|
|
29
|
-
this.source = data.source ?? null;
|
|
30
|
-
this.id = data.id ?? null;
|
|
31
|
-
this.text = data.text ?? null;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
override toString(): string {
|
|
35
|
-
const parts: string[] = [];
|
|
36
|
-
if (this.source) parts.push(this.source);
|
|
37
|
-
if (this.id) parts.push(this.id);
|
|
38
|
-
const base = parts.join(' ');
|
|
39
|
-
if (this.text && base) return `${base} (${this.text})`;
|
|
40
|
-
if (this.text) return this.text;
|
|
41
|
-
return base;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
override toJSON(): ConceptRefJson {
|
|
45
|
-
const obj: ConceptRefJson = {};
|
|
46
|
-
if (this.source != null) obj.source = this.source;
|
|
47
|
-
if (this.id != null) obj.id = this.id;
|
|
48
|
-
if (this.text != null) obj.text = this.text;
|
|
49
|
-
return obj;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
override identity(): string {
|
|
53
|
-
return `${this.source ?? ''}|${this.id ?? ''}`;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
static override fromJSON(data: ConceptRefJson): ConceptRef {
|
|
57
|
-
return new ConceptRef(data);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/** Convenience constructor for the common `(source, id)` form. */
|
|
61
|
-
static fromPair(source: string, id: string): ConceptRef {
|
|
62
|
-
return new ConceptRef({ source, id });
|
|
63
|
-
}
|
|
64
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { GlossaristModel } from './base.js';
|
|
2
|
-
|
|
3
|
-
export interface ConceptReferenceJson {
|
|
4
|
-
concept_id?: string | null;
|
|
5
|
-
conceptId?: string | null;
|
|
6
|
-
ref_type?: string | null;
|
|
7
|
-
refType?: string | null;
|
|
8
|
-
source?: string | null;
|
|
9
|
-
urn?: string | null;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export class ConceptReference extends GlossaristModel {
|
|
13
|
-
readonly conceptId: string | null;
|
|
14
|
-
readonly refType: string | null;
|
|
15
|
-
readonly source: string | null;
|
|
16
|
-
readonly urn: string | null;
|
|
17
|
-
|
|
18
|
-
constructor(data: ConceptReferenceJson = {}) {
|
|
19
|
-
super();
|
|
20
|
-
this.conceptId = data.concept_id ?? data.conceptId ?? null;
|
|
21
|
-
this.refType = data.ref_type ?? data.refType ?? null;
|
|
22
|
-
this.source = data.source ?? null;
|
|
23
|
-
this.urn = data.urn ?? null;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
get isLocal(): boolean {
|
|
27
|
-
return this.urn == null && this.source == null;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
get isExternal(): boolean {
|
|
31
|
-
return !this.isLocal;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
static domain(conceptId: string): ConceptReference {
|
|
35
|
-
return new ConceptReference({ concept_id: conceptId, ref_type: 'domain' });
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
override toJSON(): ConceptReferenceJson {
|
|
39
|
-
const obj: ConceptReferenceJson = {};
|
|
40
|
-
if (this.conceptId != null) obj.concept_id = this.conceptId;
|
|
41
|
-
if (this.refType != null) obj.ref_type = this.refType;
|
|
42
|
-
if (this.source != null) obj.source = this.source;
|
|
43
|
-
if (this.urn != null) obj.urn = this.urn;
|
|
44
|
-
return obj;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
static override fromJSON(data: ConceptReferenceJson): ConceptReference {
|
|
48
|
-
return new ConceptReference(data);
|
|
49
|
-
}
|
|
50
|
-
}
|