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
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
|
|
2
|
-
import { DATASET_ASSETS } from '../dataset-asset.js';
|
|
3
|
-
|
|
4
|
-
export class AssetIndex {
|
|
5
|
-
constructor() {
|
|
6
|
-
this._paths = new Set();
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
get paths() {
|
|
10
|
-
return [...this._paths].sort();
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
get size() {
|
|
14
|
-
return this._paths.size;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
register(path) {
|
|
18
|
-
if (path == null) return;
|
|
19
|
-
this._paths.add(this._normalize(path));
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
has(path) {
|
|
23
|
-
if (path == null) return false;
|
|
24
|
-
return this._paths.has(this._normalize(path));
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
[Symbol.iterator]() {
|
|
28
|
-
return this._paths[Symbol.iterator]();
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
_normalize(path) {
|
|
32
|
-
return String(path).replace(/^\//, '');
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
static async fromGcrPackage(pkg) {
|
|
36
|
-
const index = new AssetIndex();
|
|
37
|
-
const names = await pkg.imageFileNames();
|
|
38
|
-
for (const name of names) {
|
|
39
|
-
index.register(name);
|
|
40
|
-
}
|
|
41
|
-
return index;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
static fromDirectory(datasetPath, fs) {
|
|
45
|
-
const index = new AssetIndex();
|
|
46
|
-
const imagesAsset = DATASET_ASSETS.find(
|
|
47
|
-
a => a.type === 'directory' && a.path === 'images');
|
|
48
|
-
if (!imagesAsset) return index;
|
|
49
|
-
|
|
50
|
-
const imagesDir = `${datasetPath}/${imagesAsset.path}`;
|
|
51
|
-
_walkDir(fs, imagesDir, imagesAsset.path, index);
|
|
52
|
-
return index;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function _walkDir(fs, dirPath, relativePrefix, index) {
|
|
57
|
-
if (!fs.existsSync(dirPath)) return;
|
|
58
|
-
for (const entry of fs.readdirSync(dirPath, { withFileTypes: true })) {
|
|
59
|
-
const fullPath = `${dirPath}/${entry.name}`;
|
|
60
|
-
const relPath = `${relativePrefix}/${entry.name}`;
|
|
61
|
-
if (entry.isDirectory()) {
|
|
62
|
-
_walkDir(fs, fullPath, relPath, index);
|
|
63
|
-
} else {
|
|
64
|
-
index.register(relPath);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
// Warns when binary `has_part` / `is_part_of` edges duplicate
|
|
2
|
-
// PartitiveHyperedge members, or when a concept has many binary
|
|
3
|
-
// has_part edges that should be consolidated into a PartitiveHyperedge.
|
|
4
|
-
//
|
|
5
|
-
// Per TODO.partitive-relation-v2 item 14, binary edges and
|
|
6
|
-
// PartitiveRelations coexist by design. The asymmetry is pragmatic:
|
|
7
|
-
// binary edges are compact for single pairwise facts; relations
|
|
8
|
-
// carry completeness/plurality/criterion metadata. The redundancy
|
|
9
|
-
// case (same fact encoded both ways) is harmless data-wise but
|
|
10
|
-
// wasteful and should be flagged for migration.
|
|
11
|
-
//
|
|
12
|
-
// Severity: warning. Never blocks save.
|
|
13
|
-
|
|
14
|
-
import { ValidationRule } from './validation-rule.js';
|
|
15
|
-
import { refKey } from './ref-keys.js';
|
|
16
|
-
|
|
17
|
-
const BINARY_HAS_PART_TYPES = new Set(['has_part', 'is_part_of']);
|
|
18
|
-
|
|
19
|
-
export class BinaryHasPartRedundancyRule extends ValidationRule {
|
|
20
|
-
constructor() { super('binary-has-part-redundancy', 'warning'); }
|
|
21
|
-
|
|
22
|
-
validate(concept, path, result) {
|
|
23
|
-
const relations = concept.relations ?? [];
|
|
24
|
-
|
|
25
|
-
// Collect partitive refs from PartitiveRelations.
|
|
26
|
-
const relationTargets = new Set();
|
|
27
|
-
for (const rel of relations) {
|
|
28
|
-
const compKey = refKey(rel?.comprehensive);
|
|
29
|
-
const members = rel?.partitives ?? rel?.parts ?? [];
|
|
30
|
-
for (const member of members) {
|
|
31
|
-
const ref = member?.ref ?? member;
|
|
32
|
-
const key = refKey(ref);
|
|
33
|
-
if (key && key !== compKey) relationTargets.add(key);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// Collect binary has_part refs.
|
|
38
|
-
const binaryTargets = new Set();
|
|
39
|
-
const related = concept.relatedConcepts ?? [];
|
|
40
|
-
for (const rc of related) {
|
|
41
|
-
if (!BINARY_HAS_PART_TYPES.has(rc.type)) continue;
|
|
42
|
-
const key = refKey(rc?.ref);
|
|
43
|
-
if (key) binaryTargets.add(key);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// Redundancy: refs in both.
|
|
47
|
-
for (const target of relationTargets) {
|
|
48
|
-
if (binaryTargets.has(target)) {
|
|
49
|
-
this.addIssue(result,
|
|
50
|
-
`${path}relatedConcepts`,
|
|
51
|
-
`binary has_part edge for (${target}) is redundant — already in a ` +
|
|
52
|
-
`PartitiveHyperedge member; pick one encoding to avoid divergence`,
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// Cluster: 3+ binary has_part edges suggests PartitiveHyperedge territory.
|
|
58
|
-
if (binaryTargets.size >= 3) {
|
|
59
|
-
this.addIssue(result,
|
|
60
|
-
`${path}relatedConcepts`,
|
|
61
|
-
`${binaryTargets.size} binary has_part edges on this concept; ` +
|
|
62
|
-
`consider converting to a PartitiveHyperedge (which can carry ` +
|
|
63
|
-
`completeness, multiplicity, and criterion metadata)`,
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
|
|
2
|
-
// @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
|
|
3
|
-
import { ValidationRule } from './validation-rule.js';
|
|
4
|
-
import { ValidationResult } from './validation-result.js';
|
|
5
|
-
|
|
6
|
-
const VALID_DESIGNATION_TYPES = new Set([
|
|
7
|
-
'expression', 'abbreviation', 'symbol', 'graphical symbol', 'graphical_symbol',
|
|
8
|
-
]);
|
|
9
|
-
|
|
10
|
-
const VALID_ENTRY_STATUSES = new Set([
|
|
11
|
-
'valid', 'draft', 'retired', 'notValid', 'superseded', 'withdrawn',
|
|
12
|
-
]);
|
|
13
|
-
|
|
14
|
-
export class LanguageCodeRule extends ValidationRule {
|
|
15
|
-
constructor() { super('language-code'); }
|
|
16
|
-
validate(concept, path, result) {
|
|
17
|
-
for (const lang of concept.languages) {
|
|
18
|
-
if (!/^[a-z]{3}$/.test(lang)) {
|
|
19
|
-
this.addIssue(result,
|
|
20
|
-
`${path}localizations.${lang}`,
|
|
21
|
-
`Invalid language code '${lang}': expected ISO 639-3 (3 lowercase letters)`);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export class DesignationTypeRule extends ValidationRule {
|
|
28
|
-
constructor() { super('designation-type'); }
|
|
29
|
-
validate(concept, path, result) {
|
|
30
|
-
for (const lang of concept.languages) {
|
|
31
|
-
const lc = concept.localization(lang);
|
|
32
|
-
if (!lc) continue;
|
|
33
|
-
for (let i = 0; i < lc.terms.length; i++) {
|
|
34
|
-
const type = lc.terms[i].type;
|
|
35
|
-
if (type && !VALID_DESIGNATION_TYPES.has(type)) {
|
|
36
|
-
this.addIssue(result,
|
|
37
|
-
`${path}localizations.${lang}.terms[${i}].type`,
|
|
38
|
-
`Unknown designation type '${type}'`);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export class EntryStatusRule extends ValidationRule {
|
|
46
|
-
constructor() { super('entry-status'); }
|
|
47
|
-
validate(concept, path, result) {
|
|
48
|
-
for (const lang of concept.languages) {
|
|
49
|
-
const lc = concept.localization(lang);
|
|
50
|
-
if (!lc) continue;
|
|
51
|
-
if (lc.entryStatus && !VALID_ENTRY_STATUSES.has(lc.entryStatus)) {
|
|
52
|
-
this.addIssue(result,
|
|
53
|
-
`${path}localizations.${lang}.entry_status`,
|
|
54
|
-
`Unknown entry status '${lc.entryStatus}'`);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export class ConceptValidator {
|
|
61
|
-
_rules = [];
|
|
62
|
-
|
|
63
|
-
addRule(rule) {
|
|
64
|
-
this._rules.push(rule);
|
|
65
|
-
return this;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
validate(concept) {
|
|
69
|
-
const result = new ValidationResult();
|
|
70
|
-
|
|
71
|
-
if (!concept.id) {
|
|
72
|
-
result.addError('id', 'Concept must have an id');
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if (concept.languages.length === 0) {
|
|
76
|
-
result.addWarning('localizations', 'Concept must have at least one localization');
|
|
77
|
-
} else {
|
|
78
|
-
for (const lang of concept.languages) {
|
|
79
|
-
const lc = concept.localization(lang);
|
|
80
|
-
if (!lc || lc.terms.length === 0) {
|
|
81
|
-
result.addWarning(`localizations.${lang}.terms`,
|
|
82
|
-
`Localization '${lang}' must have at least one term`);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
for (const rule of this._rules) {
|
|
88
|
-
rule.validate(concept, '', result);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return result;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
// Validates delimiting coherence across a concept's PartitiveRelations
|
|
2
|
-
// per ISO 704:2022.
|
|
3
|
-
//
|
|
4
|
-
// ISO 704:2022 (§5.5.4.2.1, rake diagram semantics):
|
|
5
|
-
// "Whether a part is delimiting depends on the concept system, the
|
|
6
|
-
// coordinate concepts, the inheritance principle, and the criterion
|
|
7
|
-
// of subdivision used."
|
|
8
|
-
//
|
|
9
|
-
// This rule surfaces three categories of issues that the model
|
|
10
|
-
// constructor cannot catch (they're cross-relation, not per-instance):
|
|
11
|
-
//
|
|
12
|
-
// 1. WARNING: A PartitiveHyperedge where every partitive is
|
|
13
|
-
// is_delimiting=true overuses delimiting. Typically only some
|
|
14
|
-
// parts distinguish the comprehensive from coordinate concepts.
|
|
15
|
-
// 2. ERROR: Two PartitiveRelations on the same concept with the
|
|
16
|
-
// same criterion but different is_delimiting for the same
|
|
17
|
-
// partitive ref — inconsistent delimiting claim about the same
|
|
18
|
-
// part. ISO 704 requires delimiting claims about a given part to
|
|
19
|
-
// be consistent across decompositions sharing a criterion.
|
|
20
|
-
// 3. WARNING: A partitive marked is_delimiting=true on a relation
|
|
21
|
-
// with no criterion set. Delimiting is meaningful only relative
|
|
22
|
-
// to a subdivision criterion.
|
|
23
|
-
//
|
|
24
|
-
// Per TODO.partitive-relation-v3/06.
|
|
25
|
-
|
|
26
|
-
import { ValidationRule } from './validation-rule.js';
|
|
27
|
-
import { refKey, criterionKey } from './ref-keys.js';
|
|
28
|
-
|
|
29
|
-
export class DelimitingCoherenceRule extends ValidationRule {
|
|
30
|
-
constructor() { super('delimiting-coherence'); }
|
|
31
|
-
|
|
32
|
-
validate(concept, path, result) {
|
|
33
|
-
const relations = concept.relations ?? [];
|
|
34
|
-
if (relations.length === 0) return;
|
|
35
|
-
|
|
36
|
-
_checkOveruse(relations, path, result);
|
|
37
|
-
_checkInconsistentAcrossRelations(relations, path, result, this);
|
|
38
|
-
_checkDelimitingWithoutCriterion(relations, path, result);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function _checkOveruse(relations, path, result) {
|
|
43
|
-
for (let i = 0; i < relations.length; i++) {
|
|
44
|
-
const rel = relations[i];
|
|
45
|
-
const members = rel?.partitives ?? [];
|
|
46
|
-
if (members.length < 2) continue;
|
|
47
|
-
const delimitingCount = members.filter(m => m?.is_delimiting === true).length;
|
|
48
|
-
if (delimitingCount === members.length) {
|
|
49
|
-
result.addWarning(
|
|
50
|
-
`${path}partitiveRelations[${i}]`,
|
|
51
|
-
`every partitive is marked is_delimiting=true; typically only ` +
|
|
52
|
-
`some parts distinguish the comprehensive from coordinate concepts`,
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function _checkInconsistentAcrossRelations(relations, path, result, rule) {
|
|
59
|
-
const byCriterion = new Map();
|
|
60
|
-
for (let i = 0; i < relations.length; i++) {
|
|
61
|
-
const rel = relations[i];
|
|
62
|
-
const critKey = criterionKey(rel?.criterion);
|
|
63
|
-
if (critKey == null) continue;
|
|
64
|
-
if (!byCriterion.has(critKey)) byCriterion.set(critKey, []);
|
|
65
|
-
byCriterion.get(critKey).push({ rel, i });
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
for (const [, group] of byCriterion) {
|
|
69
|
-
const refDelimiting = new Map();
|
|
70
|
-
for (const { rel, i } of group) {
|
|
71
|
-
for (const m of rel?.partitives ?? []) {
|
|
72
|
-
const key = refKey(m?.ref);
|
|
73
|
-
if (key == null) continue;
|
|
74
|
-
const delimiting = m?.is_delimiting === true;
|
|
75
|
-
const existing = refDelimiting.get(key);
|
|
76
|
-
if (existing != null && existing.delimiting !== delimiting) {
|
|
77
|
-
rule.addIssue(result,
|
|
78
|
-
`${path}partitiveRelations[${i}].partitives`,
|
|
79
|
-
`inconsistent is_delimiting for ref (${key}) across ` +
|
|
80
|
-
`relations ${existing.relIdx} and ${i} with the same ` +
|
|
81
|
-
`criterion; ISO 704 requires delimiting claims about the ` +
|
|
82
|
-
`same part to be consistent`,
|
|
83
|
-
);
|
|
84
|
-
} else if (existing == null) {
|
|
85
|
-
refDelimiting.set(key, { delimiting, relIdx: i });
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function _checkDelimitingWithoutCriterion(relations, path, result) {
|
|
93
|
-
for (let i = 0; i < relations.length; i++) {
|
|
94
|
-
const rel = relations[i];
|
|
95
|
-
if (rel?.criterion) continue;
|
|
96
|
-
const anyDelimiting = (rel?.partitives ?? []).some(m => m?.is_delimiting === true);
|
|
97
|
-
if (anyDelimiting) {
|
|
98
|
-
result.addWarning(
|
|
99
|
-
`${path}partitiveRelations[${i}].criterion`,
|
|
100
|
-
`relation has is_delimiting=true on partitives but no criterion; ` +
|
|
101
|
-
`delimiting is meaningful only relative to a subdivision criterion`,
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
// Validates ExternalConcept shape (status: external).
|
|
2
|
-
//
|
|
3
|
-
// Per TODO.partitive-relation-v2 item 06, an ExternalConcept is a
|
|
4
|
-
// ManagedConcept with status: external. External concepts:
|
|
5
|
-
// - MUST have at least one designation (the name by which they're referenced)
|
|
6
|
-
// - MUST NOT have a definition (contradicts status: external)
|
|
7
|
-
// - MUST NOT have sources (we don't define them)
|
|
8
|
-
//
|
|
9
|
-
// Severity: error. An external concept with a definition or sources
|
|
10
|
-
// contradicts the semantic role of "external" and should be re-typed
|
|
11
|
-
// to a real concept status (valid, draft, etc.).
|
|
12
|
-
|
|
13
|
-
import { ValidationRule } from './validation-rule.js';
|
|
14
|
-
|
|
15
|
-
export class ExternalConceptShapeRule extends ValidationRule {
|
|
16
|
-
constructor() { super('external-concept-shape', 'error'); }
|
|
17
|
-
|
|
18
|
-
validate(concept, path, result) {
|
|
19
|
-
if (concept.status !== 'external') return;
|
|
20
|
-
|
|
21
|
-
// Every concept — even an external one — needs at least one
|
|
22
|
-
// designation (the name by which it is referenced).
|
|
23
|
-
let designationCount = 0;
|
|
24
|
-
for (const lang of concept.languages ?? []) {
|
|
25
|
-
const lc = concept.localization?.(lang);
|
|
26
|
-
if (!lc) continue;
|
|
27
|
-
designationCount += (lc.terms ?? []).length;
|
|
28
|
-
}
|
|
29
|
-
if (designationCount === 0) {
|
|
30
|
-
this.addIssue(result,
|
|
31
|
-
`${path}localizations.*.terms`,
|
|
32
|
-
'ExternalConcept has no designations; every concept (including external) ' +
|
|
33
|
-
'needs at least one designation (the name by which it is referenced)',
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// External concepts must NOT have a definition or sources.
|
|
38
|
-
for (const lang of concept.languages ?? []) {
|
|
39
|
-
const lc = concept.localization?.(lang);
|
|
40
|
-
if (!lc) continue;
|
|
41
|
-
|
|
42
|
-
if ((lc.definitions ?? []).length > 0) {
|
|
43
|
-
this.addIssue(result,
|
|
44
|
-
`${path}localizations.${lang}.definitions`,
|
|
45
|
-
`ExternalConcept has a definition in language '${lang}'; ` +
|
|
46
|
-
`external concepts are referenced but not defined here ` +
|
|
47
|
-
`(move the definition to the providing dataset and add a provided_by edge)`,
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if ((lc.sources ?? []).length > 0) {
|
|
52
|
-
this.addIssue(result,
|
|
53
|
-
`${path}localizations.${lang}.sources`,
|
|
54
|
-
`ExternalConcept has sources in language '${lang}'; ` +
|
|
55
|
-
`external concepts should not carry sources (sources belong on the providing concept)`,
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
|
|
2
|
-
import * as yaml from 'js-yaml';
|
|
3
|
-
import { DATASET_ASSETS } from '../dataset-asset.js';
|
|
4
|
-
import { ValidationResult } from './validation-result.js';
|
|
5
|
-
|
|
6
|
-
export class GcrValidator {
|
|
7
|
-
async validate(pkg) {
|
|
8
|
-
const result = new ValidationResult();
|
|
9
|
-
await this._validateMetadata(pkg, result);
|
|
10
|
-
await this._validateConcepts(pkg, result);
|
|
11
|
-
await this._validateAssets(pkg, result);
|
|
12
|
-
return result;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
async _validateMetadata(pkg, result) {
|
|
16
|
-
const raw = await pkg.readText('metadata.yaml');
|
|
17
|
-
if (!raw) {
|
|
18
|
-
result.addError('metadata.yaml is missing');
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
let meta;
|
|
23
|
-
try {
|
|
24
|
-
meta = yaml.load(raw);
|
|
25
|
-
} catch (e) {
|
|
26
|
-
result.addError(`metadata.yaml: invalid YAML: ${e.message}`);
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (!meta.shortname) result.addError('metadata.yaml missing shortname');
|
|
31
|
-
if (!meta.version) result.addError('metadata.yaml missing version');
|
|
32
|
-
if (meta.concept_count == null) result.addError('metadata.yaml missing concept_count');
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
async _validateConcepts(pkg, result) {
|
|
36
|
-
const ids = await pkg.conceptIds();
|
|
37
|
-
if (ids.length === 0) {
|
|
38
|
-
result.addError('No concept files found in concepts/');
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
async _validateAssets(pkg, result) {
|
|
43
|
-
for (const asset of DATASET_ASSETS) {
|
|
44
|
-
if (asset.type === 'file') {
|
|
45
|
-
await this._validateFileAsset(pkg, asset.path, result);
|
|
46
|
-
} else if (asset.type === 'directory') {
|
|
47
|
-
await this._validateDirectoryAsset(pkg, asset.path, result);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
async _validateFileAsset(pkg, path, result) {
|
|
53
|
-
const raw = await pkg.readText(path);
|
|
54
|
-
if (!raw) return;
|
|
55
|
-
try {
|
|
56
|
-
yaml.load(raw);
|
|
57
|
-
} catch (e) {
|
|
58
|
-
result.addError(`${path}: invalid YAML at line ${e.mark?.line ?? '?'}: ${e.message}`);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
_validateDirectoryAsset(pkg, dirPath, result) {
|
|
63
|
-
let hasFiles = false;
|
|
64
|
-
let hasEntries = false;
|
|
65
|
-
for (const entry of pkg.entryPaths()) {
|
|
66
|
-
if (entry.path.startsWith(`${dirPath}/`)) {
|
|
67
|
-
hasEntries = true;
|
|
68
|
-
if (!entry.dir) hasFiles = true;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
if (hasEntries && !hasFiles) {
|
|
72
|
-
result.addWarning(`${dirPath}/ directory exists but is empty`);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
// Validates hyperedge coherence per ISO 704 / ISO 12620.
|
|
2
|
-
//
|
|
3
|
-
// Applies to every AbstractHyperedge subclass (PartitiveHyperedge,
|
|
4
|
-
// GenericHyperedge, future TemporalHyperedge / AssociativeHyperedge /
|
|
5
|
-
// SequentialHyperedge). The ISO 704 / ISO 12620 invariants are
|
|
6
|
-
// type-blind:
|
|
7
|
-
//
|
|
8
|
-
// 1. ERROR: each hyperedge has ≥2 members (ISO 704 "two or more")
|
|
9
|
-
// 2. ERROR: no two hyperedges of the same type on the same concept
|
|
10
|
-
// share the same comprehensive + same criterion (duplicate
|
|
11
|
-
// decomposition — violates ISO 12620 coordinate-concept coherence)
|
|
12
|
-
// 3. WARNING: a concept with multiple hyperedges of the same type
|
|
13
|
-
// where any lacks criterion (cannot verify distinctness from
|
|
14
|
-
// siblings)
|
|
15
|
-
//
|
|
16
|
-
// Lives in the validator framework, not the model constructor, per
|
|
17
|
-
// invariant I8 (TODO.hyperedges-v2/00). Constructors enforce type-shape;
|
|
18
|
-
// validators enforce semantics.
|
|
19
|
-
//
|
|
20
|
-
// Per TODO Phase 7: rule renamed from PartitiveRelationCoherenceRule
|
|
21
|
-
// to HyperedgeCoherenceRule. The rule applies to all hyperedges; the
|
|
22
|
-
// duplicate check is scoped per type so a Partitive and a Generic with
|
|
23
|
-
// the same comprehensive+criterion don't false-positive.
|
|
24
|
-
|
|
25
|
-
import { ValidationRule } from './validation-rule.js';
|
|
26
|
-
import { refKey, criterionKey } from './ref-keys.js';
|
|
27
|
-
import { AbstractHyperedge } from '../models/abstract-hyperedge.js';
|
|
28
|
-
|
|
29
|
-
export class HyperedgeCoherenceRule extends ValidationRule {
|
|
30
|
-
constructor() { super('hyperedge-coherence'); }
|
|
31
|
-
|
|
32
|
-
validate(concept, path, result) {
|
|
33
|
-
const hyperedges = (concept.relations ?? []).filter(r => r instanceof AbstractHyperedge);
|
|
34
|
-
if (hyperedges.length === 0) return;
|
|
35
|
-
|
|
36
|
-
// Check 1: ≥2 members per hyperedge. (The constructor also
|
|
37
|
-
// rejects this, but a warning here surfaces it in the result
|
|
38
|
-
// bundle for CI visibility.)
|
|
39
|
-
for (let i = 0; i < hyperedges.length; i++) {
|
|
40
|
-
const memberCount = (hyperedges[i]?.members ?? []).length;
|
|
41
|
-
if (memberCount < 2) {
|
|
42
|
-
this.addIssue(result,
|
|
43
|
-
`${path}relations[${i}].members`,
|
|
44
|
-
`hyperedge ${i + 1} has ${memberCount} member(s); ` +
|
|
45
|
-
`ISO 704 requires ≥2 (use a binary edge for pairwise facts)`,
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// Check 2: no duplicate (type + comprehensive + criterion) on the same concept.
|
|
51
|
-
// Scope by type so a Partitive and a Generic with the same comp+criterion
|
|
52
|
-
// don't false-positive — they're different decompositions.
|
|
53
|
-
const seen = new Map();
|
|
54
|
-
for (let i = 0; i < hyperedges.length; i++) {
|
|
55
|
-
const rel = hyperedges[i];
|
|
56
|
-
const typeTag = rel?.constructor?.typeTag ?? '';
|
|
57
|
-
const compKey = refKey(rel?.comprehensive);
|
|
58
|
-
const critKey = criterionKey(rel?.criterion);
|
|
59
|
-
if (compKey == null || critKey == null) continue;
|
|
60
|
-
const key = `${typeTag}|${compKey}|${critKey}`;
|
|
61
|
-
if (seen.has(key)) {
|
|
62
|
-
this.addIssue(result,
|
|
63
|
-
`${path}relations[${i}]`,
|
|
64
|
-
`duplicate ${rel.constructor.name} (same comprehensive + same criterion ` +
|
|
65
|
-
`as relation ${seen.get(key) + 1}); violates ISO 12620 coordinate-concept coherence`,
|
|
66
|
-
);
|
|
67
|
-
} else {
|
|
68
|
-
seen.set(key, i);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// Check 3: criterion documentation (warning) when concept has multiple
|
|
73
|
-
// hyperedges of the same type. Same-type-scope rationale as Check 2.
|
|
74
|
-
const byType = new Map();
|
|
75
|
-
for (const rel of hyperedges) {
|
|
76
|
-
const typeTag = rel?.constructor?.typeTag ?? '';
|
|
77
|
-
if (!byType.has(typeTag)) byType.set(typeTag, []);
|
|
78
|
-
byType.get(typeTag).push(rel);
|
|
79
|
-
}
|
|
80
|
-
for (const [typeTag, rels] of byType) {
|
|
81
|
-
if (rels.length <= 1) continue;
|
|
82
|
-
for (const rel of rels) {
|
|
83
|
-
if (!rel.criterion) {
|
|
84
|
-
const idx = hyperedges.indexOf(rel);
|
|
85
|
-
result.addWarning(
|
|
86
|
-
`${path}relations[${idx}].criterion`,
|
|
87
|
-
`concept has multiple ${typeTag} hyperedges but this one ` +
|
|
88
|
-
`has no criterion; cannot verify distinctness from siblings`,
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// Backward-compat alias. Existing imports of PartitiveRelationCoherenceRule
|
|
97
|
-
// continue to work; the rule is now type-blind.
|
|
98
|
-
export const PartitiveRelationCoherenceRule = HyperedgeCoherenceRule;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
export class ValidationError {
|
|
2
|
-
readonly path: string;
|
|
3
|
-
readonly message: string;
|
|
4
|
-
readonly severity: 'error' | 'warning';
|
|
5
|
-
toString(): string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export class ValidationRule {
|
|
9
|
-
readonly name: string;
|
|
10
|
-
readonly severity: 'error' | 'warning';
|
|
11
|
-
validate(value: any, path: string): ValidationError[];
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export class ConceptValidator {
|
|
15
|
-
addRule(rule: ValidationRule): this;
|
|
16
|
-
validate(concept: any): {
|
|
17
|
-
valid: boolean;
|
|
18
|
-
errors: ValidationError[];
|
|
19
|
-
warnings: ValidationError[];
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export class RegisterValidator {
|
|
24
|
-
validate(register: any): {
|
|
25
|
-
valid: boolean;
|
|
26
|
-
errors: ValidationError[];
|
|
27
|
-
warnings: ValidationError[];
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function validateConcept(concept: any): {
|
|
32
|
-
valid: boolean;
|
|
33
|
-
errors: ValidationError[];
|
|
34
|
-
warnings: ValidationError[];
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export function validateRegister(register: any): {
|
|
38
|
-
valid: boolean;
|
|
39
|
-
errors: ValidationError[];
|
|
40
|
-
warnings: ValidationError[];
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export function createConceptValidator(): ConceptValidator;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
// Shared identity-key helpers for cross-relation validators.
|
|
2
|
-
//
|
|
3
|
-
// Extracted from HyperedgeCoherenceRule and
|
|
4
|
-
// BinaryHasPartRedundancyRule.
|
|
5
|
-
// Eliminates drift: both rules now use the same notion of "same ref"
|
|
6
|
-
// and "same criterion" instead of each defining its own _refKey and
|
|
7
|
-
// _criterionKey with subtly different behaviors.
|
|
8
|
-
|
|
9
|
-
export function refKey(ref) {
|
|
10
|
-
if (!ref) return null;
|
|
11
|
-
const source = ref.source ?? '';
|
|
12
|
-
const id = ref.id ?? '';
|
|
13
|
-
if (!source && !id) return null;
|
|
14
|
-
return `${source}:${id}`;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// Hashable key for a criterion (lang-keyed hash). Returns null when
|
|
18
|
-
// no criterion is set OR when the criterion contains no string values.
|
|
19
|
-
// Values are sorted so two criteria with the same strings in different
|
|
20
|
-
// language-key order produce the same key (ISO 12620 coordinate-
|
|
21
|
-
// concept coherence cares about the criterion's content, not the
|
|
22
|
-
// language label order).
|
|
23
|
-
export function criterionKey(criterion) {
|
|
24
|
-
if (!criterion || typeof criterion !== 'object') return null;
|
|
25
|
-
const values = Object.values(criterion)
|
|
26
|
-
.filter(v => typeof v === 'string')
|
|
27
|
-
.map(s => s.trim())
|
|
28
|
-
.filter(s => s.length > 0)
|
|
29
|
-
.sort();
|
|
30
|
-
return values.length > 0 ? values.join('|') : null;
|
|
31
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ValidationResult } from './validation-result.js';
|
|
2
|
-
|
|
3
|
-
export class RegisterValidator {
|
|
4
|
-
validate(register) {
|
|
5
|
-
const result = new ValidationResult();
|
|
6
|
-
if (!register || typeof register !== 'object') {
|
|
7
|
-
result.addError('', 'Register must be a non-null object');
|
|
8
|
-
return result;
|
|
9
|
-
}
|
|
10
|
-
if (!register.schema_version) {
|
|
11
|
-
result.addWarning('schema_version', 'Register must have a schema_version');
|
|
12
|
-
}
|
|
13
|
-
if (!register.shortname) {
|
|
14
|
-
result.addWarning('shortname', 'Register should have a shortname');
|
|
15
|
-
}
|
|
16
|
-
return result;
|
|
17
|
-
}
|
|
18
|
-
}
|