Open weasdown opened 2 weeks ago
I've written a working parser for List attributes here, although I admit the code is pretty horrible so I'll definitely clean it up when I can.
I've found that my code linked above doesn't currently handle multiple restrictions for ConstrainedDatatype
s, so I'm working on that. Generally, I need to adapt the code so it uses the list brackets ((
or [
) to work out whether there will be deeper lists, rather than assuming it knows the structure. Once my parser is complete and tested for a variety of ontology entries, I'll add a pull request in this repo.
If an ontology contains a property with a range whose value is a List rather than String,
Graph._saveToGroups()
fails on line 614 because the for loop casts the range item to a String. I tried changing this to cast to avar
, but I'm not then sure howGraph.item()
should handle it or how the resulting item should be saved togroups
. Below are a sample ontology file to reproduce this (in .ttl and .xml, but both with extra .txt extensions to allow upload), and the Python file used to generate the ontology.Ontology files to reproduce error (with extra .txt extension to allow upload): Turtle: rdflib-test.ttl.txt XML version for info: rdflib-test.xml.txt
Python used to generate ontology files: