@linked.archi/kernel 0.0.0-stage → 0.1.5
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/LICENSE +202 -0
- package/NOTICE +11 -0
- package/README.md +96 -2
- package/assets/arch-decision/arch-decision-metamodel.ttl +44 -0
- package/assets/arch-decision/arch-decision-onto.ttl +1566 -0
- package/assets/arch-decision/arch-decision-shapes.ttl +582 -0
- package/assets/arch-decision/arch-decision-tax.ttl +129 -0
- package/assets/arch-processes/arch-processes-metamodel.ttl +42 -0
- package/assets/arch-processes/arch-processes-tax.ttl +136 -0
- package/assets/arch-processes/archProcesses-shapes.ttl +189 -0
- package/assets/arch-processes/archProcesses.ttl +953 -0
- package/assets/archimate3/archimate3.2-element-shapes.ttl +379 -0
- package/assets/archimate3/archimate3.2-metamodel.ttl +205 -0
- package/assets/archimate3/archimate3.2-notation.ttl +1503 -0
- package/assets/archimate3/archimate3.2-onto.ttl +1579 -0
- package/assets/archimate3/archimate3.2-presentation-contexts.ttl +90 -0
- package/assets/archimate3/archimate3.2-principle-shapes.ttl +923 -0
- package/assets/archimate3/archimate3.2-questions.ttl +1125 -0
- package/assets/archimate3/archimate3.2-reference-data.ttl +74 -0
- package/assets/archimate3/archimate3.2-relationship-shapes.ttl +30956 -0
- package/assets/archimate3/archimate3.2-relationship-tables.ttl +5992 -0
- package/assets/archimate3/archimate3.2-tax.ttl +724 -0
- package/assets/archimate3/archimate3.2-viewpoint-shapes.ttl +59 -0
- package/assets/archimate3/archimate3.2-viewpoints.ttl +793 -0
- package/assets/archimate3/icons/and-junction.svg +3 -0
- package/assets/archimate3/icons/application-collaboration.svg +22 -0
- package/assets/archimate3/icons/application-component.svg +18 -0
- package/assets/archimate3/icons/application-event.svg +15 -0
- package/assets/archimate3/icons/application-function.svg +14 -0
- package/assets/archimate3/icons/application-interaction.svg +17 -0
- package/assets/archimate3/icons/application-interface.svg +16 -0
- package/assets/archimate3/icons/application-process.svg +14 -0
- package/assets/archimate3/icons/application-service.svg +14 -0
- package/assets/archimate3/icons/artifact.svg +16 -0
- package/assets/archimate3/icons/assessment.svg +17 -0
- package/assets/archimate3/icons/business-actor.svg +22 -0
- package/assets/archimate3/icons/business-collaboration.svg +21 -0
- package/assets/archimate3/icons/business-event.svg +15 -0
- package/assets/archimate3/icons/business-function.svg +14 -0
- package/assets/archimate3/icons/business-interaction.svg +18 -0
- package/assets/archimate3/icons/business-interface.svg +16 -0
- package/assets/archimate3/icons/business-object.svg +14 -0
- package/assets/archimate3/icons/business-process.svg +15 -0
- package/assets/archimate3/icons/business-role.svg +16 -0
- package/assets/archimate3/icons/business-service.svg +14 -0
- package/assets/archimate3/icons/capability.svg +40 -0
- package/assets/archimate3/icons/communication-network.svg +18 -0
- package/assets/archimate3/icons/constraint.svg +18 -0
- package/assets/archimate3/icons/contract.svg +13 -0
- package/assets/archimate3/icons/course-of-action.svg +20 -0
- package/assets/archimate3/icons/data-object.svg +14 -0
- package/assets/archimate3/icons/deliverable.svg +11 -0
- package/assets/archimate3/icons/device.svg +18 -0
- package/assets/archimate3/icons/distribution-network.svg +19 -0
- package/assets/archimate3/icons/driver.svg +24 -0
- package/assets/archimate3/icons/equipment.svg +31 -0
- package/assets/archimate3/icons/facility.svg +16 -0
- package/assets/archimate3/icons/gap.svg +22 -0
- package/assets/archimate3/icons/glyphs/activity.svg +3 -0
- package/assets/archimate3/icons/glyphs/actor.svg +14 -0
- package/assets/archimate3/icons/glyphs/application-component.svg +12 -0
- package/assets/archimate3/icons/glyphs/artifact.svg +9 -0
- package/assets/archimate3/icons/glyphs/assessment.svg +9 -0
- package/assets/archimate3/icons/glyphs/capability.svg +32 -0
- package/assets/archimate3/icons/glyphs/cloud-gear.svg +3 -0
- package/assets/archimate3/icons/glyphs/collaboration.svg +15 -0
- package/assets/archimate3/icons/glyphs/communication-network.svg +12 -0
- package/assets/archimate3/icons/glyphs/constraint.svg +10 -0
- package/assets/archimate3/icons/glyphs/contract.svg +5 -0
- package/assets/archimate3/icons/glyphs/course-of-action.svg +12 -0
- package/assets/archimate3/icons/glyphs/data-object.svg +4 -0
- package/assets/archimate3/icons/glyphs/deliverable.svg +3 -0
- package/assets/archimate3/icons/glyphs/device.svg +10 -0
- package/assets/archimate3/icons/glyphs/distribution-network.svg +11 -0
- package/assets/archimate3/icons/glyphs/driver.svg +16 -0
- package/assets/archimate3/icons/glyphs/equipment.svg +22 -0
- package/assets/archimate3/icons/glyphs/event.svg +6 -0
- package/assets/archimate3/icons/glyphs/facility.svg +7 -0
- package/assets/archimate3/icons/glyphs/function.svg +6 -0
- package/assets/archimate3/icons/glyphs/gap.svg +14 -0
- package/assets/archimate3/icons/glyphs/goal.svg +10 -0
- package/assets/archimate3/icons/glyphs/grouping.svg +4 -0
- package/assets/archimate3/icons/glyphs/interaction.svg +10 -0
- package/assets/archimate3/icons/glyphs/interface.svg +8 -0
- package/assets/archimate3/icons/glyphs/location.svg +6 -0
- package/assets/archimate3/icons/glyphs/material.svg +12 -0
- package/assets/archimate3/icons/glyphs/meaning.svg +3 -0
- package/assets/archimate3/icons/glyphs/node.svg +8 -0
- package/assets/archimate3/icons/glyphs/object.svg +4 -0
- package/assets/archimate3/icons/glyphs/outcome.svg +16 -0
- package/assets/archimate3/icons/glyphs/path.svg +10 -0
- package/assets/archimate3/icons/glyphs/person-silhouette.svg +3 -0
- package/assets/archimate3/icons/glyphs/plateau.svg +8 -0
- package/assets/archimate3/icons/glyphs/principle.svg +12 -0
- package/assets/archimate3/icons/glyphs/process.svg +6 -0
- package/assets/archimate3/icons/glyphs/product.svg +4 -0
- package/assets/archimate3/icons/glyphs/representation.svg +4 -0
- package/assets/archimate3/icons/glyphs/requirement.svg +6 -0
- package/assets/archimate3/icons/glyphs/resource.svg +14 -0
- package/assets/archimate3/icons/glyphs/role.svg +6 -0
- package/assets/archimate3/icons/glyphs/service.svg +6 -0
- package/assets/archimate3/icons/glyphs/stakeholder.svg +6 -0
- package/assets/archimate3/icons/glyphs/system-software.svg +14 -0
- package/assets/archimate3/icons/glyphs/value-stream.svg +3 -0
- package/assets/archimate3/icons/glyphs/value.svg +3 -0
- package/assets/archimate3/icons/glyphs/work-package.svg +4 -0
- package/assets/archimate3/icons/goal.svg +18 -0
- package/assets/archimate3/icons/grouping.svg +12 -0
- package/assets/archimate3/icons/implementation-event.svg +15 -0
- package/assets/archimate3/icons/location.svg +14 -0
- package/assets/archimate3/icons/material.svg +21 -0
- package/assets/archimate3/icons/meaning.svg +11 -0
- package/assets/archimate3/icons/node.svg +14 -0
- package/assets/archimate3/icons/or-junction.svg +3 -0
- package/assets/archimate3/icons/outcome.svg +25 -0
- package/assets/archimate3/icons/path.svg +18 -0
- package/assets/archimate3/icons/plateau.svg +16 -0
- package/assets/archimate3/icons/principle.svg +21 -0
- package/assets/archimate3/icons/product.svg +12 -0
- package/assets/archimate3/icons/representation.svg +12 -0
- package/assets/archimate3/icons/requirement.svg +14 -0
- package/assets/archimate3/icons/resource.svg +23 -0
- package/assets/archimate3/icons/stakeholder.svg +15 -0
- package/assets/archimate3/icons/system-software.svg +22 -0
- package/assets/archimate3/icons/technology-collaboration.svg +22 -0
- package/assets/archimate3/icons/technology-event.svg +15 -0
- package/assets/archimate3/icons/technology-function.svg +14 -0
- package/assets/archimate3/icons/technology-interaction.svg +18 -0
- package/assets/archimate3/icons/technology-interface.svg +16 -0
- package/assets/archimate3/icons/technology-process.svg +14 -0
- package/assets/archimate3/icons/technology-service.svg +14 -0
- package/assets/archimate3/icons/value-stream.svg +11 -0
- package/assets/archimate3/icons/value.svg +11 -0
- package/assets/archimate3/icons/work-package.svg +12 -0
- package/assets/archimate4/archimate4-element-shapes.ttl +404 -0
- package/assets/archimate4/archimate4-metamodel.ttl +179 -0
- package/assets/archimate4/archimate4-notation.ttl +1147 -0
- package/assets/archimate4/archimate4-onto.ttl +1559 -0
- package/assets/archimate4/archimate4-presentation-contexts.ttl +60 -0
- package/assets/archimate4/archimate4-principle-shapes.ttl +893 -0
- package/assets/archimate4/archimate4-questions.ttl +1224 -0
- package/assets/archimate4/archimate4-reference-data.ttl +56 -0
- package/assets/archimate4/archimate4-relationship-shapes.ttl +16920 -0
- package/assets/archimate4/archimate4-relationship-tables.ttl +3200 -0
- package/assets/archimate4/archimate4-tax.ttl +749 -0
- package/assets/archimate4/archimate4-viewpoint-shapes.ttl +55 -0
- package/assets/archimate4/archimate4-viewpoints.ttl +777 -0
- package/assets/archimate4/icons/and-junction.svg +3 -0
- package/assets/archimate4/icons/application-component.svg +18 -0
- package/assets/archimate4/icons/application-interface.svg +16 -0
- package/assets/archimate4/icons/artifact.svg +16 -0
- package/assets/archimate4/icons/assessment.svg +17 -0
- package/assets/archimate4/icons/business-actor.svg +22 -0
- package/assets/archimate4/icons/business-interface.svg +16 -0
- package/assets/archimate4/icons/business-object.svg +14 -0
- package/assets/archimate4/icons/capability.svg +40 -0
- package/assets/archimate4/icons/collaboration.svg +21 -0
- package/assets/archimate4/icons/communication-network.svg +18 -0
- package/assets/archimate4/icons/course-of-action.svg +20 -0
- package/assets/archimate4/icons/data-object.svg +14 -0
- package/assets/archimate4/icons/deliverable.svg +11 -0
- package/assets/archimate4/icons/device.svg +18 -0
- package/assets/archimate4/icons/distribution-network.svg +19 -0
- package/assets/archimate4/icons/driver.svg +24 -0
- package/assets/archimate4/icons/equipment.svg +31 -0
- package/assets/archimate4/icons/event.svg +15 -0
- package/assets/archimate4/icons/facility.svg +16 -0
- package/assets/archimate4/icons/function.svg +13 -0
- package/assets/archimate4/icons/glyphs/activity.svg +3 -0
- package/assets/archimate4/icons/glyphs/actor.svg +14 -0
- package/assets/archimate4/icons/glyphs/application-component.svg +12 -0
- package/assets/archimate4/icons/glyphs/artifact.svg +9 -0
- package/assets/archimate4/icons/glyphs/assessment.svg +9 -0
- package/assets/archimate4/icons/glyphs/capability.svg +32 -0
- package/assets/archimate4/icons/glyphs/cloud-gear.svg +3 -0
- package/assets/archimate4/icons/glyphs/collaboration.svg +15 -0
- package/assets/archimate4/icons/glyphs/communication-network.svg +12 -0
- package/assets/archimate4/icons/glyphs/constraint.svg +10 -0
- package/assets/archimate4/icons/glyphs/contract.svg +5 -0
- package/assets/archimate4/icons/glyphs/course-of-action.svg +12 -0
- package/assets/archimate4/icons/glyphs/data-object.svg +4 -0
- package/assets/archimate4/icons/glyphs/deliverable.svg +3 -0
- package/assets/archimate4/icons/glyphs/device.svg +10 -0
- package/assets/archimate4/icons/glyphs/distribution-network.svg +11 -0
- package/assets/archimate4/icons/glyphs/driver.svg +16 -0
- package/assets/archimate4/icons/glyphs/equipment.svg +22 -0
- package/assets/archimate4/icons/glyphs/event.svg +6 -0
- package/assets/archimate4/icons/glyphs/facility.svg +7 -0
- package/assets/archimate4/icons/glyphs/function.svg +6 -0
- package/assets/archimate4/icons/glyphs/gap.svg +14 -0
- package/assets/archimate4/icons/glyphs/goal.svg +10 -0
- package/assets/archimate4/icons/glyphs/grouping.svg +4 -0
- package/assets/archimate4/icons/glyphs/interaction.svg +10 -0
- package/assets/archimate4/icons/glyphs/interface.svg +8 -0
- package/assets/archimate4/icons/glyphs/location.svg +6 -0
- package/assets/archimate4/icons/glyphs/material.svg +12 -0
- package/assets/archimate4/icons/glyphs/meaning.svg +3 -0
- package/assets/archimate4/icons/glyphs/node.svg +8 -0
- package/assets/archimate4/icons/glyphs/object.svg +4 -0
- package/assets/archimate4/icons/glyphs/outcome.svg +16 -0
- package/assets/archimate4/icons/glyphs/path.svg +10 -0
- package/assets/archimate4/icons/glyphs/person-silhouette.svg +3 -0
- package/assets/archimate4/icons/glyphs/plateau.svg +8 -0
- package/assets/archimate4/icons/glyphs/principle.svg +12 -0
- package/assets/archimate4/icons/glyphs/process.svg +6 -0
- package/assets/archimate4/icons/glyphs/product.svg +4 -0
- package/assets/archimate4/icons/glyphs/representation.svg +4 -0
- package/assets/archimate4/icons/glyphs/requirement.svg +6 -0
- package/assets/archimate4/icons/glyphs/resource.svg +14 -0
- package/assets/archimate4/icons/glyphs/role.svg +6 -0
- package/assets/archimate4/icons/glyphs/service.svg +6 -0
- package/assets/archimate4/icons/glyphs/stakeholder.svg +6 -0
- package/assets/archimate4/icons/glyphs/system-software.svg +14 -0
- package/assets/archimate4/icons/glyphs/value-stream.svg +3 -0
- package/assets/archimate4/icons/glyphs/value.svg +3 -0
- package/assets/archimate4/icons/glyphs/work-package.svg +4 -0
- package/assets/archimate4/icons/goal.svg +18 -0
- package/assets/archimate4/icons/grouping.svg +12 -0
- package/assets/archimate4/icons/location.svg +14 -0
- package/assets/archimate4/icons/material.svg +21 -0
- package/assets/archimate4/icons/meaning.svg +11 -0
- package/assets/archimate4/icons/node.svg +14 -0
- package/assets/archimate4/icons/or-junction.svg +3 -0
- package/assets/archimate4/icons/outcome.svg +25 -0
- package/assets/archimate4/icons/path.svg +18 -0
- package/assets/archimate4/icons/plateau.svg +16 -0
- package/assets/archimate4/icons/principle.svg +21 -0
- package/assets/archimate4/icons/process.svg +15 -0
- package/assets/archimate4/icons/product.svg +12 -0
- package/assets/archimate4/icons/requirement.svg +14 -0
- package/assets/archimate4/icons/resource.svg +23 -0
- package/assets/archimate4/icons/role.svg +16 -0
- package/assets/archimate4/icons/service.svg +13 -0
- package/assets/archimate4/icons/stakeholder.svg +15 -0
- package/assets/archimate4/icons/system-software.svg +22 -0
- package/assets/archimate4/icons/technology-interface.svg +16 -0
- package/assets/archimate4/icons/value-stream.svg +11 -0
- package/assets/archimate4/icons/value.svg +11 -0
- package/assets/archimate4/icons/work-package.svg +12 -0
- package/assets/basic/basic-metamodel.ttl +100 -0
- package/assets/basic/basic-notation-bubble.ttl +175 -0
- package/assets/basic/basic-notation.ttl +172 -0
- package/assets/basic/basic-onto.ttl +171 -0
- package/assets/basic/basic-presentation-contexts.ttl +70 -0
- package/assets/basic/basic-tax.ttl +130 -0
- package/assets/basic/icons/aggregation.svg +7 -0
- package/assets/basic/icons/association.svg +6 -0
- package/assets/basic/icons/element.svg +5 -0
- package/assets/basic/icons/glyphs/aggregation.svg +6 -0
- package/assets/basic/icons/glyphs/association.svg +5 -0
- package/assets/basic/icons/glyphs/element.svg +5 -0
- package/assets/basic/icons/glyphs/relationship.svg +5 -0
- package/assets/basic/icons/relationship.svg +7 -0
- package/assets/basic/notation-bubble/icons/aggregation.svg +7 -0
- package/assets/basic/notation-bubble/icons/association.svg +6 -0
- package/assets/basic/notation-bubble/icons/element.svg +5 -0
- package/assets/basic/notation-bubble/icons/glyphs/aggregation.svg +6 -0
- package/assets/basic/notation-bubble/icons/glyphs/association.svg +5 -0
- package/assets/basic/notation-bubble/icons/glyphs/element.svg +5 -0
- package/assets/basic/notation-bubble/icons/glyphs/relationship.svg +5 -0
- package/assets/basic/notation-bubble/icons/relationship.svg +7 -0
- package/assets/catalog.ttl +7302 -0
- package/assets/core/core-notation.ttl +131 -0
- package/assets/core/core-onto.ttl +2811 -0
- package/assets/core/core-questions.ttl +957 -0
- package/assets/core/core-shapes.ttl +915 -0
- package/assets/core/core-vis-onto.ttl +1408 -0
- package/assets/core/core-vis-shapes.ttl +840 -0
- package/assets/core-vis/markers/circle-dot.svg +3 -0
- package/assets/core-vis/markers/closed-arrowhead.svg +3 -0
- package/assets/core-vis/markers/filled-diamond.svg +3 -0
- package/assets/core-vis/markers/half-arrowhead.svg +3 -0
- package/assets/core-vis/markers/hollow-arrowhead.svg +3 -0
- package/assets/core-vis/markers/hollow-diamond.svg +3 -0
- package/assets/core-vis/markers/open-arrowhead.svg +3 -0
- package/fixtures/interoperability/archimate4-demo.trig +259 -0
- package/fixtures/interoperability/expected-findings.json +26 -0
- package/fixtures/interoperability/shop-seed.ttl +225 -0
- package/package.json +136 -4
- package/scripts/sync-assets.mjs +252 -0
- package/src/conformance.ts +66 -0
- package/src/import-export/model-io.ts +426 -0
- package/src/index.ts +11 -0
- package/src/metamodel-manager/asset-sources.ts +754 -0
- package/src/metamodel-manager/bundled-assets.ts +599 -0
- package/src/metamodel-manager/catalogue.ts +114 -0
- package/src/metamodel-manager/class-hierarchy.ts +155 -0
- package/src/metamodel-manager/index.ts +65 -0
- package/src/metamodel-manager/interfaces.ts +422 -0
- package/src/metamodel-manager/metamodel-completeness.ts +162 -0
- package/src/metamodel-manager/metamodel-loader.ts +864 -0
- package/src/metamodel-manager/notation-resolver.ts +284 -0
- package/src/metamodel-manager/notation.ts +659 -0
- package/src/metamodel-manager/palette-generator.ts +882 -0
- package/src/metamodel-manager/property-shapes.ts +290 -0
- package/src/metamodel-manager/taxonomy.ts +904 -0
- package/src/metamodel-manager/type-guide.ts +241 -0
- package/src/metamodel-manager/viewpoint-manager.ts +147 -0
- package/src/model-manager/appearance.ts +389 -0
- package/src/model-manager/cascade.ts +246 -0
- package/src/model-manager/clipboard.ts +566 -0
- package/src/model-manager/context-names.ts +108 -0
- package/src/model-manager/custom-properties.ts +549 -0
- package/src/model-manager/derivations.ts +166 -0
- package/src/model-manager/direct-permissions.ts +182 -0
- package/src/model-manager/drawing-order.ts +119 -0
- package/src/model-manager/element-manager.ts +69 -0
- package/src/model-manager/element-pictures.ts +118 -0
- package/src/model-manager/field-names.ts +42 -0
- package/src/model-manager/folders.ts +354 -0
- package/src/model-manager/grid.ts +6 -0
- package/src/model-manager/index.ts +43 -0
- package/src/model-manager/interfaces.ts +417 -0
- package/src/model-manager/iri-conformance.ts +183 -0
- package/src/model-manager/label-expression.ts +233 -0
- package/src/model-manager/legacy-migration.ts +200 -0
- package/src/model-manager/missing-references.ts +86 -0
- package/src/model-manager/model-diff-text.ts +150 -0
- package/src/model-manager/model-diff.ts +534 -0
- package/src/model-manager/model-merge.ts +1160 -0
- package/src/model-manager/model-namespace.ts +199 -0
- package/src/model-manager/model-operations.ts +132 -0
- package/src/model-manager/model-queries.ts +616 -0
- package/src/model-manager/model-session.ts +759 -0
- package/src/model-manager/multiplicity.ts +74 -0
- package/src/model-manager/nested-resources.ts +145 -0
- package/src/model-manager/own-metamodel.ts +157 -0
- package/src/model-manager/placement-copy.ts +116 -0
- package/src/model-manager/property-catalog.ts +787 -0
- package/src/model-manager/proposal-order.ts +203 -0
- package/src/model-manager/provenance.ts +396 -0
- package/src/model-manager/questions.ts +470 -0
- package/src/model-manager/rdf-scope.ts +97 -0
- package/src/model-manager/relationship-graph.ts +462 -0
- package/src/model-manager/relationship-manager.ts +962 -0
- package/src/model-manager/relationship-table.ts +189 -0
- package/src/model-manager/relationship-validity.ts +261 -0
- package/src/model-manager/resource-edits.ts +28 -0
- package/src/model-manager/short-hash.ts +104 -0
- package/src/model-manager/snapshot-lines.ts +88 -0
- package/src/model-manager/version-history.ts +205 -0
- package/src/model-manager/view-from-results.ts +81 -0
- package/src/model-manager/view-manager.ts +1410 -0
- package/src/model-manager/vocabulary.ts +279 -0
- package/src/rdf-engine/finding-shape.ts +23 -0
- package/src/rdf-engine/graph-scope.ts +163 -0
- package/src/rdf-engine/index.ts +7 -0
- package/src/rdf-engine/interfaces.ts +144 -0
- package/src/rdf-engine/iri.ts +203 -0
- package/src/rdf-engine/localized-text.ts +13 -0
- package/src/rdf-engine/namespaces.ts +41 -0
- package/src/rdf-engine/observable-store.ts +631 -0
- package/src/rdf-engine/rdf-store.ts +508 -0
- package/src/rdf-engine/shacl-validator.ts +602 -0
- package/src/rdf-engine/shape-reach.ts +140 -0
- package/src/rdf-engine/shape-switches.ts +165 -0
- package/src/rdf-engine/single-valued.ts +219 -0
- package/src/rdf-engine/sparql-constraints.ts +334 -0
- package/src/rdf-engine/term-codec.ts +51 -0
- package/src/rdf-engine/ttl-parser.ts +51 -0
- package/src/rdf-engine/ttl-serializer.ts +79 -0
- package/src/rdf-engine/turtle-writer.ts +284 -0
- package/src/rdf-engine/validation-engine.ts +682 -0
- package/src/rdf-engine/validation-service.ts +184 -0
- package/src/rdf-engine/validation.worker.ts +47 -0
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which visual notation applies to a class — the one lookup the palette and the
|
|
3
|
+
* canvas both use (Req 2.16).
|
|
4
|
+
*
|
|
5
|
+
* `notation.ts` reads a notation set out of the graph. A set rarely describes
|
|
6
|
+
* every class that has to be drawn: a generic set such as Basic describes
|
|
7
|
+
* `arch:Element`, `arch:QualifiedRelationship` and its own two relationship
|
|
8
|
+
* classes, and with several metamodels loaded only one set is active.
|
|
9
|
+
*
|
|
10
|
+
* For a class C, the active set A is the set that the active presentation
|
|
11
|
+
* context names with `arch:usesNotationSet`, or else the primary metamodel's
|
|
12
|
+
* `arch:notationSet`. The fallback layers F are the default sets
|
|
13
|
+
* (`arch:notationSet`) of all loaded metamodels except A itself, in load order,
|
|
14
|
+
* then the core notation's ({@link coreNotationSetIris}), which no manifest
|
|
15
|
+
* names: it draws the core's own relationship types. F includes the default set
|
|
16
|
+
* of A's own metamodel when a presentation context picked an alternative set.
|
|
17
|
+
*
|
|
18
|
+
* 1. A descriptor in A for C.
|
|
19
|
+
* 2. A descriptor for C in F, the first match in load order.
|
|
20
|
+
* 3. C's own `arch:prefVisNotation`.
|
|
21
|
+
* 4. A descriptor for the nearest superclass of C that has one in A or F. The
|
|
22
|
+
* walk goes breadth-first over `rdfs:subClassOf`: by distance first, and
|
|
23
|
+
* superclasses at the same distance in IRI order. It stops at `arch:Element`
|
|
24
|
+
* and `arch:QualifiedRelationship`. For each superclass, A is checked first,
|
|
25
|
+
* then F in load order.
|
|
26
|
+
* 5. Built-in defaults. Elements: a rectangle with a white fill and a black
|
|
27
|
+
* line. Relationships: a solid black line.
|
|
28
|
+
*
|
|
29
|
+
* Anything published for the class itself beats anything inherited; among
|
|
30
|
+
* inherited descriptors the nearest ancestor wins; the active set only breaks
|
|
31
|
+
* ties.
|
|
32
|
+
*
|
|
33
|
+
* So an active generic set cannot flatten another language's own notation:
|
|
34
|
+
* ArchiMate's composition keeps its filled diamond with Basic active (step 2).
|
|
35
|
+
* And an extension subclass of `am4:BusinessActor` with nothing of its own takes
|
|
36
|
+
* ArchiMate's Business Actor descriptor (distance 1) rather than an active
|
|
37
|
+
* generic set's `arch:Element` (distance 2 or more), so subclasses inherit their
|
|
38
|
+
* parent's appearance (AM-DD-2 in
|
|
39
|
+
* `linked-archi-meta/doc/guide/archimate/design-decisions.md`). The walk is
|
|
40
|
+
* `superClassesNearestFirst` in `class-hierarchy.ts`.
|
|
41
|
+
*
|
|
42
|
+
* The visual notation guide in `linked-archi-meta`
|
|
43
|
+
* (`doc/guide/visual-notation-guide.md`, Fallback Logic) documents the same
|
|
44
|
+
* order.
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
import { DataFactory } from 'n3';
|
|
48
|
+
import type { Store } from 'n3';
|
|
49
|
+
import { NAMESPACES } from '../rdf-engine/namespaces.js';
|
|
50
|
+
import { compareIris, superClassesNearestFirst } from './class-hierarchy.js';
|
|
51
|
+
import {
|
|
52
|
+
buildVisualNotations,
|
|
53
|
+
CORE_NOTATION_NS,
|
|
54
|
+
type NotationSet,
|
|
55
|
+
type RelationshipVisualStyle,
|
|
56
|
+
type RenderingMode,
|
|
57
|
+
type VisualNotation,
|
|
58
|
+
type VisualStyle,
|
|
59
|
+
} from './notation.js';
|
|
60
|
+
|
|
61
|
+
const { namedNode } = DataFactory;
|
|
62
|
+
|
|
63
|
+
const RDF_TYPE = `${NAMESPACES.rdf}type`;
|
|
64
|
+
const ARCH_METAMODEL = `${NAMESPACES.arch}Metamodel`;
|
|
65
|
+
const ARCH_NOTATION_SET = `${NAMESPACES.arch}notationSet`;
|
|
66
|
+
const ARCH_PREF_VIS_NOTATION = `${NAMESPACES.arch}prefVisNotation`;
|
|
67
|
+
const ARCH_VIS_NOTATION_SET = `${NAMESPACES['arch-vis']}NotationSet`;
|
|
68
|
+
|
|
69
|
+
/** Which step of the lookup produced an answer, in lookup order. */
|
|
70
|
+
export type NotationSource =
|
|
71
|
+
/** 1. The active set describes the class itself. */
|
|
72
|
+
| 'active'
|
|
73
|
+
/** 2. A fallback layer describes the class itself. */
|
|
74
|
+
| 'fallback'
|
|
75
|
+
/** 3. Only the class's own `arch:prefVisNotation`. */
|
|
76
|
+
| 'pref-vis-notation'
|
|
77
|
+
/** 4. The nearest described superclass has its descriptor in the active set. */
|
|
78
|
+
| 'active-superclass'
|
|
79
|
+
/** 4. The nearest described superclass has its descriptor in a fallback layer only. */
|
|
80
|
+
| 'fallback-superclass'
|
|
81
|
+
/** 5. Nothing applies; renderers use their built-in defaults. */
|
|
82
|
+
| 'default';
|
|
83
|
+
|
|
84
|
+
/** The answer for one class. */
|
|
85
|
+
export interface ResolvedNotation {
|
|
86
|
+
source: NotationSource;
|
|
87
|
+
/** The descriptor that applies. Absent for `pref-vis-notation` and `default`. */
|
|
88
|
+
notation?: VisualNotation;
|
|
89
|
+
/** The class the descriptor was published for: the class itself or the superclass it inherits from. */
|
|
90
|
+
matchedClassIri?: string;
|
|
91
|
+
/** The set the descriptor belongs to. */
|
|
92
|
+
notationSetIri?: string;
|
|
93
|
+
/**
|
|
94
|
+
* The pre-rendered image to show. For an exact descriptor (1, 2) the
|
|
95
|
+
* descriptor's own image, else the class's; for 3 the class's own; for an
|
|
96
|
+
* inherited one (4) the descriptor's, since the class takes that look.
|
|
97
|
+
*/
|
|
98
|
+
prefVisNotation?: string;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* The resolved notation of one class as plain data, for the canvas.
|
|
103
|
+
*
|
|
104
|
+
* `PaletteGenerator` emits one per class it can resolve (`notationIndex`), so a
|
|
105
|
+
* renderer can style a type the palette does not list — a class no taxonomy
|
|
106
|
+
* names — from the same answer the palette would have given.
|
|
107
|
+
*/
|
|
108
|
+
export interface NotationIndexEntry {
|
|
109
|
+
source: NotationSource;
|
|
110
|
+
notationSetIri?: string;
|
|
111
|
+
matchedClassIri?: string;
|
|
112
|
+
/** Element style, with the icon URL already resolved for offline use. */
|
|
113
|
+
style?: VisualStyle;
|
|
114
|
+
/** Rendering mode after the notation guide's fallbacks. */
|
|
115
|
+
renderingMode?: RenderingMode;
|
|
116
|
+
relationshipStyle?: RelationshipVisualStyle;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* The layered lookup over one active set and its fallback sets.
|
|
121
|
+
*
|
|
122
|
+
* Answers are memoised per class: a palette asks for each class once, the
|
|
123
|
+
* notation index asks again for every class in the graph.
|
|
124
|
+
*/
|
|
125
|
+
export class NotationResolver {
|
|
126
|
+
private readonly cache = new Map<string, ResolvedNotation>();
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* @param graph Snapshot holding the classes, their `rdfs:subClassOf` and `arch:prefVisNotation`.
|
|
130
|
+
* @param active The set chosen for this palette, or `null` when none resolved.
|
|
131
|
+
* @param fallbacks The fallback layers: every loaded metamodel's default set
|
|
132
|
+
* except the active set, in load order. That includes the active context's
|
|
133
|
+
* own metamodel default when a context picked an alternative set (see
|
|
134
|
+
* {@link orderedFallbackSets}).
|
|
135
|
+
* @param superClassMap Direct parents per class (`buildSuperClassMap`).
|
|
136
|
+
*/
|
|
137
|
+
constructor(
|
|
138
|
+
private readonly graph: Store,
|
|
139
|
+
private readonly active: NotationSet | null,
|
|
140
|
+
private readonly fallbacks: readonly NotationSet[],
|
|
141
|
+
private readonly superClassMap: ReadonlyMap<string, readonly string[]>,
|
|
142
|
+
) {}
|
|
143
|
+
|
|
144
|
+
resolve(classIri: string): ResolvedNotation {
|
|
145
|
+
const cached = this.cache.get(classIri);
|
|
146
|
+
if (cached) return cached;
|
|
147
|
+
const resolved = this.lookup(classIri);
|
|
148
|
+
this.cache.set(classIri, resolved);
|
|
149
|
+
return resolved;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
private lookup(classIri: string): ResolvedNotation {
|
|
153
|
+
const own = ownPrefVisNotation(this.graph, classIri);
|
|
154
|
+
|
|
155
|
+
// 1. The active set, the class itself.
|
|
156
|
+
const exact = this.active?.notations.get(classIri);
|
|
157
|
+
if (exact) return exactMatch('active', exact, classIri, own);
|
|
158
|
+
|
|
159
|
+
// 2. The fallback layers, the class itself, in load order.
|
|
160
|
+
for (const set of this.fallbacks) {
|
|
161
|
+
const notation = set.notations.get(classIri);
|
|
162
|
+
if (notation) return exactMatch('fallback', notation, classIri, own);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// 3. The class's own pre-rendered image.
|
|
166
|
+
if (own) return { source: 'pref-vis-notation', prefVisNotation: own };
|
|
167
|
+
|
|
168
|
+
// Nothing is published for the class itself, so it inherits a look.
|
|
169
|
+
// 4. The nearest superclass with a descriptor in A or F: A first, then F in load order.
|
|
170
|
+
for (const superClass of superClassesNearestFirst(classIri, this.superClassMap)) {
|
|
171
|
+
const inActive = this.active?.notations.get(superClass);
|
|
172
|
+
if (inActive) return inheritedMatch('active-superclass', inActive);
|
|
173
|
+
for (const set of this.fallbacks) {
|
|
174
|
+
const notation = set.notations.get(superClass);
|
|
175
|
+
if (notation) return inheritedMatch('fallback-superclass', notation);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// 5. Nothing: the renderer's built-in defaults.
|
|
180
|
+
return { source: 'default' };
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* The fallback layers F, in order: every loaded metamodel's default set except
|
|
186
|
+
* the active set, skipping repeats and sets with no descriptors (or no data
|
|
187
|
+
* loaded).
|
|
188
|
+
*
|
|
189
|
+
* Only the active set's own IRI is dropped. When a presentation context picked
|
|
190
|
+
* an alternative set, the default set of the active context's own metamodel is
|
|
191
|
+
* therefore a layer too, so a class the alternative does not describe keeps
|
|
192
|
+
* that default's look.
|
|
193
|
+
*
|
|
194
|
+
* @param defaultSetIris The loaded metamodels' `arch:notationSet` values in load
|
|
195
|
+
* order, or {@link storeDefaultNotationSetIris} when the caller has no order.
|
|
196
|
+
*/
|
|
197
|
+
export function orderedFallbackSets(
|
|
198
|
+
graph: Store,
|
|
199
|
+
activeIri: string | undefined,
|
|
200
|
+
defaultSetIris: readonly string[],
|
|
201
|
+
): NotationSet[] {
|
|
202
|
+
const seen = new Set<string>();
|
|
203
|
+
const sets: NotationSet[] = [];
|
|
204
|
+
for (const iri of defaultSetIris) {
|
|
205
|
+
if (seen.has(iri)) continue;
|
|
206
|
+
seen.add(iri);
|
|
207
|
+
if (iri === activeIri) continue;
|
|
208
|
+
const set = buildVisualNotations(graph, iri);
|
|
209
|
+
if (set) sets.push(set);
|
|
210
|
+
}
|
|
211
|
+
return sets;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Every `arch:Metamodel`'s `arch:notationSet` in the graph, ordered by
|
|
216
|
+
* metamodel IRI and then set IRI.
|
|
217
|
+
*
|
|
218
|
+
* The graph does not record load order, so this is the deterministic stand-in
|
|
219
|
+
* when a caller passes none (tests, a palette generated outside the app).
|
|
220
|
+
*/
|
|
221
|
+
export function storeDefaultNotationSetIris(graph: Store): string[] {
|
|
222
|
+
const pairs: Array<[metamodel: string, set: string]> = [];
|
|
223
|
+
for (const metamodel of graph.getSubjects(namedNode(RDF_TYPE), namedNode(ARCH_METAMODEL), null)) {
|
|
224
|
+
if (metamodel.termType !== 'NamedNode') continue;
|
|
225
|
+
for (const set of graph.getObjects(metamodel, namedNode(ARCH_NOTATION_SET), null)) {
|
|
226
|
+
if (set.termType === 'NamedNode') pairs.push([metamodel.value, set.value]);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
pairs.sort(([m1, s1], [m2, s2]) => compareIris(m1, m2) || compareIris(s1, s2));
|
|
230
|
+
return [...new Set(pairs.map(([, set]) => set))];
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* The core notation's sets (`core/core-notation.ttl`), in IRI order: the last
|
|
235
|
+
* fallback layers, after every loaded metamodel's default set (VC-DD-5). No
|
|
236
|
+
* manifest names them — they draw the core's own relationship types, whatever
|
|
237
|
+
* the language: Association, Depends On, and Has Part and Refines, which
|
|
238
|
+
* nesting may draw with the part or the refining concept inside — so a
|
|
239
|
+
* language's own descriptor for a core class comes first.
|
|
240
|
+
*/
|
|
241
|
+
export function coreNotationSetIris(graph: Store): string[] {
|
|
242
|
+
const sets = graph
|
|
243
|
+
.getSubjects(namedNode(RDF_TYPE), namedNode(ARCH_VIS_NOTATION_SET), null)
|
|
244
|
+
.filter((set) => set.termType === 'NamedNode' && set.value.startsWith(CORE_NOTATION_NS))
|
|
245
|
+
.map((set) => set.value);
|
|
246
|
+
return [...new Set(sets)].sort(compareIris);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
function exactMatch(
|
|
250
|
+
source: 'active' | 'fallback',
|
|
251
|
+
notation: VisualNotation,
|
|
252
|
+
classIri: string,
|
|
253
|
+
own: string | undefined,
|
|
254
|
+
): ResolvedNotation {
|
|
255
|
+
const prefVisNotation = notation.prefVisNotation ?? own;
|
|
256
|
+
return {
|
|
257
|
+
source,
|
|
258
|
+
notation,
|
|
259
|
+
matchedClassIri: classIri,
|
|
260
|
+
notationSetIri: notation.notationSetIri,
|
|
261
|
+
...(prefVisNotation ? { prefVisNotation } : {}),
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
function inheritedMatch(
|
|
266
|
+
source: 'active-superclass' | 'fallback-superclass',
|
|
267
|
+
notation: VisualNotation,
|
|
268
|
+
): ResolvedNotation {
|
|
269
|
+
return {
|
|
270
|
+
source,
|
|
271
|
+
notation,
|
|
272
|
+
matchedClassIri: notation.conceptIri,
|
|
273
|
+
notationSetIri: notation.notationSetIri,
|
|
274
|
+
...(notation.prefVisNotation ? { prefVisNotation: notation.prefVisNotation } : {}),
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/** The class's own `arch:prefVisNotation`: the first object, whatever its term type, as the palette always read it. */
|
|
279
|
+
function ownPrefVisNotation(graph: Store, classIri: string): string | undefined {
|
|
280
|
+
for (const object of graph.getObjects(namedNode(classIri), namedNode(ARCH_PREF_VIS_NOTATION), null)) {
|
|
281
|
+
return object.value;
|
|
282
|
+
}
|
|
283
|
+
return undefined;
|
|
284
|
+
}
|