Skip to main content

OntoUML JSON2Graph Decoder

Reason this release was yanked:

it should be a beta. version info incorrect.

Project description

The OntoUML JSON2Graph Transformation

The OntoUML JSON2Graph (ontouml-json2graph) decodes a JSON file that complies with the ontouml-schema (e.g., the ones exported by the ontouml-vp-plugin) to a graph file that complies with the ontouml-vocabulary. Optionally, the user can enable basic semantic and syntactical verifications to improve the transformation results.

This application was constructed with RDFLib using Python 3.11.4. The generated graph file can be serialized in the diverse formats supported by the RDFLib, which are Turtle, RDF/XML, JSON-LD, N-Triples, Notation-3, Trig, Trix, and N-Quads.

Installing and Executing

You need to download and install Python to execute the ontouml-json2graph transformation tool. To install all necessary dependencies, run the following command on the terminal inside the project's folder:

pip install -r requirements.txt

For executing the software, run the following command on the terminal inside the project's folder, where path_to_json must be substituted for the location of the catalog's directory on your computer:

python main.py path_to_json

Arguments

All available ontouml-models-tools arguments can be observed below.

usage: ontouml-json2graph [-h]
                          [-f {turtle,ttl,turtle2,xml,pretty-xml,json-ld,ntriples,nt,nt11,n3,trig,trix,nquads}]
                          [-l LANGUAGE] [-c] [-s] [-u BASE_URI] [-m] [-v]
                          json_file

OntoUML JSON2Graph Decoder. Version: 2023.07.20

positional arguments:
  json_file             The path of the JSON file to be encoded.

options:
  -h, --help            show this help message and exit
  -f {turtle,ttl,turtle2,xml,pretty-xml,json-ld,ntriples,nt,nt11,n3,trig,trix,nquads}, --format {turtle,ttl,turtle2,xml,pretty-xml,json-ld,ntriples,nt,nt11,n3,trig,trix,nquads}
                        Format to save the decoded file. Default is 'ttl'.
  -l LANGUAGE, --language LANGUAGE
                        Language tag for the ontology's concepts. Default is 'None'.
  -c, --correct         Enables syntactical and semantic validations and corrections.
  -s, --silent          Silent mode. Does not present validation warnings and errors.
  -u BASE_URI, --base_uri BASE_URI
                        Base URI of the resulting graph. Default is 'https://example.org#'.
  -m, --model_only      Keep only model elements, eliminating all diagrammatic data from output.
  -v, --version         Print the software version and exit.

Basic Syntactical and Sematic Validation

  • Class validations:
    • Reports Class with incompatible attributes isExtensional (not 'null') and isPowertype (set as 'True').
    • Sets Class stereotype as 'collective' when the Class's stereotype is 'null' and its isExtensional attribute is 'True'.
    • Sets Class stereotype as 'type' when the Class's stereotype is 'null' and its isPowertype attribute is 'True'.
    • Removes the Class's isExtensional attribute if the Class's stereotype is not 'collective'.
    • Sets the Class's isPowertype attribute as 'False' if the Class's stereotype is not 'type'.
    • Sets the Class's order attribute to '1' if the Class's stereotype is not 'type' and its order different than '1'.
    • Sets the Class's order attribute to '2' if the Class's stereotype is 'type' and its order is '1'.
    • Reports mandatory Class stereotype missing.
  • Stereotype validations:
    • Reports invalid Class stereotype assigned (i.e., assigned stereotype is not in enumeration class ClassStereotype).
    • Reports invalid Relation stereotype assigned (i.e., assigned stereotype is not in enumeration class RelationStereotype).
    • Reports invalid Property stereotype assigned (i.e., assigned stereotype is not in enumeration class PropertyStereotype).
  • Property validations:
    • Reports invalid assertion when a Property stereotype is related to a Class that is known not to be of stereotype 'event'.
    • Sets Class stereotype as 'event' when it is originally 'null' and the class is related to a Property with stereotype.

Authorship

Feel free to get in contact using the links provided. For questions, contributions, or to report any problem, you can * open an issue* at this repository.

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

ontouml_json2graph-1.0.0.tar.gz (4.3 MB view hashes)

Uploaded Source

Built Distribution

ontouml_json2graph-1.0.0-py3-none-any.whl (4.4 MB view hashes)

Uploaded Python 3

Supported by

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