glossarist 0.4.50 → 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 -57
- package/dist/rdf/shacl.js.map +1 -0
- package/dist/rdf/terms.d.ts +10 -0
- package/dist/rdf/terms.d.ts.map +1 -0
- package/{src/rdf/terms.ts → dist/rdf/terms.js} +6 -3
- package/dist/rdf/terms.js.map +1 -0
- package/dist/rdf/version-emitter.d.ts +57 -0
- package/dist/rdf/version-emitter.d.ts.map +1 -0
- package/dist/rdf/version-emitter.js +68 -0
- package/dist/rdf/version-emitter.js.map +1 -0
- package/dist/rdf/vocabulary-emitter.d.ts +32 -0
- package/dist/rdf/vocabulary-emitter.d.ts.map +1 -0
- package/dist/rdf/vocabulary-emitter.js +46 -0
- package/dist/rdf/vocabulary-emitter.js.map +1 -0
- package/dist/rdf/write-turtle-sync.d.ts +7 -0
- package/dist/rdf/write-turtle-sync.d.ts.map +1 -0
- package/dist/rdf/write-turtle-sync.js +130 -0
- package/dist/rdf/write-turtle-sync.js.map +1 -0
- package/dist/reference-mention.d.ts +49 -0
- package/dist/reference-mention.d.ts.map +1 -0
- package/dist/reference-mention.js +98 -0
- package/dist/reference-mention.js.map +1 -0
- package/dist/reference-resolver.d.ts +52 -0
- package/dist/reference-resolver.d.ts.map +1 -0
- package/dist/reference-resolver.js +311 -0
- package/dist/reference-resolver.js.map +1 -0
- package/dist/render-classification.d.ts +19 -0
- package/dist/render-classification.d.ts.map +1 -0
- package/dist/render-classification.js +82 -0
- package/dist/render-classification.js.map +1 -0
- package/dist/sort.d.ts +5 -0
- package/dist/sort.d.ts.map +1 -0
- package/dist/sort.js +25 -0
- package/dist/sort.js.map +1 -0
- package/dist/transforms/concept-to-gloss.transform.d.ts +32 -0
- package/dist/transforms/concept-to-gloss.transform.d.ts.map +1 -0
- package/dist/transforms/concept-to-gloss.transform.js +60 -0
- package/dist/transforms/concept-to-gloss.transform.js.map +1 -0
- package/dist/transforms/index.d.ts +2 -0
- package/dist/transforms/index.d.ts.map +1 -0
- package/{src/transforms/index.ts → dist/transforms/index.js} +1 -0
- package/dist/transforms/index.js.map +1 -0
- package/dist/utils/assertions.d.ts +4 -0
- package/dist/utils/assertions.d.ts.map +1 -0
- package/dist/utils/assertions.js +17 -0
- package/dist/utils/assertions.js.map +1 -0
- package/dist/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 -172
- package/src/concept-parser.ts +0 -235
- package/src/concept-reader.d.ts +0 -13
- package/src/concept-serializer.ts +0 -110
- package/src/concept-writer.d.ts +0 -7
- package/src/concept-writer.ts +0 -47
- package/src/diff/canonical-json.ts +0 -29
- package/src/diff/change.ts +0 -175
- package/src/diff/collection-diff.ts +0 -245
- package/src/diff/concept-diff.ts +0 -853
- package/src/diff/diff-patch.ts +0 -276
- package/src/diff/diff-renderer.ts +0 -348
- package/src/diff/identity.ts +0 -33
- package/src/diff/index.d.ts +0 -242
- package/src/diff/index.ts +0 -50
- package/src/diff/list-diff.ts +0 -231
- package/src/diff/similarity.ts +0 -20
- package/src/diff/text-diff.ts +0 -167
- package/src/entity-directory.ts +0 -43
- package/src/errors.d.ts +0 -11
- package/src/errors.ts +0 -24
- package/src/gcr-reader.d.ts +0 -65
- package/src/gcr-reader.ts +0 -512
- package/src/gcr-writer.d.ts +0 -22
- package/src/gcr-writer.ts +0 -99
- package/src/index.d.ts +0 -124
- package/src/managed-concept-collection.ts +0 -130
- package/src/migration/hyperedge-migrator.ts +0 -104
- package/src/models/abstract-hyperedge.ts +0 -164
- package/src/models/base.ts +0 -110
- package/src/models/bibliography-data.ts +0 -64
- package/src/models/bibliography-entry.ts +0 -40
- package/src/models/citation.ts +0 -98
- package/src/models/concept-date.ts +0 -48
- package/src/models/concept-ref.ts +0 -64
- package/src/models/concept-reference.ts +0 -50
- package/src/models/concept-source.ts +0 -96
- package/src/models/concept-system-type.ts +0 -39
- package/src/models/concept-system.ts +0 -152
- package/src/models/concept.ts +0 -499
- package/src/models/dataset-color.ts +0 -88
- package/src/models/designation-relationship.ts +0 -39
- package/src/models/designation.ts +0 -297
- package/src/models/detailed-definition.ts +0 -92
- package/src/models/enum.ts +0 -60
- package/src/models/equivalence-degree.ts +0 -34
- package/src/models/figure.ts +0 -110
- package/src/models/formula.ts +0 -36
- package/src/models/gcr-metadata.ts +0 -118
- package/src/models/gcr-statistics.ts +0 -76
- package/src/models/generic-hyperedge.ts +0 -72
- package/src/models/generic-member.ts +0 -80
- package/src/models/grammar-info.ts +0 -78
- package/src/models/hyperedge-colors.ts +0 -87
- package/src/models/hyperedge-index.ts +0 -101
- package/src/models/hyperedge-member.ts +0 -121
- package/src/models/hyperedge-registry.ts +0 -145
- package/src/models/index.d.ts +0 -586
- package/src/models/locality.ts +0 -34
- package/src/models/localized-concept.ts +0 -284
- package/src/models/localized-string.ts +0 -32
- package/src/models/multiplicity.ts +0 -134
- package/src/models/non-verb-rep.ts +0 -48
- package/src/models/non-verbal-entity.ts +0 -65
- package/src/models/non-verbal-reference.ts +0 -73
- package/src/models/non-verbal-references.ts +0 -29
- package/src/models/partitive-enumeration.ts +0 -27
- package/src/models/partitive-hyperedge.ts +0 -90
- package/src/models/partitive-member.ts +0 -56
- package/src/models/plurality-marker.ts +0 -31
- package/src/models/pronunciation.ts +0 -40
- package/src/models/register.ts +0 -315
- package/src/models/registrable.ts +0 -48
- package/src/models/related-concept.ts +0 -117
- package/src/models/relation-categories.ts +0 -167
- package/src/models/relation-colors.ts +0 -90
- package/src/models/relation-loader.ts +0 -115
- package/src/models/section.ts +0 -61
- package/src/models/sequential-hyperedge.ts +0 -70
- package/src/models/shared-non-verbal-entity.ts +0 -36
- package/src/models/table.ts +0 -36
- package/src/rdf/agents-emitter.ts +0 -137
- package/src/rdf/bibliography-emitter.ts +0 -126
- package/src/rdf/bnode-id.ts +0 -55
- package/src/rdf/build-activity-emitter.ts +0 -129
- package/src/rdf/curie.ts +0 -46
- package/src/rdf/dataset-emitter.ts +0 -170
- package/src/rdf/deterministic-id.ts +0 -69
- package/src/rdf/document-writer.ts +0 -87
- package/src/rdf/gloss-concept.ts +0 -115
- package/src/rdf/gloss-designation.ts +0 -72
- package/src/rdf/gloss-detailed-definition.ts +0 -69
- package/src/rdf/gloss-localized-concept.ts +0 -79
- package/src/rdf/gloss-non-verbal-rep.ts +0 -202
- package/src/rdf/gloss-partitive-relation.ts +0 -89
- package/src/rdf/gloss-source.ts +0 -56
- package/src/rdf/group-emitter.ts +0 -133
- package/src/rdf/image-variant-emitter.ts +0 -80
- package/src/rdf/index.d.ts +0 -371
- package/src/rdf/predicates.d.ts +0 -527
- package/src/rdf/predicates.ts +0 -287
- package/src/rdf/provenance-emitter.ts +0 -87
- package/src/rdf/sections-builder.ts +0 -190
- package/src/rdf/shacl-entry.d.ts +0 -6
- package/src/rdf/version-emitter.ts +0 -97
- package/src/rdf/vocabulary-emitter.ts +0 -67
- package/src/rdf/write-turtle-sync.ts +0 -179
- package/src/reference-mention.ts +0 -114
- package/src/reference-resolver.ts +0 -361
- package/src/render-classification.ts +0 -85
- package/src/sort.ts +0 -22
- package/src/transforms/concept-to-gloss.transform.ts +0 -81
- package/src/transforms/index.d.ts +0 -26
- package/src/uuid.ts +0 -32
- package/src/v1-reader.ts +0 -66
- package/src/validators/asset-index.ts +0 -72
- package/src/validators/binary-has-part-redundancy-rule.ts +0 -67
- package/src/validators/concept-validator.ts +0 -93
- package/src/validators/delimiting-coherence-rule.ts +0 -105
- package/src/validators/external-concept-shape-rule.ts +0 -60
- package/src/validators/gcr-validator.ts +0 -76
- package/src/validators/hyperedge-coherence-rule.ts +0 -98
- package/src/validators/index.d.ts +0 -43
- package/src/validators/ref-keys.ts +0 -31
- package/src/validators/register-validator.ts +0 -18
- package/src/validators/relationship-type-rule.ts +0 -39
- package/src/validators/sourced-from-locality-rule.ts +0 -53
- package/src/validators/v3-rules.ts +0 -382
- package/src/validators/validation-error.ts +0 -19
- package/src/validators/validation-result.ts +0 -52
- package/src/validators/validation-rule.ts +0 -21
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
// Agents emitter — emits foaf:Person / prov:Organization from
|
|
2
|
-
// contributor declarations. Mirrors concept-browser's agents-emitter.ts.
|
|
3
|
-
//
|
|
4
|
-
// Each contributor becomes a foaf:Person + prov:Person + prov:Agent
|
|
5
|
-
// with foaf:name, optional foaf:mbox (mailto link), rdfs:seeAlso (url).
|
|
6
|
-
// Their organization (when provided) becomes a foaf:Organization +
|
|
7
|
-
// prov:Organization, and the person is linked via prov:actedOnBehalfOf.
|
|
8
|
-
|
|
9
|
-
import { namedNode, literal, quad } from './terms.js';
|
|
10
|
-
import { PREFIXES } from './prefixes.js';
|
|
11
|
-
import { RDF_TYPE } from './curie.js';
|
|
12
|
-
|
|
13
|
-
const PROV_NS = PREFIXES.prov;
|
|
14
|
-
const FOAF_NS = PREFIXES.foaf ?? 'http://xmlns.com/foaf/0.1/';
|
|
15
|
-
const DCTERMS_NS = PREFIXES.dcterms;
|
|
16
|
-
const RDFS_NS = PREFIXES.rdfs;
|
|
17
|
-
|
|
18
|
-
const PROV = {
|
|
19
|
-
Person: `${PROV_NS}Person`,
|
|
20
|
-
Organization: `${PROV_NS}Organization`,
|
|
21
|
-
Agent: `${PROV_NS}Agent`,
|
|
22
|
-
actedOnBehalfOf: `${PROV_NS}actedOnBehalfOf`,
|
|
23
|
-
};
|
|
24
|
-
const FOAF = {
|
|
25
|
-
Person: `${FOAF_NS}Person`,
|
|
26
|
-
Organization: `${FOAF_NS}Organization`,
|
|
27
|
-
name: `${FOAF_NS}name`,
|
|
28
|
-
mbox: `${FOAF_NS}mbox`,
|
|
29
|
-
};
|
|
30
|
-
const DCTERMS = {
|
|
31
|
-
description: `${DCTERMS_NS}description`,
|
|
32
|
-
};
|
|
33
|
-
const RDFS = {
|
|
34
|
-
seeAlso: `${RDFS_NS}seeAlso`,
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
// No hardcoded default agent/org base URIs. Callers MUST pass agentBase
|
|
38
|
-
// explicitly so agent IRIs reflect the consumer's domain.
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* @typedef {Object} Contributor
|
|
42
|
-
* @property {string} name
|
|
43
|
-
* @property {string} [role]
|
|
44
|
-
* @property {string} [organization]
|
|
45
|
-
* @property {string} [url]
|
|
46
|
-
* @property {string} [email]
|
|
47
|
-
*/
|
|
48
|
-
/**
|
|
49
|
-
* @typedef {Contributor & { slug: string, agentIri: string }} AgentInput
|
|
50
|
-
*/
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Slugify a name for IRIs. Lowercase, ASCII, hyphenated.
|
|
54
|
-
*/
|
|
55
|
-
export function slugify(input) {
|
|
56
|
-
return String(input)
|
|
57
|
-
.toLowerCase()
|
|
58
|
-
.normalize('NFKD')
|
|
59
|
-
.replace(/[̀-ͯ]/g, '')
|
|
60
|
-
.replace(/[^a-z0-9]+/g, '-')
|
|
61
|
-
.replace(/^-+|-+$/g, '');
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Builds AgentInput records from raw contributor declarations.
|
|
66
|
-
* Useful for callers that want to inspect the IRIs before emission.
|
|
67
|
-
*/
|
|
68
|
-
export function agentsFromContributors(contributors, agentBase) {
|
|
69
|
-
if (!agentBase) throw new Error('agentsFromContributors requires agentBase — the deployment canonical URI root for agents (e.g. https://www.example.org/agent). glossarist-js does NOT default to glossarist.org.');
|
|
70
|
-
return (contributors ?? []).map(c => {
|
|
71
|
-
const slug = slugify(c.name);
|
|
72
|
-
return {
|
|
73
|
-
slug,
|
|
74
|
-
name: c.name,
|
|
75
|
-
role: c.role,
|
|
76
|
-
organization: c.organization,
|
|
77
|
-
url: c.url,
|
|
78
|
-
email: c.email,
|
|
79
|
-
agentIri: `${agentBase}/${slug}`,
|
|
80
|
-
};
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Emits foaf:Person + prov:Organization quads for a list of agents.
|
|
86
|
-
*
|
|
87
|
-
* Returns a generator of quads AND the set of unique person and
|
|
88
|
-
* organization IRIs emitted. Organizations are deduplicated — the
|
|
89
|
-
* same org across multiple contributors is emitted once.
|
|
90
|
-
*
|
|
91
|
-
* @param {readonly AgentInput[]} agents
|
|
92
|
-
* @param {Object} [options]
|
|
93
|
-
* @param {string} [options.orgBase] — default https://glossarist.org/org
|
|
94
|
-
* @returns {Generator<Quad, void, unknown>}
|
|
95
|
-
*/
|
|
96
|
-
export function* agentsToQuads(agents: Record<string, unknown>[], options: Record<string, unknown> = {}) {
|
|
97
|
-
const orgBase = options.orgBase;
|
|
98
|
-
if (!orgBase) throw new Error('agentsToQuads requires options.orgBase — the deployment canonical URI root for organizations.');
|
|
99
|
-
const emittedOrgs = new Set();
|
|
100
|
-
|
|
101
|
-
for (const a of agents ?? []) {
|
|
102
|
-
// @ts-expect-error TODO(Phase 2e): type this fully
|
|
103
|
-
const person = namedNode(a.agentIri);
|
|
104
|
-
yield quad(person, namedNode(RDF_TYPE), namedNode(FOAF.Person));
|
|
105
|
-
yield quad(person, namedNode(RDF_TYPE), namedNode(PROV.Person));
|
|
106
|
-
yield quad(person, namedNode(RDF_TYPE), namedNode(PROV.Agent));
|
|
107
|
-
yield quad(person, namedNode(FOAF.name), literal((a as Record<string, unknown>).name as string));
|
|
108
|
-
|
|
109
|
-
if ((a as Record<string, unknown>).email as string) {
|
|
110
|
-
yield quad(person, namedNode(FOAF.mbox), namedNode(`mailto:${(a as Record<string, unknown>).email as string}`));
|
|
111
|
-
}
|
|
112
|
-
if (a.url) {
|
|
113
|
-
// @ts-expect-error TODO(Phase 2e): type this fully
|
|
114
|
-
yield quad(person, namedNode(RDFS.seeAlso), namedNode(a.url));
|
|
115
|
-
}
|
|
116
|
-
if (a.role) {
|
|
117
|
-
// @ts-expect-error TODO(Phase 2e): type this fully
|
|
118
|
-
yield quad(person, namedNode(DCTERMS.description), literal(a.role));
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
if (a.organization) {
|
|
122
|
-
const orgSlug = slugify(a.organization);
|
|
123
|
-
const orgIri = `${orgBase}/${orgSlug}`;
|
|
124
|
-
yield quad(person, namedNode(PROV.actedOnBehalfOf), namedNode(orgIri));
|
|
125
|
-
|
|
126
|
-
if (!emittedOrgs.has(orgIri)) {
|
|
127
|
-
emittedOrgs.add(orgIri);
|
|
128
|
-
const org = namedNode(orgIri);
|
|
129
|
-
yield quad(org, namedNode(RDF_TYPE), namedNode(FOAF.Organization));
|
|
130
|
-
yield quad(org, namedNode(RDF_TYPE), namedNode(PROV.Organization));
|
|
131
|
-
yield quad(org, namedNode(RDF_TYPE), namedNode(PROV.Agent));
|
|
132
|
-
// @ts-expect-error TODO(Phase 2e): type this fully
|
|
133
|
-
yield quad(org, namedNode(FOAF.name), literal(a.organization));
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
// Bibliography emitter — emits dcterms:BibliographicResource per
|
|
2
|
-
// bibliography entry. Mirrors concept-browser's bibliography-emitter.ts.
|
|
3
|
-
//
|
|
4
|
-
// Each entry becomes a typed resource with:
|
|
5
|
-
// - dcterms:identifier (the entry id)
|
|
6
|
-
// - dcterms:bibliographicCitation (the reference string)
|
|
7
|
-
// - dcterms:title (optional)
|
|
8
|
-
// - foaf:page (optional link)
|
|
9
|
-
// - dcterms:type (optional, value URIs from gloss:bibtype/*)
|
|
10
|
-
// - dcterms:isPartOf (parent dataset)
|
|
11
|
-
|
|
12
|
-
import { namedNode, literal, quad } from './terms.js';
|
|
13
|
-
import { PREFIXES } from './prefixes.js';
|
|
14
|
-
import { RDF_TYPE } from './curie.js';
|
|
15
|
-
|
|
16
|
-
// Namespace IRIs from canonical PREFIXES. foaf is absent from the
|
|
17
|
-
// JSON-LD context (therefore not in PREFIXES) — declare locally.
|
|
18
|
-
const DCTERMS_NS = PREFIXES.dcterms;
|
|
19
|
-
const FOAF_NS = PREFIXES.foaf ?? 'http://xmlns.com/foaf/0.1/';
|
|
20
|
-
const GLOSS_NS = PREFIXES.gloss;
|
|
21
|
-
|
|
22
|
-
const DCTERMS = {
|
|
23
|
-
BibliographicResource: `${DCTERMS_NS}BibliographicResource`,
|
|
24
|
-
identifier: `${DCTERMS_NS}identifier`,
|
|
25
|
-
bibliographicCitation: `${DCTERMS_NS}bibliographicCitation`,
|
|
26
|
-
title: `${DCTERMS_NS}title`,
|
|
27
|
-
type: `${DCTERMS_NS}type`,
|
|
28
|
-
isPartOf: `${DCTERMS_NS}isPartOf`,
|
|
29
|
-
};
|
|
30
|
-
const FOAF = {
|
|
31
|
-
page: `${FOAF_NS}page`,
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
// No hardcoded default base URI. Callers MUST pass baseUri explicitly
|
|
35
|
-
// so instance IRIs reflect the consumer's domain, not the library's.
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* @typedef {Object} BibliographyEntry
|
|
39
|
-
* @property {string} id
|
|
40
|
-
* @property {string} reference
|
|
41
|
-
* @property {string} [title]
|
|
42
|
-
* @property {string} [link]
|
|
43
|
-
* @property {string} [type]
|
|
44
|
-
*/
|
|
45
|
-
/**
|
|
46
|
-
* @typedef {Object} BibliographyInput
|
|
47
|
-
* @property {string} registerId
|
|
48
|
-
* @property {readonly BibliographyEntry[]} entries
|
|
49
|
-
* @property {string} [baseUri]
|
|
50
|
-
*/
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Returns the canonical IRI for a bibliography entry.
|
|
54
|
-
*
|
|
55
|
-
* @param {string} registerId
|
|
56
|
-
* @param {string} entryId
|
|
57
|
-
* @param {string} [baseUri]
|
|
58
|
-
*/
|
|
59
|
-
export function bibliographyEntryIri(registerId, entryId, baseUri) {
|
|
60
|
-
if (!baseUri) throw new Error('bibliographyEntryIri requires baseUri — the deployment canonical URI root. glossarist-js does NOT default to glossarist.org because instance data identity must reflect the consumer domain.');
|
|
61
|
-
return `${baseUri}/${registerId}/bib/${entryId}`;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Emits dcterms:BibliographicResource quads for each entry. Entries
|
|
66
|
-
* without an id or reference are skipped (matches concept-browser).
|
|
67
|
-
*
|
|
68
|
-
* @param {BibliographyInput} input
|
|
69
|
-
* @returns {Generator<Quad, void, unknown>}
|
|
70
|
-
*/
|
|
71
|
-
export function* bibliographyToQuads(input) {
|
|
72
|
-
const baseUri = input.baseUri;
|
|
73
|
-
if (!baseUri) throw new Error('bibliographyToQuads requires input.baseUri — the deployment canonical URI root.');
|
|
74
|
-
const parentIri = `${baseUri}/${input.registerId}/`;
|
|
75
|
-
|
|
76
|
-
for (const entry of input.entries ?? []) {
|
|
77
|
-
if (!entry.id || !entry.reference) continue;
|
|
78
|
-
const entryIri = bibliographyEntryIri(input.registerId, entry.id, baseUri);
|
|
79
|
-
const e = namedNode(entryIri);
|
|
80
|
-
|
|
81
|
-
yield quad(e, namedNode(RDF_TYPE), namedNode(DCTERMS.BibliographicResource));
|
|
82
|
-
yield quad(e, namedNode(DCTERMS.identifier), literal(entry.id));
|
|
83
|
-
yield quad(e, namedNode(DCTERMS.bibliographicCitation), literal(entry.reference));
|
|
84
|
-
if (entry.title) {
|
|
85
|
-
yield quad(e, namedNode(DCTERMS.title), literal(entry.title));
|
|
86
|
-
}
|
|
87
|
-
if (entry.link) {
|
|
88
|
-
yield quad(e, namedNode(FOAF.page), namedNode(entry.link));
|
|
89
|
-
}
|
|
90
|
-
if (entry.type) {
|
|
91
|
-
yield quad(e, namedNode(DCTERMS.type), namedNode(`${GLOSS_NS}bibtype/${entry.type}`));
|
|
92
|
-
}
|
|
93
|
-
yield quad(e, namedNode(DCTERMS.isPartOf), namedNode(parentIri));
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Normalizes raw bibliography data from a v3 YAML bibliography file.
|
|
99
|
-
* Accepts both shapes:
|
|
100
|
-
* - { bibliography: [...] }
|
|
101
|
-
* - { <id>: { ... }, <id>: { ... } }
|
|
102
|
-
*
|
|
103
|
-
* Returns a flat list of BibliographyEntry objects with explicit ids.
|
|
104
|
-
*/
|
|
105
|
-
export function normalizeBibliographyData(raw) {
|
|
106
|
-
if (!raw || typeof raw !== 'object') return [];
|
|
107
|
-
if (Array.isArray(raw.bibliography)) {
|
|
108
|
-
return raw.bibliography.map(e => entryFromV3(e, null));
|
|
109
|
-
}
|
|
110
|
-
const entries: unknown[] = [];
|
|
111
|
-
for (const [id, value] of Object.entries(raw)) {
|
|
112
|
-
if (!value || typeof value !== 'object') continue;
|
|
113
|
-
entries.push(entryFromV3(value, id));
|
|
114
|
-
}
|
|
115
|
-
return entries;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
function entryFromV3(e, fallbackId) {
|
|
119
|
-
return {
|
|
120
|
-
id: e.id ?? fallbackId ?? '',
|
|
121
|
-
reference: e.reference ?? '',
|
|
122
|
-
title: e.title,
|
|
123
|
-
link: e.link,
|
|
124
|
-
type: e.type,
|
|
125
|
-
};
|
|
126
|
-
}
|
package/src/rdf/bnode-id.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
// Deterministic blank node ID strategy.
|
|
2
|
-
//
|
|
3
|
-
// Single source of truth for bnode IDs across all emitters. Previously
|
|
4
|
-
// each emitter had its own local FNV-1a hash, producing different IDs
|
|
5
|
-
// for the same logical bnode. This module replaces those with one
|
|
6
|
-
// strategy: MD5 (via node:crypto) when available, FNV-1a fallback for
|
|
7
|
-
// browser bundles.
|
|
8
|
-
//
|
|
9
|
-
// Browser safety: node:crypto is loaded lazily via runtime check so
|
|
10
|
-
// bundlers don't tree-shake the import into the browser bundle.
|
|
11
|
-
|
|
12
|
-
let nodeCreateHash: ((alg: string) => { update(data: string): { digest(enc: string): string } }) | null = null;
|
|
13
|
-
let nodeCryptoChecked = false;
|
|
14
|
-
|
|
15
|
-
function getNodeCreateHash() {
|
|
16
|
-
if (nodeCryptoChecked) return nodeCreateHash;
|
|
17
|
-
nodeCryptoChecked = true;
|
|
18
|
-
try {
|
|
19
|
-
let requireFn;
|
|
20
|
-
try {
|
|
21
|
-
const mod = (Function('m', 'return require(m)'))('node:module');
|
|
22
|
-
requireFn = mod.createRequire(import.meta.url);
|
|
23
|
-
} catch {
|
|
24
|
-
requireFn = (m: string) => (Function('m', 'return require(m)'))(m);
|
|
25
|
-
}
|
|
26
|
-
const crypto = requireFn('node:crypto');
|
|
27
|
-
nodeCreateHash = crypto.createHash.bind(crypto);
|
|
28
|
-
} catch {
|
|
29
|
-
nodeCreateHash = null;
|
|
30
|
-
}
|
|
31
|
-
return nodeCreateHash;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function fnv1a(seed: string): string {
|
|
35
|
-
let h = 0x811c9dc5;
|
|
36
|
-
for (let i = 0; i < seed.length; i++) {
|
|
37
|
-
h ^= seed.charCodeAt(i);
|
|
38
|
-
h = Math.imul(h, 0x01000193);
|
|
39
|
-
}
|
|
40
|
-
return (h >>> 0).toString(16).padStart(8, '0');
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export function deterministicBnodeId(...parts: ReadonlyArray<unknown>): string {
|
|
44
|
-
const seed = parts.filter(p => p != null && p !== '').join('|');
|
|
45
|
-
if (!seed) return `b${fnv1a('empty')}`;
|
|
46
|
-
const createHash = getNodeCreateHash();
|
|
47
|
-
if (createHash) {
|
|
48
|
-
try {
|
|
49
|
-
return createHash('md5').update(seed).digest('hex').slice(0, 12);
|
|
50
|
-
} catch {
|
|
51
|
-
// fall through to FNV
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return `b${fnv1a(seed)}`;
|
|
55
|
-
}
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
// Build activity emitter — emits prov:Activity per build run.
|
|
2
|
-
// Mirrors concept-browser's build-activity-emitter.ts.
|
|
3
|
-
//
|
|
4
|
-
// Models a single CI build as a prov:Activity with:
|
|
5
|
-
// - prov:StartingPoint and prov:EndingPoint time bounds
|
|
6
|
-
// - prov:used links to the git commit, the build tool (prov:SoftwareAgent),
|
|
7
|
-
// and each dataset register
|
|
8
|
-
// - gloss:conceptCount for the build output
|
|
9
|
-
// - prov:wasAssociatedWith for the CI bot agent
|
|
10
|
-
|
|
11
|
-
import { namedNode, literal, quad } from './terms.js';
|
|
12
|
-
import { PREFIXES } from './prefixes.js';
|
|
13
|
-
import { RDF_TYPE } from './curie.js';
|
|
14
|
-
|
|
15
|
-
const PROV_NS = PREFIXES.prov;
|
|
16
|
-
const DCTERMS_NS = PREFIXES.dcterms;
|
|
17
|
-
const FOAF_NS = PREFIXES.foaf ?? 'http://xmlns.com/foaf/0.1/';
|
|
18
|
-
const GLOSS_NS = PREFIXES.gloss;
|
|
19
|
-
const XSD_NS = PREFIXES.xsd;
|
|
20
|
-
|
|
21
|
-
const PROV = {
|
|
22
|
-
Activity: `${PROV_NS}Activity`,
|
|
23
|
-
StartingPoint: `${PROV_NS}StartingPoint`,
|
|
24
|
-
EndingPoint: `${PROV_NS}EndingPoint`,
|
|
25
|
-
Entity: `${PROV_NS}Entity`,
|
|
26
|
-
SoftwareAgent: `${PROV_NS}SoftwareAgent`,
|
|
27
|
-
Agent: `${PROV_NS}Agent`,
|
|
28
|
-
Person: `${PROV_NS}Person`,
|
|
29
|
-
generatedAtTime: `${PROV_NS}generatedAtTime`,
|
|
30
|
-
atTime: `${PROV_NS}atTime`,
|
|
31
|
-
used: `${PROV_NS}used`,
|
|
32
|
-
wasAssociatedWith: `${PROV_NS}wasAssociatedWith`,
|
|
33
|
-
version: `${PROV_NS}version`,
|
|
34
|
-
};
|
|
35
|
-
const DCTERMS = {
|
|
36
|
-
identifier: `${DCTERMS_NS}identifier`,
|
|
37
|
-
description: `${DCTERMS_NS}description`,
|
|
38
|
-
};
|
|
39
|
-
const FOAF = {
|
|
40
|
-
Person: `${FOAF_NS}Person`,
|
|
41
|
-
};
|
|
42
|
-
const GLOSS = {
|
|
43
|
-
conceptCount: `${GLOSS_NS}conceptCount`,
|
|
44
|
-
};
|
|
45
|
-
const XSD_DATE_TIME = `${XSD_NS}dateTime`;
|
|
46
|
-
const XSD_INTEGER = `${XSD_NS}integer`;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* @typedef {Object} BuildActivityInput
|
|
50
|
-
* @property {string} runId
|
|
51
|
-
* @property {string} startedAt — ISO date-time
|
|
52
|
-
* @property {string} endedAt — ISO date-time
|
|
53
|
-
* @property {string} [gitSha]
|
|
54
|
-
* @property {string} [gitBranch]
|
|
55
|
-
* @property {string} toolId
|
|
56
|
-
* @property {string} toolVersion
|
|
57
|
-
* @property {readonly string[]} datasetRegisters
|
|
58
|
-
* @property {number} conceptCount
|
|
59
|
-
* @property {string} [associatedAgentIri]
|
|
60
|
-
* @property {string} [baseUri] — default https://glossarist.org
|
|
61
|
-
*/
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Returns the canonical relative IRI for a build activity.
|
|
65
|
-
*/
|
|
66
|
-
export function buildActivityIri(input) {
|
|
67
|
-
return `activity/build/${input.runId}`;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Emits prov:Activity quads for one build run, including the
|
|
72
|
-
* starting/ending time bounds, the build tool as prov:SoftwareAgent,
|
|
73
|
-
* the git commit (when provided) as a prov:Entity, and each dataset
|
|
74
|
-
* register as a prov:used target.
|
|
75
|
-
*
|
|
76
|
-
* @param {BuildActivityInput} input
|
|
77
|
-
* @returns {Generator<Quad, void, unknown>}
|
|
78
|
-
*/
|
|
79
|
-
export function* buildActivityToQuads(input) {
|
|
80
|
-
const baseUri = input.baseUri;
|
|
81
|
-
if (!baseUri) throw new Error('buildActivityToQuads requires input.baseUri — the deployment canonical URI root. glossarist-js does NOT default to glossarist.org because instance data identity must reflect the consumer domain.');
|
|
82
|
-
const activityIri = `${baseUri}/${buildActivityIri(input)}`;
|
|
83
|
-
const activity = namedNode(activityIri);
|
|
84
|
-
|
|
85
|
-
yield quad(activity, namedNode(RDF_TYPE), namedNode(PROV.Activity));
|
|
86
|
-
yield quad(activity, namedNode(PROV.generatedAtTime), literal(input.endedAt, namedNode(XSD_DATE_TIME)));
|
|
87
|
-
|
|
88
|
-
// StartingPoint and EndingPoint are sub-types of prov:TimeBound.
|
|
89
|
-
// Modeling them as separate resources lets consumers query exact
|
|
90
|
-
// start vs end without parsing date ranges.
|
|
91
|
-
const start = namedNode(`${activityIri}/start`);
|
|
92
|
-
yield quad(start, namedNode(RDF_TYPE), namedNode(PROV.StartingPoint));
|
|
93
|
-
yield quad(start, namedNode(PROV.atTime), literal(input.startedAt, namedNode(XSD_DATE_TIME)));
|
|
94
|
-
|
|
95
|
-
const end = namedNode(`${activityIri}/end`);
|
|
96
|
-
yield quad(end, namedNode(RDF_TYPE), namedNode(PROV.EndingPoint));
|
|
97
|
-
yield quad(end, namedNode(PROV.atTime), literal(input.endedAt, namedNode(XSD_DATE_TIME)));
|
|
98
|
-
|
|
99
|
-
if (input.gitSha) {
|
|
100
|
-
const commitIri = `${baseUri}/commit/${input.gitSha}`;
|
|
101
|
-
yield quad(activity, namedNode(PROV.used), namedNode(commitIri));
|
|
102
|
-
const commit = namedNode(commitIri);
|
|
103
|
-
yield quad(commit, namedNode(RDF_TYPE), namedNode(PROV.Entity));
|
|
104
|
-
if (input.gitBranch) {
|
|
105
|
-
yield quad(commit, namedNode(DCTERMS.description), literal(`branch: ${input.gitBranch}`));
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
const toolIri = `${baseUri}/tool/${input.toolId}/${input.toolVersion}`;
|
|
110
|
-
yield quad(activity, namedNode(PROV.used), namedNode(toolIri));
|
|
111
|
-
const tool = namedNode(toolIri);
|
|
112
|
-
yield quad(tool, namedNode(RDF_TYPE), namedNode(PROV.Entity));
|
|
113
|
-
yield quad(tool, namedNode(RDF_TYPE), namedNode(PROV.SoftwareAgent));
|
|
114
|
-
yield quad(tool, namedNode(DCTERMS.identifier), literal(input.toolVersion));
|
|
115
|
-
yield quad(tool, namedNode(PROV.version), literal(input.toolVersion));
|
|
116
|
-
|
|
117
|
-
for (const register of input.datasetRegisters ?? []) {
|
|
118
|
-
yield quad(activity, namedNode(PROV.used), namedNode(`${baseUri}/${register}/`));
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
yield quad(activity, namedNode(GLOSS.conceptCount), literal(String(input.conceptCount), namedNode(XSD_INTEGER)));
|
|
122
|
-
|
|
123
|
-
if (input.associatedAgentIri) {
|
|
124
|
-
yield quad(activity, namedNode(PROV.wasAssociatedWith), namedNode(input.associatedAgentIri));
|
|
125
|
-
const agent = namedNode(input.associatedAgentIri);
|
|
126
|
-
yield quad(agent, namedNode(RDF_TYPE), namedNode(PROV.Agent));
|
|
127
|
-
yield quad(agent, namedNode(RDF_TYPE), namedNode(FOAF.Person));
|
|
128
|
-
}
|
|
129
|
-
}
|
package/src/rdf/curie.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
// CURIE helpers — resolve/compact IRIs against the canonical PREFIXES.
|
|
2
|
-
//
|
|
3
|
-
// Single source of truth for CURIE ↔ IRI conversion. Previously
|
|
4
|
-
// `resolveIri` was private to vocabulary-emitter and reimplemented
|
|
5
|
-
// (incorrectly) in other emitters. Callers now import from here.
|
|
6
|
-
|
|
7
|
-
import { PREFIXES } from './prefixes.js';
|
|
8
|
-
|
|
9
|
-
const ABSOLUTE_SCHEMES = new Set(['http', 'https', 'urn', 'file', 'mailto', 'ftp']);
|
|
10
|
-
|
|
11
|
-
export function isAbsoluteIri(s: string): boolean {
|
|
12
|
-
if (typeof s !== 'string' || s.length === 0) return false;
|
|
13
|
-
if (s.startsWith('urn:')) return true;
|
|
14
|
-
const colon = s.indexOf(':');
|
|
15
|
-
if (colon < 1) return false;
|
|
16
|
-
return ABSOLUTE_SCHEMES.has(s.slice(0, colon));
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function resolveIri(iri: string, prefixes: Record<string, string> = PREFIXES): string {
|
|
20
|
-
if (isAbsoluteIri(iri)) return iri;
|
|
21
|
-
const colon = iri.indexOf(':');
|
|
22
|
-
if (colon < 1) return iri;
|
|
23
|
-
const prefix = iri.slice(0, colon);
|
|
24
|
-
const local = iri.slice(colon + 1);
|
|
25
|
-
const base = prefixes[prefix as keyof typeof PREFIXES];
|
|
26
|
-
return base ? `${base}${local}` : iri;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export function compactIri(iri: string, prefixes: Record<string, string> = PREFIXES): string {
|
|
30
|
-
let best = null;
|
|
31
|
-
let bestLen = 0;
|
|
32
|
-
for (const [prefix, base] of Object.entries(prefixes)) {
|
|
33
|
-
if (iri.startsWith(base) && base.length > bestLen) {
|
|
34
|
-
// @ts-expect-error TODO(Phase 2e): type this fully
|
|
35
|
-
best = `${prefix}:${iri.slice(base.length)}`;
|
|
36
|
-
bestLen = base.length;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return best ?? iri;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// Convenience constants — used by every emitter. Centralized here so
|
|
43
|
-
// the IRI string appears in exactly one place.
|
|
44
|
-
export const RDF_TYPE = `${PREFIXES.rdf}type`;
|
|
45
|
-
export const RDF_VALUE = `${PREFIXES.rdf}value`;
|
|
46
|
-
export const RDFS_LABEL = `${PREFIXES.rdfs}label`;
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
// Dataset emitter — emits dcat:Dataset + skos:ConceptScheme per
|
|
2
|
-
// register. Mirrors concept-browser's dataset-emitter.ts.
|
|
3
|
-
//
|
|
4
|
-
// The dataset describes the vocabulary as a whole: title, description,
|
|
5
|
-
// modified date, languages, distributions (Turtle/JSON-LD/YAML), top
|
|
6
|
-
// concepts, sections, source repo, publisher, contact.
|
|
7
|
-
//
|
|
8
|
-
// Each section becomes a skos:Collection linked via skos:member to
|
|
9
|
-
// its concept URIs and via gloss:hasParentSection / gloss:hasChildSection
|
|
10
|
-
// to its relatives (the ontology declares these as owl:TransitiveProperty
|
|
11
|
-
// for cascading section membership).
|
|
12
|
-
|
|
13
|
-
import { namedNode, blankNode, literal, quad } from './terms.js';
|
|
14
|
-
import { PREFIXES } from './prefixes.js';
|
|
15
|
-
import { RDF_TYPE } from './curie.js';
|
|
16
|
-
import { deterministicBnodeId } from './bnode-id.js';
|
|
17
|
-
|
|
18
|
-
// Namespace IRIs from the canonical PREFIXES — single source of truth.
|
|
19
|
-
const DCAT_NS = PREFIXES.dcat ?? 'http://www.w3.org/ns/dcat#';
|
|
20
|
-
const DCTERMS_NS = PREFIXES.dcterms;
|
|
21
|
-
const SKOS_NS = PREFIXES.skos;
|
|
22
|
-
const PROV_NS = PREFIXES.prov;
|
|
23
|
-
const GLOSS_NS = PREFIXES.gloss;
|
|
24
|
-
const XSD_NS = PREFIXES.xsd;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* @typedef {Object} DatasetDistribution
|
|
28
|
-
* @property {string} id
|
|
29
|
-
* @property {string} title
|
|
30
|
-
* @property {string} mediaType
|
|
31
|
-
* @property {string} downloadUrl
|
|
32
|
-
* @property {number} [byteSize]
|
|
33
|
-
*/
|
|
34
|
-
/**
|
|
35
|
-
* @typedef {Object} DatasetSection
|
|
36
|
-
* @property {string} collectionIri
|
|
37
|
-
* @property {string} title
|
|
38
|
-
* @property {readonly string[]} memberUris
|
|
39
|
-
* @property {string} [parentCollectionIri]
|
|
40
|
-
* @property {readonly string[]} [childCollectionIris]
|
|
41
|
-
*/
|
|
42
|
-
/**
|
|
43
|
-
* @typedef {Object} DatasetEmitterInput
|
|
44
|
-
* @property {string} datasetIri
|
|
45
|
-
* @property {string} registerId
|
|
46
|
-
* @property {string} title
|
|
47
|
-
* @property {string} [description]
|
|
48
|
-
* @property {string} modified — ISO date (YYYY-MM-DD)
|
|
49
|
-
* @property {readonly string[]} languages
|
|
50
|
-
* @property {readonly DatasetDistribution[]} distributions
|
|
51
|
-
* @property {readonly string[]} topConceptUris
|
|
52
|
-
* @property {readonly DatasetSection[]} sections
|
|
53
|
-
* @property {string} [sourceRepoUrl]
|
|
54
|
-
* @property {string} [publisherIri]
|
|
55
|
-
* @property {string} [contactIri]
|
|
56
|
-
*/
|
|
57
|
-
|
|
58
|
-
const DCAT = {
|
|
59
|
-
Dataset: `${DCAT_NS}Dataset`,
|
|
60
|
-
ConceptScheme: `${SKOS_NS}ConceptScheme`,
|
|
61
|
-
Distribution: `${DCAT_NS}Distribution`,
|
|
62
|
-
Collection: `${SKOS_NS}Collection`,
|
|
63
|
-
mediaType: `${DCAT_NS}mediaType`,
|
|
64
|
-
downloadURL: `${DCAT_NS}downloadURL`,
|
|
65
|
-
byteSize: `${DCAT_NS}byteSize`,
|
|
66
|
-
distribution: `${DCAT_NS}distribution`,
|
|
67
|
-
contactPoint: `${DCAT_NS}contactPoint`,
|
|
68
|
-
};
|
|
69
|
-
const DCTERMS = {
|
|
70
|
-
title: `${DCTERMS_NS}title`,
|
|
71
|
-
description: `${DCTERMS_NS}description`,
|
|
72
|
-
modified: `${DCTERMS_NS}modified`,
|
|
73
|
-
identifier: `${DCTERMS_NS}identifier`,
|
|
74
|
-
language: `${DCTERMS_NS}language`,
|
|
75
|
-
publisher: `${DCTERMS_NS}publisher`,
|
|
76
|
-
};
|
|
77
|
-
const SKOS = {
|
|
78
|
-
hasTopConcept: `${SKOS_NS}hasTopConcept`,
|
|
79
|
-
member: `${SKOS_NS}member`,
|
|
80
|
-
};
|
|
81
|
-
const PROV = {
|
|
82
|
-
wasDerivedFrom: `${PROV_NS}wasDerivedFrom`,
|
|
83
|
-
};
|
|
84
|
-
const GLOSS = {
|
|
85
|
-
hasParentSection: `${GLOSS_NS}hasParentSection`,
|
|
86
|
-
hasChildSection: `${GLOSS_NS}hasChildSection`,
|
|
87
|
-
};
|
|
88
|
-
const XSD_DATE = `${XSD_NS}date`;
|
|
89
|
-
const XSD_INTEGER = `${XSD_NS}integer`;
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Emits dcat:Dataset + skos:ConceptScheme quads for one register's
|
|
93
|
-
* metadata, plus its distributions, sections, and top concepts.
|
|
94
|
-
*
|
|
95
|
-
* @param {DatasetEmitterInput} input
|
|
96
|
-
* @returns {Generator<Quad, void, unknown>}
|
|
97
|
-
*/
|
|
98
|
-
export function* datasetToQuads(input) {
|
|
99
|
-
const ds = namedNode(input.datasetIri);
|
|
100
|
-
|
|
101
|
-
yield quad(ds, namedNode(RDF_TYPE), namedNode(DCAT.Dataset));
|
|
102
|
-
yield quad(ds, namedNode(RDF_TYPE), namedNode(DCAT.ConceptScheme));
|
|
103
|
-
yield quad(ds, namedNode(DCTERMS.title), literal(input.title));
|
|
104
|
-
if (input.description) {
|
|
105
|
-
yield quad(ds, namedNode(DCTERMS.description), literal(input.description));
|
|
106
|
-
}
|
|
107
|
-
yield quad(ds, namedNode(DCTERMS.modified), literal(input.modified, namedNode(XSD_DATE)));
|
|
108
|
-
yield quad(ds, namedNode(DCTERMS.identifier), literal(input.registerId));
|
|
109
|
-
|
|
110
|
-
for (const lang of input.languages ?? []) {
|
|
111
|
-
const langIri = `http://id.loc.gov/vocabulary/iso639-1/${lang}`;
|
|
112
|
-
yield quad(ds, namedNode(DCTERMS.language), namedNode(langIri));
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
for (const dist of input.distributions ?? []) {
|
|
116
|
-
yield* distributionToQuads(ds, dist);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
for (const conceptUri of input.topConceptUris ?? []) {
|
|
120
|
-
yield quad(ds, namedNode(SKOS.hasTopConcept), namedNode(conceptUri));
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
if (input.sourceRepoUrl) {
|
|
124
|
-
yield quad(ds, namedNode(PROV.wasDerivedFrom), namedNode(input.sourceRepoUrl));
|
|
125
|
-
}
|
|
126
|
-
if (input.publisherIri) {
|
|
127
|
-
yield quad(ds, namedNode(DCTERMS.publisher), namedNode(input.publisherIri));
|
|
128
|
-
}
|
|
129
|
-
if (input.contactIri) {
|
|
130
|
-
yield quad(ds, namedNode(DCAT.contactPoint), namedNode(input.contactIri));
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
for (const section of input.sections ?? []) {
|
|
134
|
-
yield* sectionToQuads(section);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
function* distributionToQuads(ds, dist) {
|
|
139
|
-
// Distributions are blank nodes — they don't have stable identity
|
|
140
|
-
// outside their parent dataset. Using blankNode() (not namedNode with
|
|
141
|
-
// a "_:..." string) so the n3 writer serializes them as _:bXXXX
|
|
142
|
-
// rather than <_:bXXXX> which would be an invalid IRI.
|
|
143
|
-
const distSubject = blankNode(`b${deterministicBnodeId('dist', dist.id, dist.downloadUrl)}`);
|
|
144
|
-
yield quad(ds, namedNode(DCAT.distribution), distSubject);
|
|
145
|
-
yield quad(distSubject, namedNode(RDF_TYPE), namedNode(DCAT.Distribution));
|
|
146
|
-
yield quad(distSubject, namedNode(DCTERMS.title), literal(dist.title));
|
|
147
|
-
yield quad(distSubject, namedNode(DCAT.mediaType), literal(dist.mediaType));
|
|
148
|
-
yield quad(distSubject, namedNode(DCAT.downloadURL), namedNode(dist.downloadUrl));
|
|
149
|
-
if (dist.byteSize != null) {
|
|
150
|
-
yield quad(distSubject, namedNode(DCAT.byteSize), literal(String(dist.byteSize), namedNode(XSD_INTEGER)));
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
function* sectionToQuads(section) {
|
|
155
|
-
const coll = namedNode(section.collectionIri);
|
|
156
|
-
yield quad(coll, namedNode(RDF_TYPE), namedNode(DCAT.Collection));
|
|
157
|
-
yield quad(coll, namedNode(DCTERMS.title), literal(section.title));
|
|
158
|
-
for (const member of section.memberUris ?? []) {
|
|
159
|
-
yield quad(coll, namedNode(SKOS.member), namedNode(member));
|
|
160
|
-
}
|
|
161
|
-
if (section.parentCollectionIri) {
|
|
162
|
-
yield quad(coll, namedNode(GLOSS.hasParentSection), namedNode(section.parentCollectionIri));
|
|
163
|
-
}
|
|
164
|
-
for (const child of section.childCollectionIris ?? []) {
|
|
165
|
-
yield quad(coll, namedNode(GLOSS.hasChildSection), namedNode(child));
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
// Local deterministic-id helper is no longer needed — using the shared
|
|
170
|
-
// deterministicBnodeId from bnode-id.js for cross-emitter consistency.
|