Skip to main content

DOI Project Status - Active GitHub - Release Date - PublishedAt GitHub - Last Commit - Branch PyPI - Project Language - Version CodeFactor Grade OpenSSF Scorecard pre-commit pre-commit.ci status License - GitHub

OntoUML JSON2Graph

OntoUML JSON2Graph logo

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_project for model and diagrammatic information;
  • decode_json_model for model-only output; and
  • save_graph_file for 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 modelElement references, and warn about information that the vocabulary cannot represent.
  • The correct option 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 diagrammatic Text.value content 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.

Personal website GitHub profile LinkedIn profile ORCID profile

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.

Download files

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

Source Distribution

ontouml_json2graph-2.0.0.tar.gz (222.0 kB view details)

Uploaded Source

Built Distribution

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

ontouml_json2graph-2.0.0-py3-none-any.whl (242.7 kB view details)

Uploaded Python 3

File details

Details for the file ontouml_json2graph-2.0.0.tar.gz.

File metadata

  • Download URL: ontouml_json2graph-2.0.0.tar.gz
  • Upload date:
  • Size: 222.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.7 Windows/11

File hashes

Hashes for ontouml_json2graph-2.0.0.tar.gz
Algorithm Hash digest
SHA256 486efd28c77758fe46afd404cd0d1126cc4b121b5a432691120023497a88e7b7
MD5 fb2b391509436dcdd33fea6e854249c2
BLAKE2b-256 0110035da4e3b8c476fddc6d7d962ad24eb5cc3d5eba3d4c6540195b1e2c73d9

See more details on using hashes here.

File details

Details for the file ontouml_json2graph-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ontouml_json2graph-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9713492276ec5be814330e4748d6845e350d0ddff8af38c5e603780f765043c0
MD5 6055b0dcbdbf19d44ec3f3e75444f0d9
BLAKE2b-256 f045a2035b7a46ab5559b0b7d98437d85590b1a29894a5aebfaaeea42813d6a3

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 files

1.3.3

2 files

1.3.2

2 files

1.3.1

2 files

1.3.0

2 files

1.2.1

2 files

1.2.0

2 files

1.1.0

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

Supported by

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