semanticarts / ontology-toolkit

Tools to update and export ontology RDF.
Apache License 2.0
34 stars 6 forks source link

External Process (tool) Error Handling #130

Open coltonglasgow opened 2 months ago

coltonglasgow commented 2 months ago

The ontology toolkit allows you to define an external tool. This feature is used in the documentation for serialization but I am attempting to use it for validation. I have an external script that loads all ontology files and checks for undefined concepts across ontologies but I am unable to access the results of that script via the onto_tool bundle process. I do not believe onto_tool keeps track of the external process to indicate a pass/fail. Similar to the validation action, I would like a way of stopping the bundle process if my external tool fails.

The way these external processes are started is with a transform action. That makes sense for external scripts that transform files but in my case, I am attempting to validate (not change any files). Maybe an external tool action could be created for better clarity.

sa-bpelakh commented 2 months ago

I have actually started work on an external tool validator, I can try to dig that up. However, what does your 'undefined concepts' tool do - can it be expressed as a SPARQL query? If so, you can just use a SPARQL SELECT or CONSTRUCT validator to do the same, and not have to have external scripts.

coltonglasgow commented 2 months ago

The undefined concepts script is a modified version of a script originally written by @dylan-sa (https://github.com/semanticarts/undefined-concepts-tool). The intention of the script is to load all ontology files into individual named graphs and look for classes and properties that have not been defined in any of the named graphs (using named graphs to identify the source file). We have gone a step farther than this to also convert our triple pattern files into valid turtle and check for undefined concepts in those files as well. A SPARQL query is the method used to find the undefined concepts in the script but the triple pattern to valid turtle conversion (I believe) is only possible in a script.