Skip to main content

Convert Arcane XML/AXL configs to JSON and import into Neo4j graph database

Project description

arcane2graph

Executer arcane en sequentiel avec les options suivantes

-A,export_format=xml,export_output_directory=[path],export_only=true

!!! export_only sert à tuer le processus avant le lancement de la simultation en provoquant une erreur, l'erreur est donc normale.

Convertir les configs .xml extraites via arcane en .json

python merge.py

Note: The merge.py script now handles both XML-to-JSON conversion and database import in a single command. The script automatically:

  1. Converts XML files from ./xml to JSON in ./arc_json
  2. Merges the JSON data into Neo4j
  3. Imports AXL export files into Neo4j

Installation & Setup with pip

Quick Start (First Time Only)

  1. Create a local virtual environment:
python3 -m venv .venv
  1. Activate it (Linux/Ubuntu Bash):
source .venv/bin/activate
  1. Install the package:
pip install -e .

Running the Package

After activation (recommended):

source .venv/bin/activate
arcane2graph --help
arcane2graph --xml-path ./xml --json-path ./arc_json --neo4j-password password

Without activation (one-off commands):

./.venv/bin/arcane2graph --help
./.venv/bin/arcane2graph --xml-path ./xml

What This Does

  • Creates an isolated .venv/ folder in your project
  • Installs the package locally without affecting other projects
  • Makes the arcane2graph command available
  • The -e flag installs in development mode (changes to code take effect immediately)

convertir les .axl en .json via axlstar

axl2ccT4 -l json -o \[output_path\] \[path_to_axl\]/Mahyco.axl

Déploiement docker

docker run \
    -d \
    -p 7474:7474 -p 7687:7687 \
    -v $PWD/data:/data -v $PWD/plugins:/plugins \
    --name neo4j-apoc \
    -e NEO4J_apoc_export_file_enabled=true \
    -e NEO4J_apoc_import_file_enabled=true \
    -e NEO4J_apoc_import_file_use__neo4j__config=true \
    -e NEO4J_PLUGINS=\[\"apoc\",\"apoc-extended\"\] \
    -e NEO4J_AUTH=neo4j/password \
    neo4j:5.26

Remplir la BDD

Lancer merge.py qui exécute maintenant les trois étapes :

  1. Conversion des fichiers XML en JSON
  2. Fusion des données JSON dans Neo4j
  3. Import des fichiers AXL export dans Neo4j

Une seule exécution du script suffit.

Arguments de merge.py

python merge.py [OPTIONS]

Options:
  --xml-path PATH               Path to XML input directory (default: ./xml)
  --json-path PATH              Path to JSON directory - output of conversion and input for merge (default: ./arc_json)
  --skip-convert                Skip XML to JSON conversion step (default: false)
  --neo4j-uri URI               Neo4j connection URI (default: bolt://localhost:7687)
  --neo4j-username USERNAME     Neo4j username (default: neo4j)
  --neo4j-password PASSWORD     Neo4j password (default: password)

Exemples

python merge.py --xml-path ./config/xml --json-path ./config/json --neo4j-uri bolt://localhost:7687 --neo4j-username neo4j --neo4j-password password

Interface web

http://localhost:7474/browser/

couple specification instance pour l'option nommée ...

MATCH p=(o: Option {fullName: "Mahyco/boundary-condition"})-[r:SPECIFIES]->()
return p

Couverture de toutes les options

MATCH (o)-[:SPECIFIES]->(n)
WITH apoc.map.clean(properties(n), ['uid'], []) AS props, coalesce(o.fullName, o.name) AS name
UNWIND keys(props) AS key
RETURN name, key, props[key] AS value, count(*) AS count
ORDER BY name, count DESC;

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

arcane2graph-0.1.0.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

arcane2graph-0.1.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file arcane2graph-0.1.0.tar.gz.

File metadata

  • Download URL: arcane2graph-0.1.0.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for arcane2graph-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a7de7e778b057f7dc1401d6b0c4be61bf58391386aafc072b53ff95048078ed1
MD5 5698a82aaa3ff49b280b1530f57f34bf
BLAKE2b-256 423dd84a82651ae9c45e3d9626d0ed9f463a9919c69e5672f44525605a677c21

See more details on using hashes here.

Provenance

The following attestation bundles were made for arcane2graph-0.1.0.tar.gz:

Publisher: python-publish.yml on ewenbrune/arcane2graph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arcane2graph-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: arcane2graph-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for arcane2graph-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9b734bb183fc8321509798ebf4e4b11dc47caf918e7f2cb1d11fd114665f3cc5
MD5 17a59e59ffce263f5c301fc9c12cf0e3
BLAKE2b-256 4091153634a17d8e27834a8c5c02a16ad064a7a7989b19ce17fb430d2040c07c

See more details on using hashes here.

Provenance

The following attestation bundles were made for arcane2graph-0.1.0-py3-none-any.whl:

Publisher: python-publish.yml on ewenbrune/arcane2graph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page