OntoUML JSON2Graph
ontouml-json2graph transforms OntoUML JSON projects into RDF graphs that use
the OntoUML Vocabulary. It can retain
project and diagrammatic information or produce a model-only graph.
Use the command-line interface to convert files directly, or the supported
Python API to obtain an RDFLib Graph. The package supports Python 3.10 or
newer.
Installation
pip install ontouml-json2graph
Command-line quick start
Convert one JSON file to Turtle in the current directory:
python -m json2graph.decode -i my_ontology.json
Choose an output directory and serialization explicitly:
python -m json2graph.decode -i my_ontology.json -o results -f json-ld
Convert every .json file directly inside a directory:
python -m json2graph.decode -a -i models -o results
Display all supported options and their defaults with:
python -m json2graph.decode --help
Python quick start
from json2graph.library import decode_json_project, save_graph_file
graph = decode_json_project("my_ontology.json")
save_graph_file(graph, "my_ontology.ttl", "ttl")
The supported public API consists of:
decode_json_projectfor model and diagrammatic information;decode_json_modelfor model-only output; andsave_graph_filefor explicit RDF serialization.
Important behavior
- Without an explicit base URI, the package derives a deterministic
urn:uuid:namespace from the parsed JSON content. - The default policies preserve invalid stereotypes and cardinality source
values where possible, omit unresolved diagrammatic
modelElementreferences, and warn about information that the vocabulary cannot represent. - The
correctoption enables a legacy set of class and property corrections. It is independent of the explicit policy options. - Input is decoded as UTF-8, with a warned CP1252 fallback. The package expects the OntoUML JSON structure but does not perform JSON Schema validation.
- Complete-project output is not a guarantee of lossless reconstruction. Path
point order, non-empty
propertyAssignments, and legacy diagrammaticText.valuecontent have no direct normative representation in OntoUML Vocabulary 1.1.1.
See the documentation for the complete CLI and Python guides, policy consequences, diagnostics, limitations, and 1.x-to-2.0 migration guidance.
Development
Install the project and development dependencies with Poetry:
poetry install
Run the primary validation commands from the repository root:
poetry check --strict --lock
poetry run python update_documentation.py
poetry run pytest
poetry run pre-commit run --all-files
Generated Sphinx HTML is written to docs/_build/html and is not committed.
Project links
Author and organization
The author of ontouml-json2graph is
Pedro Paulo Favato Barcelos.
The project is maintained in the OntoUML organization, linked to the Semantics, Cybersecurity & Services Group at the University of Twente, The Netherlands.
The software is distributed under the Apache License 2.0.
Metadata
Release files for ontouml-json2graph 2.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ontouml_json2graph-2.0.2.tar.gz | 200.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ontouml_json2graph-2.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 423.2 kB
Release files / ontouml_json2graph-2.0.2.tar.gz
| Download URL | ontouml_json2graph-2.0.2.tar.gz |
|---|---|
| Size | 200.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6f17fd3e6b540257a4414c081aba3992d6e38d30d47f79f707e260e321de2aab
|
|
BLAKE2b-256 checksum How to use checksums |
288642d5daf26b4ee4a7e52069533713fe0f3a0f71216930b88e742b6af1b4da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.13.7 Windows/11
|
Release files / ontouml_json2graph-2.0.2-py3-none-any.whl
| Download URL | ontouml_json2graph-2.0.2-py3-none-any.whl |
|---|---|
| Size | 222.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a10e9d93f2ccb519cfa07f6d47a8105dc2fa7b0ca929940d0de5d51fe43a9966
|
|
BLAKE2b-256 checksum How to use checksums |
b051e5e8598a4cc6de0d79421d33fecabf6ae90101e6171a1327278ce58e4a88
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.13.7 Windows/11
|