Skip to content

Commit

Permalink
Added .owl (ManchesterSyntax) to DPV-OWL files
Browse files Browse the repository at this point in the history
The DPV-OWL serialisations now include .owl ManchesterSyntax files in
addition to the other formats. The conversion is handled by `801`
script, and it will be run by `902` to auto-generate .owl files on every
update - same as other formats. The tool used for conversion is
onto-converter from https://github.com/sszuev/ont-converter/ In the
future, this can be replaced with a simpler OWLAPI wrapper.
  • Loading branch information
coolharsh55 committed Jun 22, 2022
1 parent 4bc78c8 commit 1a9bb10
Show file tree
Hide file tree
Showing 35 changed files with 19,263 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,6 @@ dmypy.json

# Cython debug symbols
cython_debug/

# ont-converter jar files should be skipped
ont-converter.jar
29 changes: 29 additions & 0 deletions documentation-generator/801_convert_owl_manchester.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
#author: Harshvardhan J. Pandit

# Convert DPV files from RDF / Turtle format to OWL / Machester formats

echo "Converting DPV files from .rdf to .owl with ManchesterSyntax"

# REQUIREMENTS: Ont-Converter
# Get it from here https://github.com/sszuev/ont-converter/releases
# Put the jar as "ont-converter.jar" in this same folder

# convert .rdf files to .owl files in manchester syntax
convert_owl() {
filepath="${1%.*}"
filepath_owl="${filepath}.owl"
echo -n "converting $filepath ..."
java -jar ont-converter.jar -i "$1" -if RDF_XML -o "$filepath_owl" -of ManchesterSyntax
echo "DONE"
}
export -f convert_owl

# Find all .rdf files in parent directory,
# then convert them to .owl using the ont-converter.
# The assumption here is that .rdf files are only present in places
# where DPV outputs exist, and won't be for example in the
# documentation generator metadata folders (they are .ttl)

find ../dpv-owl -type f -name "*.rdf" -exec bash -c 'convert_owl "$0"' {} \;
# java -jar $ONT_CONVERTER
4 changes: 4 additions & 0 deletions documentation-generator/902_rdf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ CHECK_ERROR
CHECK_ERROR
./002_parse_csv_to_rdf_owl.py
CHECK_ERROR

# Step2.3: convert to OWL Manchester Syntax
./801_convert_owl_manchester.sh
CHECK_ERROR
3 changes: 3 additions & 0 deletions documentation-generator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ In between steps 2 and 3, there can be a series of tests done to ensure the RDF
`./003_generate_respec_html.py` will generate HTML documentation for DPV and DPV-GDPR from RDF.

The `9**` series offers convenience in running the other scripts in some combination. `902` executes all the RDF generation scripts, `903` executes all the HTML generation scripts, and `999` executes all scripts.

In addition to these, `8**` series offers convenience with tasks. `801` converts the DPV-OWL RDF files into OWL (Manchester Syntax). It will be run automatically through the `902` script so that every update will auto-generate these files.

## How everything works

### Downloading CSV data
Expand Down
Loading

0 comments on commit 1a9bb10

Please sign in to comment.