pyLODE
pyLODE copied to clipboard
pyLODE in supermodel mode returns ValueError: Can't split 'ontologyURI'
Hi, I try to follow the exem-ont example and to create a similar view for cityrdf repo. I created pylode-config.ttl and pylode.ttl (although its name can be changed not to interfere with pylode ontology) and run a command like
python pylode -p supermodel pylode-config.ttl
It correctly reads the file and fails with ValueError:
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/nata/work/pyLODE/pylode/main.py", line 6, in
Any idea of what to do with this?
Can you try changing the profile IRI here to something that does not end with a slash?
Pylode is trying to use it as the default IRI for the main model and if possible, create a CURIE using the compute_qname function. But because the IRI here ends in a slash, it's failing to split correctly (I think).
Try changing it to something like <https://www.opengis.net/ont/citygml/profile>.
Ok, now the error is:
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/nata/work/pyLODE/pylode/main.py", line 6, in
This error is due to your resources of type lode:Module are not also typed as prof:Profile. Sorry about the error messages. Perhaps any resources that pylode finds with lode:Module should check that they all have the required prof:Profile class.
In your pylode.ttl, can you please add a prof:Profile to each instance of lode:Module please.
You might want to add the / back in your pylode.ttl. The previous error you had was due to the slash existing on pylode-config.ttl. Again, sorry about the error messages :(
Lastly, pylode supermodel will also import any ontologies specified with owl:imports. I noticed you have a few imports that are returning 404. For example, in appearance.ttl, this import will fail <http://def.isotc211.org/iso19150/-2/2012/base>. You may want to either remove or comment these lines out for now to get an initial working version.
Thank you! I finally asked here https://github.com/ISO-TC211/StandardsTracker/issues/522. It is not correct to sacrifice semantics (iso19150-2 is not just mentioned, it is used) , is it? Anyway, some redirect/substitute/ whatever would be much appreciated in pyLODE settings to avoid such situations.
Can we have something similar to what Protege has for owl:imports handling, ako config file catalog-001.xml where the actual links are substituted by a human selecting proper file locally or somewhere from agreed space.