Skip to content

Commit

Permalink
v1.2.0 (#29)
Browse files Browse the repository at this point in the history
* improved errors and arguments

* added utils_validations.py

* removed dead code

* minnor grammar fix

* improved OS compatibility on tests

* update new version of validators
included version update in remake.bat script

* improved output treatment

* restructuring arguments.py and main functions

* imports fixed

* fix global ARGUMENTS

* log file generation removed

* improved arguments.py
fix decode

* working as script

* tests working

* improved help info

* depedencies updated

* code refactored

* fix library.py imports

* sphinx docummentation updated

* remake file organization improved

* improvings from dependabot

* improved errors and arguments

* added utils_validations.py

* removed dead code

* minnor grammar fix

* improved OS compatibility on tests

* update new version of validators
included version update in remake.bat script

* improved output treatment

* restructuring arguments.py and main functions

* imports fixed

* fix global ARGUMENTS

* log file generation removed

* improved arguments.py
fix decode

* working as script

* tests working

* improved help info

* depedencies updated

* code refactored

* fix library.py imports

* sphinx docummentation updated

* remake file organization improved

* improvings from dependabot
  • Loading branch information
pedropaulofb committed Sep 8, 2023
1 parent 2835f7a commit 6ad01cf
Show file tree
Hide file tree
Showing 115 changed files with 2,181 additions and 3,439 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ jobs:
egress-policy: audit

- name: Checkout repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@5b6282e01c62d02e720b81eb8a51204f527c3624 # v2.21.3
uses: github/codeql-action/init@00e563ead9f72a8461b24876bee2d0c2e8bd2ee8 # v2.21.5
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -72,7 +72,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@5b6282e01c62d02e720b81eb8a51204f527c3624 # v2.21.3
uses: github/codeql-action/autobuild@00e563ead9f72a8461b24876bee2d0c2e8bd2ee8 # v2.21.5

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -85,6 +85,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@5b6282e01c62d02e720b81eb8a51204f527c3624 # v2.21.3
uses: github/codeql-action/analyze@00e563ead9f72a8461b24876bee2d0c2e8bd2ee8 # v2.21.5
with:
category: "/language:${{matrix.language}}"
4 changes: 2 additions & 2 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ jobs:
egress-policy: audit

- name: 'Checkout Repository'
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- name: 'Dependency Review'
uses: actions/dependency-review-action@7d90b4f05fea31dde1c4a1fb3fa787e197ea93ab # v3.0.7
uses: actions/dependency-review-action@6c5ccdad469c9f8a2996bfecaec55a631a347034 # v3.1.0
6 changes: 3 additions & 3 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
egress-policy: audit

- name: "Checkout code"
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
with:
persist-credentials: false

Expand All @@ -64,14 +64,14 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@5b6282e01c62d02e720b81eb8a51204f527c3624 # v2.21.3
uses: github/codeql-action/upload-sarif@00e563ead9f72a8461b24876bee2d0c2e8bd2ee8 # v2.21.5
with:
sarif_file: results.sarif
33 changes: 26 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,37 @@ For executing the software, run the following command on the terminal inside the
python -m json2graph.decode [path_to_json] [OPTIONAL ARGUMENTS]
```

For example, to decode the JSON file `my_ontology.json` and save the output graph in the Turtle format, you would run the following command:

```txt
python -m json2graph.decode -i turtle my_ontology.json
```

You can also use the script to decode multiple JSON files. To do this, you would use the `decode_all` option ('-a' argument).
For example, to decode all of the JSON files in the my_data directory you would run the following command:

```txt
python -m json2graph.decode -a -i my_data
```

#### Arguments

The only mandatory argument is `path_to_json`, which must be substituted for the input file's location on your computer. Optional arguments provide additional features. All available ontouml-json2graph arguments can be observed below.

```text
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_path
usage: ontouml-json2graph [-h] -i INPUT_PATH [-o OUTPUT_PATH] [-a] [-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]
OntoUML JSON2Graph Decoder. Version: 1.1.0
positional arguments:
json_path The path of the JSON file to be encoded.
OntoUML JSON2Graph Decoder. Version: 1.2.0
options:
-h, --help show this help message and exit
-i INPUT_PATH, --input_path INPUT_PATH
The path of the JSON file or directory with JSON files to be decoded.
-o OUTPUT_PATH, --output_path OUTPUT_PATH
The path of the directory in which the resulting decoded file(s) will be saved. Default is the working directory.
-a, --decode_all Converts all JSON files in the informed path.
-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
Expand All @@ -98,6 +115,7 @@ options:
-m, --model_only Keep only model elements, eliminating all diagrammatic data from output.
-v, --version Print the software version and exit.
More information at: https://w3id.org/ontouml/json2graph
```

Expand All @@ -114,7 +132,7 @@ The `decode_json_project` function allows you to decode the complete OntoUML JSO
```python
from json2graph.library import decode_json_project

decoded_graph_project = decode_json_project(json_path="path/to/input.json", base_uri="https://myuri.org#",
decoded_graph_project = decode_json_project(json_file_path="path/to/input.json", base_uri="https://myuri.org#",
language="en", correct=True)
```

Expand All @@ -127,7 +145,8 @@ Differently from the `decode_json_model`, this function decodes only elements fr
```python
from json2graph.library import decode_json_model

decoded_graph_model = decode_json_model(json_path="path/to/input.json", base_uri="https://myuri.org#", language="en",
decoded_graph_model = decode_json_model(json_file_path="path/to/input.json", base_uri="https://myuri.org#",
language="en",
correct=True)
```

Expand Down Expand Up @@ -217,7 +236,7 @@ The software uses the metadata provided in its `pyproject.toml` file to present

The ontouml-json2graph package was developed using test-driven-based development. Multiple tests are available inside the following folder: ontouml-json2graph/json2graph/tests.

Documentation regarding the text [is also available](https://dev.ontouml.org/ontouml-json2graph/autoapi/json2graph/tests/index.html).
Documentation regarding the tests [is also available](https://dev.ontouml.org/ontouml-json2graph/autoapi/json2graph/tests/index.html).

## Author

Expand Down
2 changes: 1 addition & 1 deletion docs/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 0c4062c1b40bca4fff83653d5827a438
config: 1f036d13bc8280559eeea88a5726b5d8
tags: 645f666f9bcd5a90fca523b33c5a78b7
Loading

0 comments on commit 6ad01cf

Please sign in to comment.