Skip to content

Commit

Permalink
handle space in ontology filename
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmad88me committed Jul 8, 2023
1 parent 85e2abc commit 137d17f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM amazoncorretto:8-alpine3.17
FROM amazoncorretto:17-alpine3.17
RUN mkdir -p playground ;\
chmod 777 playground ; \
mkdir -p playground/OnToology
Expand Down
12 changes: 7 additions & 5 deletions Integrator/owl2jsonld.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ def build_owl2jsonld_file(ont_file, base_dir):
ctabs = build_path(os.path.join(base_dir, get_target_home(), ont_file, tools_conf['owl2jsonld']['folder_name'],
'context.jsonld'))
dolog('ctabs %s' % ctabs)
comm = "cd " + get_parent_path(ctabs) + "; " # Not neccesary
comm += timeout_comm + "java -jar "
comm += os.path.join(owl2jsonld_dir, "owl2jsonld-0.2.1-standalone.jar") # ToolLocation
comm += " -o " + ctabs # Output File
comm += " file://" + os.path.join(base_dir, ont_file) # Ontology Location
comm = f" cd '{ get_parent_path(ctabs)}' ; {timeout_comm} java -jar "
comm += f" '{os.path.join(owl2jsonld_dir, 'owl2jsonld-0.2.1-standalone.jar')}'"
# comm += os.path.join(owl2jsonld_dir, 'owl2jsonld-0.2.1-standalone.jar') # ToolLocation
comm += f" -o '{ctabs}'"
# comm += " -o " + ctabs # Output File
comm += f" 'file://{os.path.join(base_dir, ont_file)}' "
# comm += ' file://' + os.path.join(base_dir, ont_file) # Ontology Location
dolog(comm)
call(comm, shell=True)
11 changes: 4 additions & 7 deletions Integrator/widoco.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,13 @@ def create_widoco_doc(rdf_file, base_dir, languages, webVowl):
except Exception as e:
dolog('in create_widoco_doc: exception opening the file: ' + str(e))
out_abs_dir = get_parent_path(config_file_abs)
comm = "cd " + base_dir + "; "
comm += timeout_comm + "java -jar "
comm = f"cd '{base_dir}'; {timeout_comm} java -jar "
comm += ' -Dfile.encoding=utf-8 '
comm += widoco_dir + "widoco.jar -rewriteAll "
#comm += widoco_dir + "widoco-0.0.1-jar-with-dependencies.jar "
comm += " -ontFile '" + rdf_file_abs
comm += "' -outFolder '" + out_abs_dir + "'"
comm += f" -ontFile '{rdf_file_abs}' -outFolder '{out_abs_dir}'"

if use_conf_file:
comm += " -confFile " + config_file_abs
comm += " -crossRef"
comm += f" -confFile '{config_file_abs}' -crossRef"
else:
comm += " -getOntologyMetadata "
comm += " -licensius " # Only works if the -getOntologyMetadata flag is enabled.
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,8 @@ Sometimes things happens and the processes or the APIs fail. Here are the common

## Debugging with Docker

```
docker-compose up
docker ps
docker exec -it <container name> /bin/sh
```

0 comments on commit 137d17f

Please sign in to comment.