glossarist 0.4.49 → 0.4.51
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 +21 -0
- package/dist/index.d.ts.map +1 -0
- package/{src/index.ts → dist/index.js} +6 -66
- 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 -56
- 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/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/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 -166
- package/src/concept-parser.ts +0 -229
- package/src/concept-reader.d.ts +0 -13
- package/src/concept-serializer.ts +0 -99
- package/src/concept-writer.d.ts +0 -7
- package/src/concept-writer.ts +0 -43
- package/src/diff/canonical-json.ts +0 -29
- package/src/diff/change.ts +0 -175
- package/src/diff/collection-diff.ts +0 -197
- package/src/diff/concept-diff.ts +0 -702
- package/src/diff/diff-patch.ts +0 -260
- package/src/diff/diff-renderer.ts +0 -293
- 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 -487
- package/src/gcr-writer.d.ts +0 -22
- package/src/gcr-writer.ts +0 -97
- package/src/index.d.ts +0 -124
- package/src/managed-concept-collection.ts +0 -95
- 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 -134
- 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 -47
- 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 -192
- 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 -178
- 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 -167
- package/src/reference-mention.ts +0 -114
- package/src/reference-resolver.ts +0 -331
- package/src/render-classification.ts +0 -76
- 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 -64
- package/src/validators/asset-index.ts +0 -67
- 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 -75
- 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 -378
- package/src/validators/validation-error.ts +0 -19
- package/src/validators/validation-result.ts +0 -52
- package/src/validators/validation-rule.ts +0 -21
package/src/entity-directory.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
const ENTITY_DIRECTORIES = Object.freeze(new Map([
|
|
2
|
-
['figure', 'figures'],
|
|
3
|
-
['table', 'tables'],
|
|
4
|
-
['formula', 'formulas'],
|
|
5
|
-
]));
|
|
6
|
-
|
|
7
|
-
const ENTITY_TYPES = Object.freeze([...ENTITY_DIRECTORIES.keys()]);
|
|
8
|
-
|
|
9
|
-
function entityDir(type) {
|
|
10
|
-
const dir = ENTITY_DIRECTORIES.get(type);
|
|
11
|
-
if (!dir) throw new RangeError(`Unknown entity type: ${type}`);
|
|
12
|
-
return dir;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function entityPath(type, id) {
|
|
16
|
-
return `${entityDir(type)}/${id}.yaml`;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function isKnownEntityType(type) {
|
|
20
|
-
return ENTITY_DIRECTORIES.has(type);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function parseEntityPath(zipPath) {
|
|
24
|
-
for (const [type, dir] of ENTITY_DIRECTORIES) {
|
|
25
|
-
const prefix = `${dir}/`;
|
|
26
|
-
if (!zipPath.startsWith(prefix)) continue;
|
|
27
|
-
const filename = zipPath.slice(prefix.length);
|
|
28
|
-
if (!filename.endsWith('.yaml')) continue;
|
|
29
|
-
const id = filename.slice(0, -'.yaml'.length);
|
|
30
|
-
if (!id) continue;
|
|
31
|
-
return { type, id };
|
|
32
|
-
}
|
|
33
|
-
return null;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export {
|
|
37
|
-
ENTITY_DIRECTORIES,
|
|
38
|
-
ENTITY_TYPES,
|
|
39
|
-
entityDir,
|
|
40
|
-
entityPath,
|
|
41
|
-
isKnownEntityType,
|
|
42
|
-
parseEntityPath,
|
|
43
|
-
};
|
package/src/errors.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export class GlossaristError extends Error {
|
|
2
|
-
constructor(message: string, options?: { cause?: Error });
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
export class InvalidInputError extends GlossaristError {
|
|
6
|
-
constructor(what: string, expected?: string);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export class YamlParseError extends GlossaristError {
|
|
10
|
-
constructor(context: string, cause: Error);
|
|
11
|
-
}
|
package/src/errors.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/** Base error for all glossarist errors. */
|
|
2
|
-
export class GlossaristError extends Error {
|
|
3
|
-
constructor(message: string, options?: { cause?: Error }) {
|
|
4
|
-
super(message, options);
|
|
5
|
-
this.name = 'GlossaristError';
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
/** Thrown when a function receives invalid input (null, undefined, wrong type). */
|
|
10
|
-
export class InvalidInputError extends GlossaristError {
|
|
11
|
-
constructor(what: string, expected?: string) {
|
|
12
|
-
const msg = expected ? `${what} (expected ${expected})` : what;
|
|
13
|
-
super(msg);
|
|
14
|
-
this.name = 'InvalidInputError';
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/** Thrown when YAML content cannot be parsed. */
|
|
19
|
-
export class YamlParseError extends GlossaristError {
|
|
20
|
-
constructor(context: string, cause: Error) {
|
|
21
|
-
super(`Failed to parse YAML for ${context}: ${cause.message}`, { cause });
|
|
22
|
-
this.name = 'YamlParseError';
|
|
23
|
-
}
|
|
24
|
-
}
|
package/src/gcr-reader.d.ts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { Concept, GcrMetadata } from './models/index';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Load a GCR package from a ZIP archive.
|
|
5
|
-
* Accepts Buffer, ArrayBuffer, Uint8Array, Blob, or base64 string.
|
|
6
|
-
*/
|
|
7
|
-
export function loadGcr(input: Buffer | ArrayBuffer | Uint8Array | Blob | string): Promise<GcrPackage>;
|
|
8
|
-
|
|
9
|
-
/** A loaded GCR package (ZIP archive of glossarist concept data). */
|
|
10
|
-
export class GcrPackage {
|
|
11
|
-
/** Read and parse metadata.yaml as a GcrMetadata instance. */
|
|
12
|
-
metadata(): Promise<GcrMetadata | null>;
|
|
13
|
-
/** Read and parse optional register.yaml. */
|
|
14
|
-
register(): Promise<Record<string, unknown> | null>;
|
|
15
|
-
/** List all concept IDs, naturally sorted. */
|
|
16
|
-
conceptIds(): Promise<string[]>;
|
|
17
|
-
/** Read and normalize a single concept by ID. */
|
|
18
|
-
concept(id: string): Promise<Concept | null>;
|
|
19
|
-
/** Iterate all concepts via callback. */
|
|
20
|
-
eachConcept(callback: (concept: Concept, index: number) => void | Promise<void>): Promise<void>;
|
|
21
|
-
/** Load all concepts into an array. */
|
|
22
|
-
allConcepts(): Promise<Concept[]>;
|
|
23
|
-
|
|
24
|
-
// Compiled / machine formats (TBX, JSON-LD, Turtle, JSONL)
|
|
25
|
-
|
|
26
|
-
/** List compiled format directories present in this package. */
|
|
27
|
-
compiledFormats(): Promise<string[]>;
|
|
28
|
-
/** List entry IDs for a given compiled format. */
|
|
29
|
-
compiledFormatIds(format: string): Promise<string[]>;
|
|
30
|
-
/** Check whether a compiled format is present. */
|
|
31
|
-
hasCompiledFormat(format: string): Promise<boolean>;
|
|
32
|
-
/** Read a single compiled-format file as a string. */
|
|
33
|
-
compiledFile(format: string, id: string): Promise<string | null>;
|
|
34
|
-
/** Read a single compiled-format file as a Uint8Array. */
|
|
35
|
-
compiledFileBuffer(format: string, id: string): Promise<Uint8Array | null>;
|
|
36
|
-
/** Iterate all entries for a compiled format. */
|
|
37
|
-
eachCompiledFile(format: string, callback: (id: string, content: string) => void | Promise<void>): Promise<void>;
|
|
38
|
-
/** Load all entries for a compiled format into a Map. */
|
|
39
|
-
allCompiledFiles(format: string): Promise<Map<string, string>>;
|
|
40
|
-
|
|
41
|
-
// Dataset assets (bibliography, images)
|
|
42
|
-
|
|
43
|
-
/** List all dataset asset entries found in this package. */
|
|
44
|
-
datasetAssetEntries(): Promise<Array<{ path: string; type: 'file' | 'directory'; asset: { path: string; type: string } }>>;
|
|
45
|
-
/** Read a file-type dataset asset by its registered path. */
|
|
46
|
-
readDatasetFileAsset(assetPath: string): Promise<string | null>;
|
|
47
|
-
/** Read bibliography.yaml from the package as raw YAML string. */
|
|
48
|
-
bibliography(): Promise<string | null>;
|
|
49
|
-
/** Check whether the images/ directory is present and non-empty. */
|
|
50
|
-
hasImages(): Promise<boolean>;
|
|
51
|
-
/** List all image file paths (relative to ZIP root). */
|
|
52
|
-
imageFileNames(): Promise<string[]>;
|
|
53
|
-
/** Read a single image file as Uint8Array. */
|
|
54
|
-
imageFile(path: string): Promise<Uint8Array | null>;
|
|
55
|
-
/** Iterate all image files. */
|
|
56
|
-
eachImageFile(callback: (path: string, content: Uint8Array) => void | Promise<void>): Promise<void>;
|
|
57
|
-
/** Load all image files into a Map (path → Uint8Array). */
|
|
58
|
-
allImageFiles(): Promise<Map<string, Uint8Array>>;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/** Parse raw concept YAML (canonical or managed format) into a Concept. */
|
|
62
|
-
export function parseConceptYaml(raw: string, context?: string): Concept;
|
|
63
|
-
|
|
64
|
-
/** Natural sort comparator for concept IDs like "3.1.1.1", "551-12-39". */
|
|
65
|
-
export function naturalSort(a: string, b: string): number;
|
package/src/gcr-reader.ts
DELETED
|
@@ -1,487 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
|
|
2
|
-
import JSZip from 'jszip';
|
|
3
|
-
import * as yaml from 'js-yaml';
|
|
4
|
-
import { conceptParser } from './concept-parser.js';
|
|
5
|
-
import { InvalidInputError } from './errors.js';
|
|
6
|
-
import { COMPILED_FORMATS, parseCompiledPath, compiledPath } from './compiled-format.js';
|
|
7
|
-
import { DATASET_ASSETS, findFileAsset, findDirectoryAssetPath } from './dataset-asset.js';
|
|
8
|
-
import { GcrMetadata } from './models/gcr-metadata.js';
|
|
9
|
-
import { naturalSort } from './sort.js';
|
|
10
|
-
import { NonVerbalEntity } from './models/non-verbal-entity.js';
|
|
11
|
-
import { BibliographyData } from './models/bibliography-data.js';
|
|
12
|
-
import { entityDir, entityPath, ENTITY_TYPES, parseEntityPath } from './entity-directory.js';
|
|
13
|
-
|
|
14
|
-
export { naturalSort } from './sort.js';
|
|
15
|
-
|
|
16
|
-
const BASE64_RE = /^[A-Za-z0-9+/]{100,}={0,2}$/;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @typedef {Object} Term
|
|
20
|
-
* @property {string} type - e.g. 'expression', 'symbol', 'abbreviation'
|
|
21
|
-
* @property {string} designation - the term text
|
|
22
|
-
* @property {string} [normative_status] - e.g. 'preferred', 'admitted'
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* @typedef {Object} Definition
|
|
27
|
-
* @property {string} content - the definition text
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* @typedef {Object} Source
|
|
32
|
-
* @property {string} type - e.g. 'authoritative', 'adapted'
|
|
33
|
-
* @property {{ ref: { source: string, id?: string, version?: string } }} [origin] - reference to the source standard
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* @typedef {Object} Localization
|
|
38
|
-
* @property {Term[]} terms - term designations
|
|
39
|
-
* @property {Definition[]} [definition] - definition content
|
|
40
|
-
* @property {{ content: string }[]} [notes] - editorial notes
|
|
41
|
-
* @property {Array<{ content: string, examples?: object[], sources?: object[] }>} [examples] - usage examples (may themselves nest examples)
|
|
42
|
-
* @property {Source[]} [sources] - bibliographic sources
|
|
43
|
-
* @property {string} [entry_status] - e.g. 'valid', 'draft'
|
|
44
|
-
* @property {string} [normative_status] - e.g. 'preferred', 'admitted'
|
|
45
|
-
*/
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* @typedef {Object} Concept
|
|
49
|
-
* @property {string} termid - concept identifier (e.g. '3.1.1.1', '551-12-39')
|
|
50
|
-
* @property {string|null} term - primary term (canonical format only)
|
|
51
|
-
* @property {Record<string, Localization>} localizations - keyed by ISO 639-3 language code
|
|
52
|
-
* @property {Record<string, unknown>} raw - original parsed YAML
|
|
53
|
-
*/
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Load a GCR package from a ZIP archive.
|
|
57
|
-
*
|
|
58
|
-
* Accepts a Buffer/ArrayBuffer/Uint8Array (Node or browser), a Blob (browser),
|
|
59
|
-
* or a base64-encoded string.
|
|
60
|
-
*
|
|
61
|
-
* @param {Buffer | ArrayBuffer | Uint8Array | Blob | string} input
|
|
62
|
-
* @returns {Promise<GcrPackage>}
|
|
63
|
-
* @throws {InvalidInputError} if input is null or undefined
|
|
64
|
-
*
|
|
65
|
-
* @example
|
|
66
|
-
* import { loadGcr } from 'glossarist';
|
|
67
|
-
* import fs from 'fs';
|
|
68
|
-
* const pkg = await loadGcr(fs.readFileSync('dataset.gcr'));
|
|
69
|
-
* const meta = await pkg.metadata();
|
|
70
|
-
*/
|
|
71
|
-
export async function loadGcr(input) {
|
|
72
|
-
if (input == null) {
|
|
73
|
-
throw new InvalidInputError('loadGcr requires a Buffer, ArrayBuffer, Uint8Array, Blob, or base64 string', 'non-null input');
|
|
74
|
-
}
|
|
75
|
-
const opts = typeof input === 'string' && BASE64_RE.test(input) ? { base64: true } : undefined;
|
|
76
|
-
const zip = await JSZip.loadAsync(input, opts);
|
|
77
|
-
return new GcrPackage(zip);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Represents a loaded GCR package (ZIP archive of glossarist concept data).
|
|
82
|
-
*/
|
|
83
|
-
export class GcrPackage {
|
|
84
|
-
/** @param {JSZip} zip */
|
|
85
|
-
constructor(zip) {
|
|
86
|
-
this._zip = zip;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Read and parse metadata.yaml from the package as a GcrMetadata instance.
|
|
91
|
-
* @returns {Promise<GcrMetadata | null>}
|
|
92
|
-
*/
|
|
93
|
-
async metadata() {
|
|
94
|
-
const raw = await this._readText('metadata.yaml');
|
|
95
|
-
return raw ? GcrMetadata.fromYaml(raw) : null;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Read and parse optional register.yaml from the package.
|
|
100
|
-
* @returns {Promise<Record<string, unknown> | null>}
|
|
101
|
-
*/
|
|
102
|
-
async register() {
|
|
103
|
-
const raw = await this._readText('register.yaml');
|
|
104
|
-
return raw ? yaml.load(raw) : null;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* List all concept IDs (filenames without .yaml), naturally sorted.
|
|
109
|
-
* @returns {Promise<string[]>}
|
|
110
|
-
*/
|
|
111
|
-
async conceptIds() {
|
|
112
|
-
const ids = [];
|
|
113
|
-
this._zip.forEach((relativePath, entry) => {
|
|
114
|
-
if (!entry.dir && relativePath.startsWith('concepts/') && relativePath.endsWith('.yaml')) {
|
|
115
|
-
ids.push(relativePath.slice('concepts/'.length, -'.yaml'.length));
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
return ids.sort(naturalSort);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Read and normalize a single concept by ID.
|
|
123
|
-
* @param {string} id - concept identifier
|
|
124
|
-
* @returns {Promise<Concept | null>}
|
|
125
|
-
*/
|
|
126
|
-
async concept(id) {
|
|
127
|
-
const raw = await this._readText(`concepts/${id}.yaml`);
|
|
128
|
-
if (raw === null) return null;
|
|
129
|
-
return conceptParser.parse(raw, id);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Iterate all concepts. Use for large packages to avoid loading everything at once.
|
|
134
|
-
* @param {(concept: Concept, index: number) => void | Promise<void>} callback
|
|
135
|
-
* @returns {Promise<void>}
|
|
136
|
-
*/
|
|
137
|
-
async eachConcept(callback) {
|
|
138
|
-
const ids = await this.conceptIds();
|
|
139
|
-
for (let i = 0; i < ids.length; i++) {
|
|
140
|
-
const concept = await this.concept(ids[i]);
|
|
141
|
-
if (concept) await callback(concept, i);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Load all concepts into an array. Beware memory for large packages.
|
|
147
|
-
* @returns {Promise<Concept[]>}
|
|
148
|
-
*/
|
|
149
|
-
async allConcepts() {
|
|
150
|
-
const ids = await this.conceptIds();
|
|
151
|
-
const concepts = [];
|
|
152
|
-
for (const id of ids) {
|
|
153
|
-
const c = await this.concept(id);
|
|
154
|
-
if (c) concepts.push(c);
|
|
155
|
-
}
|
|
156
|
-
return concepts;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
// --- Compiled / machine formats (TBX, JSON-LD, Turtle, JSONL) ---
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* List compiled format directories present in this package.
|
|
163
|
-
* @returns {Promise<string[]>}
|
|
164
|
-
*/
|
|
165
|
-
async compiledFormats() {
|
|
166
|
-
const seen = new Set();
|
|
167
|
-
this._zip.forEach((relativePath, entry) => {
|
|
168
|
-
if (!entry.dir) {
|
|
169
|
-
const parsed = parseCompiledPath(relativePath);
|
|
170
|
-
if (parsed) seen.add(parsed.format);
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
return COMPILED_FORMATS.filter((f) => seen.has(f));
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* List entry IDs for a given compiled format.
|
|
178
|
-
* @param {string} format - e.g. 'tbx', 'jsonld', 'turtle', 'jsonl'
|
|
179
|
-
* @returns {Promise<string[]>}
|
|
180
|
-
*/
|
|
181
|
-
async compiledFormatIds(format) {
|
|
182
|
-
const prefix = `compiled/${format}/`;
|
|
183
|
-
const ids = [];
|
|
184
|
-
this._zip.forEach((relativePath, entry) => {
|
|
185
|
-
if (!entry.dir && relativePath.startsWith(prefix)) {
|
|
186
|
-
const parsed = parseCompiledPath(relativePath);
|
|
187
|
-
if (parsed && parsed.format === format) ids.push(parsed.id);
|
|
188
|
-
}
|
|
189
|
-
});
|
|
190
|
-
return ids.sort(naturalSort);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* Check whether a compiled format is present.
|
|
195
|
-
* @param {string} format
|
|
196
|
-
* @returns {Promise<boolean>}
|
|
197
|
-
*/
|
|
198
|
-
async hasCompiledFormat(format) {
|
|
199
|
-
const prefix = `compiled/${format}/`;
|
|
200
|
-
let found = false;
|
|
201
|
-
this._zip.forEach((relativePath, entry) => {
|
|
202
|
-
if (!found && !entry.dir && relativePath.startsWith(prefix)) {
|
|
203
|
-
found = true;
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
return found;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Read a single compiled-format file as a string.
|
|
211
|
-
* @param {string} format - e.g. 'jsonld'
|
|
212
|
-
* @param {string} id - concept ID or document name (e.g. '3.1.1.1', 'glossary')
|
|
213
|
-
* @returns {Promise<string | null>} null if the file doesn't exist
|
|
214
|
-
*/
|
|
215
|
-
async compiledFile(format, id) {
|
|
216
|
-
return this._readText(compiledPath(format, id));
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
/**
|
|
220
|
-
* Read a single compiled-format file as a Uint8Array (for binary content).
|
|
221
|
-
* @param {string} format
|
|
222
|
-
* @param {string} id
|
|
223
|
-
* @returns {Promise<Uint8Array | null>}
|
|
224
|
-
*/
|
|
225
|
-
async compiledFileBuffer(format, id) {
|
|
226
|
-
const entry = this._zip.file(compiledPath(format, id));
|
|
227
|
-
if (!entry) return null;
|
|
228
|
-
return entry.async('uint8array');
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* Iterate all entries for a compiled format.
|
|
233
|
-
* @param {string} format
|
|
234
|
-
* @param {(id: string, content: string) => void | Promise<void>} callback
|
|
235
|
-
* @returns {Promise<void>}
|
|
236
|
-
*/
|
|
237
|
-
async eachCompiledFile(format, callback) {
|
|
238
|
-
const ids = await this.compiledFormatIds(format);
|
|
239
|
-
for (const id of ids) {
|
|
240
|
-
const content = await this.compiledFile(format, id);
|
|
241
|
-
if (content !== null) await callback(id, content);
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* Load all entries for a compiled format into a Map (id → content).
|
|
247
|
-
* @param {string} format
|
|
248
|
-
* @returns {Promise<Map<string, string>>}
|
|
249
|
-
*/
|
|
250
|
-
async allCompiledFiles(format) {
|
|
251
|
-
const map = new Map();
|
|
252
|
-
await this.eachCompiledFile(format, (id, content) => { map.set(id, content); });
|
|
253
|
-
return map;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
// --- Dataset assets (bibliography, images, etc.) ---
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* List all dataset asset entries found in this package.
|
|
260
|
-
* Each entry has { path, type, asset } where asset is the registry descriptor.
|
|
261
|
-
* @returns {Promise<Array<{ path: string, type: 'file' | 'directory', asset: { path: string, type: string } }>>}
|
|
262
|
-
*/
|
|
263
|
-
async datasetAssetEntries() {
|
|
264
|
-
const entries = [];
|
|
265
|
-
this._zip.forEach((relativePath, zipEntry) => {
|
|
266
|
-
if (zipEntry.dir) return;
|
|
267
|
-
const fileAsset = findFileAsset(relativePath);
|
|
268
|
-
if (fileAsset) {
|
|
269
|
-
entries.push({ path: relativePath, type: 'file', asset: fileAsset });
|
|
270
|
-
return;
|
|
271
|
-
}
|
|
272
|
-
const dirAsset = findDirectoryAssetPath(relativePath);
|
|
273
|
-
if (dirAsset) {
|
|
274
|
-
entries.push({ path: relativePath, type: 'directory', asset: dirAsset });
|
|
275
|
-
}
|
|
276
|
-
});
|
|
277
|
-
return entries;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
/**
|
|
281
|
-
* Read a file-type dataset asset by its registered path (e.g. 'bibliography.yaml').
|
|
282
|
-
* @param {string} assetPath - registered file asset path
|
|
283
|
-
* @returns {Promise<string | null>}
|
|
284
|
-
*/
|
|
285
|
-
async readDatasetFileAsset(assetPath) {
|
|
286
|
-
return this._readText(assetPath);
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
* Read and parse bibliography.yaml from the package as a BibliographyData instance.
|
|
291
|
-
* @returns {Promise<BibliographyData | null>}
|
|
292
|
-
*/
|
|
293
|
-
async bibliography() {
|
|
294
|
-
const raw = await this._readText('bibliography.yaml');
|
|
295
|
-
if (raw === null) return null;
|
|
296
|
-
return BibliographyData.fromYAML(raw);
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
/**
|
|
300
|
-
* Check whether the images/ directory is present and non-empty.
|
|
301
|
-
* Uses the dataset-asset registry to find the images directory.
|
|
302
|
-
* @returns {Promise<boolean>}
|
|
303
|
-
*/
|
|
304
|
-
async hasImages() {
|
|
305
|
-
const asset = DATASET_ASSETS.find((a) => a.type === 'directory' && a.path === 'images');
|
|
306
|
-
if (!asset) return false;
|
|
307
|
-
const prefix = `${asset.path}/`;
|
|
308
|
-
let found = false;
|
|
309
|
-
this._zip.forEach((relativePath, entry) => {
|
|
310
|
-
if (!found && !entry.dir && relativePath.startsWith(prefix)) {
|
|
311
|
-
found = true;
|
|
312
|
-
}
|
|
313
|
-
});
|
|
314
|
-
return found;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
/**
|
|
318
|
-
* List all image file paths (relative to ZIP root).
|
|
319
|
-
* Uses the dataset-asset registry to find the images directory.
|
|
320
|
-
* @returns {Promise<string[]>}
|
|
321
|
-
*/
|
|
322
|
-
async imageFileNames() {
|
|
323
|
-
const asset = DATASET_ASSETS.find((a) => a.type === 'directory' && a.path === 'images');
|
|
324
|
-
if (!asset) return [];
|
|
325
|
-
const prefix = `${asset.path}/`;
|
|
326
|
-
const names = [];
|
|
327
|
-
this._zip.forEach((relativePath, entry) => {
|
|
328
|
-
if (!entry.dir && relativePath.startsWith(prefix)) {
|
|
329
|
-
names.push(relativePath);
|
|
330
|
-
}
|
|
331
|
-
});
|
|
332
|
-
return names.sort();
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
/**
|
|
336
|
-
* Read a single image file as a Uint8Array.
|
|
337
|
-
* @param {string} path - relative path starting with 'images/' or just the filename
|
|
338
|
-
* @returns {Promise<Uint8Array | null>}
|
|
339
|
-
*/
|
|
340
|
-
async imageFile(path) {
|
|
341
|
-
const asset = DATASET_ASSETS.find((a) => a.type === 'directory' && a.path === 'images');
|
|
342
|
-
if (!asset) return null;
|
|
343
|
-
const fullPath = path.startsWith(`${asset.path}/`) ? path : `${asset.path}/${path}`;
|
|
344
|
-
const entry = this._zip.file(fullPath);
|
|
345
|
-
if (!entry) return null;
|
|
346
|
-
return entry.async('uint8array');
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
/**
|
|
350
|
-
* Iterate all image files.
|
|
351
|
-
* @param {(path: string, content: Uint8Array) => void | Promise<void>} callback
|
|
352
|
-
* @returns {Promise<void>}
|
|
353
|
-
*/
|
|
354
|
-
async eachImageFile(callback) {
|
|
355
|
-
const names = await this.imageFileNames();
|
|
356
|
-
for (const name of names) {
|
|
357
|
-
const entry = this._zip.file(name);
|
|
358
|
-
if (entry) {
|
|
359
|
-
const content = await entry.async('uint8array');
|
|
360
|
-
await callback(name, content);
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
/**
|
|
366
|
-
* Load all image files into a Map (path → Uint8Array).
|
|
367
|
-
* @returns {Promise<Map<string, Uint8Array>>}
|
|
368
|
-
*/
|
|
369
|
-
async allImageFiles() {
|
|
370
|
-
const map = new Map();
|
|
371
|
-
await this.eachImageFile((path, content) => { map.set(path, content); });
|
|
372
|
-
return map;
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
/**
|
|
376
|
-
* Read a text file from the package.
|
|
377
|
-
* @param {string} filePath
|
|
378
|
-
* @returns {Promise<string | null>} null if the file doesn't exist
|
|
379
|
-
*/
|
|
380
|
-
async readText(filePath) {
|
|
381
|
-
const entry = this._zip.file(filePath);
|
|
382
|
-
if (!entry) return null;
|
|
383
|
-
return entry.async('text');
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
/**
|
|
387
|
-
* List all entry paths in the package.
|
|
388
|
-
* @returns {Array<{ path: string, dir: boolean }>}
|
|
389
|
-
*/
|
|
390
|
-
entryPaths() {
|
|
391
|
-
const entries = [];
|
|
392
|
-
this._zip.forEach((relativePath, entry) => {
|
|
393
|
-
entries.push({ path: relativePath, dir: !!entry.dir });
|
|
394
|
-
});
|
|
395
|
-
return entries;
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
/**
|
|
399
|
-
* Check whether a specific entry exists in the package.
|
|
400
|
-
* @param {string} filePath
|
|
401
|
-
* @returns {boolean}
|
|
402
|
-
*/
|
|
403
|
-
hasEntry(filePath) {
|
|
404
|
-
return this._zip.file(filePath) != null;
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
/** @private @deprecated Use readText instead */
|
|
408
|
-
async _readText(filePath) {
|
|
409
|
-
return this.readText(filePath);
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
// --- Non-verbal entity directories (figures/, tables/, formulas/) ---
|
|
413
|
-
|
|
414
|
-
async entityIds(type) {
|
|
415
|
-
const prefix = `${entityDir(type)}/`;
|
|
416
|
-
const ids = [];
|
|
417
|
-
this._zip.forEach((relativePath, entry) => {
|
|
418
|
-
if (!entry.dir && relativePath.startsWith(prefix) && relativePath.endsWith('.yaml')) {
|
|
419
|
-
ids.push(relativePath.slice(prefix.length, -'.yaml'.length));
|
|
420
|
-
}
|
|
421
|
-
});
|
|
422
|
-
return ids.sort(naturalSort);
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
async entity(type, id) {
|
|
426
|
-
const raw = await this.readText(entityPath(type, id));
|
|
427
|
-
if (raw === null) return null;
|
|
428
|
-
const yamlData = yaml.load(raw);
|
|
429
|
-
return NonVerbalEntity.fromData({ ...yamlData, type });
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
async eachEntity(type, callback) {
|
|
433
|
-
for (const id of await this.entityIds(type)) {
|
|
434
|
-
const entity = await this.entity(type, id);
|
|
435
|
-
if (entity) await callback(entity, id);
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
async allEntities(type) {
|
|
440
|
-
const entities = [];
|
|
441
|
-
await this.eachEntity(type, (e) => { entities.push(e); });
|
|
442
|
-
return entities;
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
async entityTypes() {
|
|
446
|
-
const seen = new Set();
|
|
447
|
-
this._zip.forEach((relativePath, entry) => {
|
|
448
|
-
if (!entry.dir) {
|
|
449
|
-
const parsed = parseEntityPath(relativePath);
|
|
450
|
-
if (parsed) seen.add(parsed.type);
|
|
451
|
-
}
|
|
452
|
-
});
|
|
453
|
-
return ENTITY_TYPES.filter((t) => seen.has(t));
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
// --- Concept YAML parsing ---
|
|
458
|
-
|
|
459
|
-
/**
|
|
460
|
-
* Parse concept YAML (canonical or managed format) into a normalized object.
|
|
461
|
-
*
|
|
462
|
-
* @param {string} raw - raw YAML string
|
|
463
|
-
* @param {string} [context] - concept ID or filename for error messages
|
|
464
|
-
* @returns {Concept}
|
|
465
|
-
* @throws {InvalidInputError} if raw is null, undefined, or empty
|
|
466
|
-
* @throws {YamlParseError} if the YAML content is malformed
|
|
467
|
-
*
|
|
468
|
-
* @example
|
|
469
|
-
* const concept = parseConceptYaml('termid: "001"\neng:\n terms:\n - designation: test', '001');
|
|
470
|
-
* console.log(concept.localization('eng').terms[0].designation); // "test"
|
|
471
|
-
*/
|
|
472
|
-
export function parseConceptYaml(raw, context) {
|
|
473
|
-
return conceptParser.parse(raw, context);
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
/**
|
|
477
|
-
* @typedef {Object} GcrMetadata
|
|
478
|
-
* @property {string} shortname - dataset short name
|
|
479
|
-
* @property {string} [version] - dataset version
|
|
480
|
-
* @property {string} [title] - dataset title
|
|
481
|
-
* @property {number} [concept_count] - number of concepts
|
|
482
|
-
* @property {string[]} [languages] - supported language codes
|
|
483
|
-
* @property {string} [schema_version] - schema version
|
|
484
|
-
* @property {string} [glossarist_version] - glossarist tool version
|
|
485
|
-
* @property {string} [created_at] - ISO 8601 creation timestamp
|
|
486
|
-
* @property {Record<string, unknown>} [statistics] - dataset statistics
|
|
487
|
-
*/
|
package/src/gcr-writer.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Concept, GcrMetadata } from './models/index';
|
|
2
|
-
|
|
3
|
-
/** Compiled formats map: format name → id → content string. */
|
|
4
|
-
export type CompiledFormatsMap = Record<string, Record<string, string> | Map<string, string>>;
|
|
5
|
-
|
|
6
|
-
/** Images map: relative path → binary content. */
|
|
7
|
-
export type ImagesMap = Record<string, Uint8Array | string | ArrayBuffer> | Map<string, Uint8Array | string | ArrayBuffer>;
|
|
8
|
-
|
|
9
|
-
export class GcrWriter {
|
|
10
|
-
static createBuffer(options: {
|
|
11
|
-
concepts: Concept[];
|
|
12
|
-
metadata?: GcrMetadata | Record<string, unknown>;
|
|
13
|
-
register?: Record<string, unknown>;
|
|
14
|
-
uuidFn?: () => string;
|
|
15
|
-
format?: 'canonical' | 'managed' | 'auto';
|
|
16
|
-
compiledFormats?: CompiledFormatsMap;
|
|
17
|
-
bibliography?: string;
|
|
18
|
-
images?: ImagesMap;
|
|
19
|
-
}): Promise<Uint8Array>;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function createGcr(concepts: Concept[], metadata?: Record<string, unknown>): Promise<Uint8Array>;
|