deriva-cli 0.0.1__tar.gz → 0.8.0__tar.gz
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.
- deriva_cli-0.8.0/PKG-INFO +83 -0
- deriva_cli-0.8.0/deriva/adapters/archimate/README.md +98 -0
- deriva_cli-0.8.0/deriva/adapters/archimate/__init__.py +48 -0
- deriva_cli-0.8.0/deriva/adapters/archimate/archimate_xsd/documentation/Diagram.html +4741 -0
- deriva_cli-0.8.0/deriva/adapters/archimate/archimate_xsd/documentation/View.html +2998 -0
- deriva_cli-0.8.0/deriva/adapters/archimate/archimate_xsd/documentation/model.html +15980 -0
- deriva_cli-0.8.0/deriva/adapters/archimate/archimate_xsd/examples/archimate3_Diagram.xsd +554 -0
- deriva_cli-0.8.0/deriva/adapters/archimate/archimate_xsd/examples/archimate3_Model.xsd +1340 -0
- deriva_cli-0.8.0/deriva/adapters/archimate/archimate_xsd/examples/archimate3_View.xsd +321 -0
- deriva_cli-0.8.0/deriva/adapters/archimate/archimate_xsd/schemas/archimate3_Diagram.xsd +554 -0
- deriva_cli-0.8.0/deriva/adapters/archimate/archimate_xsd/schemas/archimate3_Model.xsd +1340 -0
- deriva_cli-0.8.0/deriva/adapters/archimate/archimate_xsd/schemas/archimate3_View.xsd +321 -0
- deriva_cli-0.8.0/deriva/adapters/archimate/archimate_xsd/snippets/Interoperability testing snippet-1.xml +560 -0
- deriva_cli-0.8.0/deriva/adapters/archimate/archimate_xsd/snippets/Interoperability testing snippet-10.xml +1180 -0
- deriva_cli-0.8.0/deriva/adapters/archimate/archimate_xsd/snippets/Interoperability testing snippet-2.xml +631 -0
- deriva_cli-0.8.0/deriva/adapters/archimate/archimate_xsd/snippets/Interoperability testing snippet-3.xml +541 -0
- deriva_cli-0.8.0/deriva/adapters/archimate/archimate_xsd/snippets/Interoperability testing snippet-4.xml +698 -0
- deriva_cli-0.8.0/deriva/adapters/archimate/archimate_xsd/snippets/Interoperability testing snippet-5.xml +594 -0
- deriva_cli-0.8.0/deriva/adapters/archimate/archimate_xsd/snippets/Interoperability testing snippet-7.xml +360 -0
- deriva_cli-0.8.0/deriva/adapters/archimate/archimate_xsd/snippets/Interoperability testing snippet-8.xml +695 -0
- deriva_cli-0.8.0/deriva/adapters/archimate/archimate_xsd/snippets/Interoperability testing snippet-9.xml +1077 -0
- deriva_cli-0.8.0/deriva/adapters/archimate/manager.py +691 -0
- deriva_cli-0.8.0/deriva/adapters/archimate/models.py +594 -0
- deriva_cli-0.8.0/deriva/adapters/archimate/validation.py +160 -0
- deriva_cli-0.8.0/deriva/adapters/archimate/xml_export.py +242 -0
- deriva_cli-0.8.0/deriva/adapters/database/README.md +183 -0
- deriva_cli-0.8.0/deriva/adapters/database/__init__.py +52 -0
- deriva_cli-0.8.0/deriva/adapters/database/data/derivation_config.json +602 -0
- deriva_cli-0.8.0/deriva/adapters/database/data/derivation_patterns.json +416 -0
- deriva_cli-0.8.0/deriva/adapters/database/data/extraction_config.json +240 -0
- deriva_cli-0.8.0/deriva/adapters/database/data/file_types.json +1490 -0
- deriva_cli-0.8.0/deriva/adapters/database/data/system_settings.json +82 -0
- deriva_cli-0.8.0/deriva/adapters/database/db_tool.py +434 -0
- deriva_cli-0.8.0/deriva/adapters/database/manager.py +298 -0
- deriva_cli-0.8.0/deriva/adapters/database/scripts/7_extraction_params.sql +2 -0
- deriva_cli-0.8.0/deriva/adapters/database/scripts/schema.sql +132 -0
- deriva_cli-0.8.0/deriva/adapters/grafeo/__init__.py +38 -0
- deriva_cli-0.8.0/deriva/adapters/grafeo/manager.py +407 -0
- deriva_cli-0.8.0/deriva/adapters/graph/README.md +120 -0
- deriva_cli-0.8.0/deriva/adapters/graph/__init__.py +65 -0
- deriva_cli-0.8.0/deriva/adapters/graph/cache.py +101 -0
- deriva_cli-0.8.0/deriva/adapters/graph/manager.py +803 -0
- deriva_cli-0.8.0/deriva/adapters/graph/metamodel.py +128 -0
- deriva_cli-0.8.0/deriva/adapters/graph/models.py +507 -0
- deriva_cli-0.8.0/deriva/adapters/llm/README.md +262 -0
- deriva_cli-0.8.0/deriva/adapters/llm/__init__.py +85 -0
- deriva_cli-0.8.0/deriva/adapters/llm/cache.py +205 -0
- deriva_cli-0.8.0/deriva/adapters/llm/manager.py +877 -0
- deriva_cli-0.8.0/deriva/adapters/llm/model_registry.py +168 -0
- deriva_cli-0.8.0/deriva/adapters/llm/models.py +151 -0
- deriva_cli-0.8.0/deriva/adapters/llm/rate_limiter.py +417 -0
- deriva_cli-0.8.0/deriva/adapters/llm/retry.py +421 -0
- deriva_cli-0.8.0/deriva/adapters/llm/schemas.py +304 -0
- deriva_cli-0.8.0/deriva/adapters/nlp/__init__.py +7 -0
- deriva_cli-0.8.0/deriva/adapters/nlp/extract.py +129 -0
- deriva_cli-0.8.0/deriva/adapters/nlp/language.py +24 -0
- deriva_cli-0.8.0/deriva/adapters/nlp/manager.py +35 -0
- deriva_cli-0.8.0/deriva/adapters/nlp/models.py +162 -0
- deriva_cli-0.8.0/deriva/adapters/nlp/phrases.py +165 -0
- deriva_cli-0.8.0/deriva/adapters/nlp/settings.py +46 -0
- deriva_cli-0.8.0/deriva/adapters/nlp/text.py +133 -0
- deriva_cli-0.8.0/deriva/adapters/nlp/translate.py +54 -0
- deriva_cli-0.8.0/deriva/adapters/repository/README.md +126 -0
- deriva_cli-0.8.0/deriva/adapters/repository/__init__.py +51 -0
- deriva_cli-0.8.0/deriva/adapters/repository/manager.py +853 -0
- deriva_cli-0.8.0/deriva/adapters/repository/models.py +90 -0
- deriva_cli-0.8.0/deriva/adapters/treesitter/__init__.py +21 -0
- deriva_cli-0.8.0/deriva/adapters/treesitter/languages/__init__.py +100 -0
- deriva_cli-0.8.0/deriva/adapters/treesitter/languages/base.py +201 -0
- deriva_cli-0.8.0/deriva/adapters/treesitter/languages/bms.py +158 -0
- deriva_cli-0.8.0/deriva/adapters/treesitter/languages/cobol.py +708 -0
- deriva_cli-0.8.0/deriva/adapters/treesitter/languages/csharp.py +977 -0
- deriva_cli-0.8.0/deriva/adapters/treesitter/languages/java.py +908 -0
- deriva_cli-0.8.0/deriva/adapters/treesitter/languages/javascript.py +1127 -0
- deriva_cli-0.8.0/deriva/adapters/treesitter/languages/jcl.py +381 -0
- deriva_cli-0.8.0/deriva/adapters/treesitter/languages/python.py +925 -0
- deriva_cli-0.8.0/deriva/adapters/treesitter/languages/structural.py +74 -0
- deriva_cli-0.8.0/deriva/adapters/treesitter/manager.py +380 -0
- deriva_cli-0.8.0/deriva/adapters/treesitter/models.py +99 -0
- deriva_cli-0.8.0/deriva/cli/README.md +132 -0
- deriva_cli-0.8.0/deriva/cli/__init__.py +3 -0
- deriva_cli-0.8.0/deriva/cli/cli.py +364 -0
- deriva_cli-0.8.0/deriva/cli/commands/__init__.py +7 -0
- deriva_cli-0.8.0/deriva/cli/commands/config.py +713 -0
- deriva_cli-0.8.0/deriva/cli/commands/repo.py +137 -0
- deriva_cli-0.8.0/deriva/cli/commands/run.py +260 -0
- deriva_cli-0.8.0/deriva/cli/progress.py +607 -0
- deriva_cli-0.8.0/deriva/common/__init__.py +199 -0
- deriva_cli-0.8.0/deriva/common/cache_utils.py +394 -0
- deriva_cli-0.8.0/deriva/common/chunking.py +504 -0
- deriva_cli-0.8.0/deriva/common/document_reader.py +220 -0
- deriva_cli-0.8.0/deriva/common/exceptions.py +171 -0
- deriva_cli-0.8.0/deriva/common/file_utils.py +128 -0
- deriva_cli-0.8.0/deriva/common/json_utils.py +176 -0
- deriva_cli-0.8.0/deriva/common/llm_utils.py +68 -0
- deriva_cli-0.8.0/deriva/common/logging.py +964 -0
- deriva_cli-0.8.0/deriva/common/naming.py +246 -0
- deriva_cli-0.8.0/deriva/common/ocel.py +777 -0
- deriva_cli-0.8.0/deriva/common/paths.py +56 -0
- deriva_cli-0.8.0/deriva/common/schema_utils.py +107 -0
- deriva_cli-0.8.0/deriva/common/settings.py +214 -0
- deriva_cli-0.8.0/deriva/common/time_utils.py +32 -0
- deriva_cli-0.8.0/deriva/common/timing.py +94 -0
- deriva_cli-0.8.0/deriva/common/types.py +710 -0
- deriva_cli-0.8.0/deriva/modules/__init__.py +0 -0
- deriva_cli-0.8.0/deriva/modules/analysis/__init__.py +95 -0
- deriva_cli-0.8.0/deriva/modules/analysis/consistency.py +138 -0
- deriva_cli-0.8.0/deriva/modules/analysis/cross_repo_analysis.py +343 -0
- deriva_cli-0.8.0/deriva/modules/analysis/deviation.py +287 -0
- deriva_cli-0.8.0/deriva/modules/analysis/fit_analysis.py +395 -0
- deriva_cli-0.8.0/deriva/modules/analysis/model_quality.py +90 -0
- deriva_cli-0.8.0/deriva/modules/analysis/run_consistency.py +172 -0
- deriva_cli-0.8.0/deriva/modules/analysis/semantic_matching.py +713 -0
- deriva_cli-0.8.0/deriva/modules/analysis/stability_analysis.py +643 -0
- deriva_cli-0.8.0/deriva/modules/analysis/types.py +615 -0
- deriva_cli-0.8.0/deriva/modules/derivation/__init__.py +93 -0
- deriva_cli-0.8.0/deriva/modules/derivation/application_component.py +115 -0
- deriva_cli-0.8.0/deriva/modules/derivation/application_interface.py +104 -0
- deriva_cli-0.8.0/deriva/modules/derivation/application_service.py +233 -0
- deriva_cli-0.8.0/deriva/modules/derivation/base.py +3554 -0
- deriva_cli-0.8.0/deriva/modules/derivation/business_actor.py +296 -0
- deriva_cli-0.8.0/deriva/modules/derivation/business_event.py +198 -0
- deriva_cli-0.8.0/deriva/modules/derivation/business_function.py +95 -0
- deriva_cli-0.8.0/deriva/modules/derivation/business_object.py +223 -0
- deriva_cli-0.8.0/deriva/modules/derivation/business_process.py +244 -0
- deriva_cli-0.8.0/deriva/modules/derivation/component_services.py +265 -0
- deriva_cli-0.8.0/deriva/modules/derivation/data_object.py +80 -0
- deriva_cli-0.8.0/deriva/modules/derivation/device.py +77 -0
- deriva_cli-0.8.0/deriva/modules/derivation/element_base.py +1829 -0
- deriva_cli-0.8.0/deriva/modules/derivation/node.py +87 -0
- deriva_cli-0.8.0/deriva/modules/derivation/prep.py +292 -0
- deriva_cli-0.8.0/deriva/modules/derivation/refine/__init__.py +67 -0
- deriva_cli-0.8.0/deriva/modules/derivation/refine/base.py +408 -0
- deriva_cli-0.8.0/deriva/modules/derivation/refine/circular_relationships.py +251 -0
- deriva_cli-0.8.0/deriva/modules/derivation/refine/cross_layer.py +385 -0
- deriva_cli-0.8.0/deriva/modules/derivation/refine/duplicate_elements.py +266 -0
- deriva_cli-0.8.0/deriva/modules/derivation/refine/duplicate_relationships.py +237 -0
- deriva_cli-0.8.0/deriva/modules/derivation/refine/graph_relationships.py +350 -0
- deriva_cli-0.8.0/deriva/modules/derivation/refine/joint.py +455 -0
- deriva_cli-0.8.0/deriva/modules/derivation/refine/joint_consistency.py +191 -0
- deriva_cli-0.8.0/deriva/modules/derivation/refine/normalization.py +110 -0
- deriva_cli-0.8.0/deriva/modules/derivation/refine/orphan_elements.py +164 -0
- deriva_cli-0.8.0/deriva/modules/derivation/refine/relationship_consolidation.py +299 -0
- deriva_cli-0.8.0/deriva/modules/derivation/refine/structural_consistency.py +335 -0
- deriva_cli-0.8.0/deriva/modules/derivation/system_software.py +84 -0
- deriva_cli-0.8.0/deriva/modules/derivation/technology_service.py +83 -0
- deriva_cli-0.8.0/deriva/modules/extraction/__init__.py +251 -0
- deriva_cli-0.8.0/deriva/modules/extraction/base.py +715 -0
- deriva_cli-0.8.0/deriva/modules/extraction/business_concept.py +51 -0
- deriva_cli-0.8.0/deriva/modules/extraction/classification.py +290 -0
- deriva_cli-0.8.0/deriva/modules/extraction/concept_candidates.py +371 -0
- deriva_cli-0.8.0/deriva/modules/extraction/directory.py +253 -0
- deriva_cli-0.8.0/deriva/modules/extraction/directory_classification.py +471 -0
- deriva_cli-0.8.0/deriva/modules/extraction/edges.py +1505 -0
- deriva_cli-0.8.0/deriva/modules/extraction/external_dependency.py +1058 -0
- deriva_cli-0.8.0/deriva/modules/extraction/file.py +306 -0
- deriva_cli-0.8.0/deriva/modules/extraction/method.py +675 -0
- deriva_cli-0.8.0/deriva/modules/extraction/repository.py +121 -0
- deriva_cli-0.8.0/deriva/modules/extraction/technology_candidates.py +427 -0
- deriva_cli-0.8.0/deriva/modules/extraction/test.py +431 -0
- deriva_cli-0.8.0/deriva/modules/extraction/type_definition.py +706 -0
- deriva_cli-0.8.0/deriva/services/__init__.py +51 -0
- deriva_cli-0.8.0/deriva/services/about.py +31 -0
- deriva_cli-0.8.0/deriva/services/config.py +1818 -0
- deriva_cli-0.8.0/deriva/services/config_models.py +128 -0
- deriva_cli-0.8.0/deriva/services/derivation.py +1849 -0
- deriva_cli-0.8.0/deriva/services/export_bundle.py +195 -0
- deriva_cli-0.8.0/deriva/services/extraction.py +1959 -0
- deriva_cli-0.8.0/deriva/services/llm_log.py +146 -0
- deriva_cli-0.8.0/deriva/services/model_configs.py +219 -0
- deriva_cli-0.8.0/deriva/services/ontology.py +99 -0
- deriva_cli-0.8.0/deriva/services/overfit.py +37 -0
- deriva_cli-0.8.0/deriva/services/pipeline.py +255 -0
- deriva_cli-0.8.0/deriva/services/session.py +1252 -0
- deriva_cli-0.8.0/deriva/services/trace.py +79 -0
- deriva_cli-0.8.0/packages/README-deriva-cli.md +23 -0
- deriva_cli-0.8.0/pyproject.toml +216 -0
- deriva_cli-0.8.0/pyproject.toml.orig +239 -0
- deriva_cli-0.0.1/PKG-INFO +0 -25
- deriva_cli-0.0.1/README.md +0 -11
- deriva_cli-0.0.1/pyproject.toml +0 -26
- deriva_cli-0.0.1/pyproject.toml.orig +0 -26
- deriva_cli-0.0.1/src/deriva_cli_placeholder/__init__.py +0 -1
- {deriva_cli-0.0.1 → deriva_cli-0.8.0}/LICENSE +0 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: deriva-cli
|
|
3
|
+
Version: 0.8.0
|
|
4
|
+
Summary: Deriva is a research project aimed at enabling digital architects by automating the derivation of enterprise architecture models. Deriva uses dual knowledge graphs, heuristics and LLM's.
|
|
5
|
+
Keywords: archimate,enterprise-architecture,code-analysis,llm,grafeo,fastapi
|
|
6
|
+
Author: S. T. Grond
|
|
7
|
+
Author-email: S. T. Grond <steven@deriva.dev>
|
|
8
|
+
License-Expression: AGPL-3.0-or-later
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Environment :: Web Environment
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: Intended Audience :: Information Technology
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
18
|
+
Classifier: Topic :: Software Development :: Documentation
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
21
|
+
Classifier: Typing :: Typed
|
|
22
|
+
Requires-Dist: pydantic>=2
|
|
23
|
+
Requires-Dist: pydantic-settings>=2
|
|
24
|
+
Requires-Dist: python-dotenv>=1.2
|
|
25
|
+
Requires-Dist: pyyaml>=6.0
|
|
26
|
+
Requires-Dist: rich>=15
|
|
27
|
+
Requires-Dist: lxml>=6
|
|
28
|
+
Requires-Dist: duckdb>=1.5
|
|
29
|
+
Requires-Dist: grafeo>=0.6.0b1
|
|
30
|
+
Requires-Dist: sqlglot>=30
|
|
31
|
+
Requires-Dist: tree-sitter>=0.26
|
|
32
|
+
Requires-Dist: tree-sitter-python>=0.23.0
|
|
33
|
+
Requires-Dist: tree-sitter-javascript>=0.23.0
|
|
34
|
+
Requires-Dist: tree-sitter-java>=0.23.0
|
|
35
|
+
Requires-Dist: tree-sitter-c-sharp>=0.23
|
|
36
|
+
Requires-Dist: pypdf>=6
|
|
37
|
+
Requires-Dist: python-docx>=1.2
|
|
38
|
+
Requires-Dist: spacy==3.8.16
|
|
39
|
+
Requires-Dist: ctranslate2==4.8.2
|
|
40
|
+
Requires-Dist: sentencepiece==0.2.2
|
|
41
|
+
Requires-Dist: solvor>=0.6.3
|
|
42
|
+
Requires-Dist: backoff>=2.2.1
|
|
43
|
+
Requires-Dist: pydantic-ai>=2.55
|
|
44
|
+
Requires-Dist: authlib>=1.8.0
|
|
45
|
+
Requires-Dist: pyasn1>=0.6.4
|
|
46
|
+
Requires-Dist: pyjwt>=2.15
|
|
47
|
+
Requires-Dist: diskcache>=5.6.3
|
|
48
|
+
Requires-Dist: nest-asyncio>=1.6.0
|
|
49
|
+
Requires-Dist: structlog>=26.1.0
|
|
50
|
+
Requires-Dist: typer>=0.27
|
|
51
|
+
Requires-Dist: httpx>=0.28.1
|
|
52
|
+
Requires-Dist: pydantic-ai-slim[mistral]>=2.55
|
|
53
|
+
Requires-Python: >=3.14
|
|
54
|
+
Project-URL: Homepage, https://deriva.dev
|
|
55
|
+
Project-URL: Documentation, https://docs.deriva.dev
|
|
56
|
+
Project-URL: Repository, https://github.com/StevenBtw/deriva
|
|
57
|
+
Project-URL: Issues, https://github.com/StevenBtw/deriva/issues
|
|
58
|
+
Project-URL: Changelog, https://github.com/StevenBtw/deriva/blob/main/CHANGELOG.md
|
|
59
|
+
Description-Content-Type: text/markdown
|
|
60
|
+
|
|
61
|
+
# Deriva CLI
|
|
62
|
+
|
|
63
|
+
**From code repositories to ArchiMate models, from the command line.**
|
|
64
|
+
|
|
65
|
+
Deriva reads a software repository, builds a graph of what is in it, and derives an [ArchiMate](https://www.opengroup.org/archimate-forum) enterprise architecture model you can open in [Archi](https://www.archimatetool.com/). `deriva-cli` runs the whole pipeline without a browser, for scripts, CI jobs and servers.
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
uv tool install --python 3.14 deriva-cli
|
|
69
|
+
|
|
70
|
+
deriva-cli repo clone https://github.com/user/my-repo.git
|
|
71
|
+
deriva-cli run all --repo my-repo -v
|
|
72
|
+
deriva-cli export -o model.xml --repo my-repo
|
|
73
|
+
deriva-cli status
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
- Configuration from the command line: `deriva-cli config list derivation`, `deriva-cli config show extraction BusinessConcept`; every change is a new version, earlier versions stay.
|
|
77
|
+
- Models are configured in `.env` in the home folder `~/.deriva` (`DERIVA_HOME` moves it).
|
|
78
|
+
- For the local web interface install [deriva-studio](https://pypi.org/project/deriva-studio/); for benchmarking, [deriva-dev](https://pypi.org/project/deriva-dev/).
|
|
79
|
+
- Install it as a tool or in its own environment: its Python package is named `deriva`, like ISI's `deriva-py`, and the two cannot share an environment.
|
|
80
|
+
|
|
81
|
+
Documentation: https://docs.deriva.dev. Source and releases: https://github.com/StevenBtw/deriva
|
|
82
|
+
|
|
83
|
+
Deriva is part of a research project on AI-assisted domain modeling. License: AGPL-3.0-or-later.
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# ArchiMate Adapter
|
|
2
|
+
|
|
3
|
+
Create, validate, and export ArchiMate enterprise architecture models using grafeo (embedded).
|
|
4
|
+
|
|
5
|
+
**Version:** 2.0.0
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
The ArchiMate adapter stores derived ArchiMate elements and relationships in grafeo (namespace: `Model`), validates them against the ArchiMate 3.2 metamodel, and exports to XML format compatible with the [Archi](https://www.archimatetool.com/) modeling tool.
|
|
10
|
+
|
|
11
|
+
## Key Exports
|
|
12
|
+
|
|
13
|
+
```python
|
|
14
|
+
from deriva.adapters.archimate import (
|
|
15
|
+
ArchimateManager, # Main service class
|
|
16
|
+
Element, # ArchiMate element dataclass
|
|
17
|
+
Relationship, # ArchiMate relationship dataclass
|
|
18
|
+
ArchiMateMetamodel, # Metamodel validation rules
|
|
19
|
+
ArchiMateValidator, # Validation logic
|
|
20
|
+
ArchiMateXMLExporter, # XML export
|
|
21
|
+
ValidationError, # Validation exception
|
|
22
|
+
)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Basic Usage
|
|
26
|
+
|
|
27
|
+
```python
|
|
28
|
+
from deriva.adapters.archimate import ArchimateManager, Element, Relationship
|
|
29
|
+
|
|
30
|
+
with ArchimateManager() as am:
|
|
31
|
+
# Create elements
|
|
32
|
+
component = Element(
|
|
33
|
+
name="Authentication Module",
|
|
34
|
+
element_type="ApplicationComponent",
|
|
35
|
+
documentation="Handles user authentication"
|
|
36
|
+
)
|
|
37
|
+
am.add_element(component)
|
|
38
|
+
|
|
39
|
+
# Create relationships
|
|
40
|
+
rel = Relationship(
|
|
41
|
+
source=component.identifier,
|
|
42
|
+
target=other.identifier,
|
|
43
|
+
relationship_type="Serving"
|
|
44
|
+
)
|
|
45
|
+
am.add_relationship(rel)
|
|
46
|
+
|
|
47
|
+
# Query elements
|
|
48
|
+
elements = am.get_elements(element_type="ApplicationComponent")
|
|
49
|
+
|
|
50
|
+
# Export to Archi-compatible XML
|
|
51
|
+
am.export_to_xml("model.xml", model_name="My Model")
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## File Structure
|
|
55
|
+
|
|
56
|
+
```text
|
|
57
|
+
deriva/adapters/archimate/
|
|
58
|
+
├── __init__.py # Package exports
|
|
59
|
+
├── manager.py # ArchimateManager class
|
|
60
|
+
├── models.py # Element, Relationship, ArchiMateMetamodel
|
|
61
|
+
├── validation.py # ArchiMateValidator, ValidationError
|
|
62
|
+
└── xml_export.py # ArchiMateXMLExporter
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Supported Types
|
|
66
|
+
|
|
67
|
+
**Element Types** (ArchiMate 3.2):
|
|
68
|
+
|
|
69
|
+
- Application Layer: `ApplicationComponent`, `ApplicationInterface`, `ApplicationService`, `DataObject`
|
|
70
|
+
- Business Layer: `BusinessObject`, `BusinessProcess`, `BusinessFunction`, `BusinessActor`
|
|
71
|
+
- Technology Layer: `Node`, `Device`, `SystemSoftware`, `TechnologyService`
|
|
72
|
+
|
|
73
|
+
**Relationship Types**:
|
|
74
|
+
|
|
75
|
+
- `Composition`, `Aggregation`, `Assignment`, `Realization`
|
|
76
|
+
- `Serving`, `Access`, `Flow`
|
|
77
|
+
|
|
78
|
+
## ArchimateManager Methods
|
|
79
|
+
|
|
80
|
+
| Method | Description |
|
|
81
|
+
|--------|-------------|
|
|
82
|
+
| `add_element(element)` | Add an ArchiMate element |
|
|
83
|
+
| `add_relationship(rel)` | Add a relationship between elements |
|
|
84
|
+
| `get_element(identifier)` | Get element by ID |
|
|
85
|
+
| `get_elements(element_type=None)` | Get all elements (optionally filtered) |
|
|
86
|
+
| `get_relationships(source_id=None)` | Get relationships |
|
|
87
|
+
| `clear_model()` | Clear all ArchiMate data |
|
|
88
|
+
| `export_to_xml(path, model_name)` | Export to Archi XML format |
|
|
89
|
+
| `query(cypher, params)` | Execute custom Cypher query |
|
|
90
|
+
|
|
91
|
+
## Data Isolation
|
|
92
|
+
|
|
93
|
+
Uses grafeo with namespace `Model` for label prefixing (e.g., `Model:ApplicationComponent`), keeping ArchiMate data separate from the Graph namespace.
|
|
94
|
+
|
|
95
|
+
## See Also
|
|
96
|
+
|
|
97
|
+
- [CONTRIBUTING.md](../../../CONTRIBUTING.md) - Architecture and coding guidelines
|
|
98
|
+
- [Archi Tool](https://www.archimatetool.com/) - Open source ArchiMate modeling tool
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"""ArchiMate Manager - Create, validate, and export ArchiMate models using Memgraph.
|
|
2
|
+
|
|
3
|
+
This package provides comprehensive ArchiMate modeling capabilities:
|
|
4
|
+
- Create and manage ArchiMate elements and relationships
|
|
5
|
+
- Validate models against ArchiMate metamodel
|
|
6
|
+
- Store models in Memgraph graph database
|
|
7
|
+
- Export to ArchiMate XML format (compatible with Archi tool)
|
|
8
|
+
|
|
9
|
+
Example:
|
|
10
|
+
>>> from archimate_manager import ArchimateManager, Element, Relationship
|
|
11
|
+
>>>
|
|
12
|
+
>>> with ArchimateManager() as am:
|
|
13
|
+
... # Create elements
|
|
14
|
+
... e1 = Element("Auth Module", "ApplicationComponent")
|
|
15
|
+
... e2 = Element("API Module", "ApplicationComponent")
|
|
16
|
+
... am.add_element(e1)
|
|
17
|
+
... am.add_element(e2)
|
|
18
|
+
...
|
|
19
|
+
... # Create relationship
|
|
20
|
+
... rel = Relationship(e1.identifier, e2.identifier, "Composition")
|
|
21
|
+
... am.add_relationship(rel)
|
|
22
|
+
...
|
|
23
|
+
... # Export to XML
|
|
24
|
+
... from archimate_manager.xml_export import ArchiMateXMLExporter
|
|
25
|
+
... exporter = ArchiMateXMLExporter()
|
|
26
|
+
... elements = am.get_elements()
|
|
27
|
+
... relationships = am.get_relationships()
|
|
28
|
+
... exporter.export(elements, relationships, "model.xml")
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
from __future__ import annotations
|
|
32
|
+
|
|
33
|
+
from .manager import ArchimateManager
|
|
34
|
+
from .models import ArchiMateMetamodel, Element, Relationship
|
|
35
|
+
from .validation import ArchiMateValidator, ValidationError
|
|
36
|
+
from .xml_export import ArchiMateXMLExporter
|
|
37
|
+
|
|
38
|
+
__all__ = [
|
|
39
|
+
"Element",
|
|
40
|
+
"Relationship",
|
|
41
|
+
"ArchimateManager",
|
|
42
|
+
"ArchiMateMetamodel",
|
|
43
|
+
"ArchiMateValidator",
|
|
44
|
+
"ValidationError",
|
|
45
|
+
"ArchiMateXMLExporter",
|
|
46
|
+
]
|
|
47
|
+
|
|
48
|
+
__version__ = "2.0.0"
|