vliz-be-opsci / py-sema

Overall parent of all packages involving semantic manipulation of RDF data.
MIT License
0 stars 0 forks source link

Implement visitor pattern in `sema.commons.clean` #18

Open cedricdcc opened 5 months ago

cedricdcc commented 5 months ago

Consider using a visitor pattern for the cleaning system and extend with an OO-based alternative.

This will involve refactoring the sema.commons.store submodules since the functionality of clean is defined in there. Tests for the clean will also have to be seperated from the submodule tests.

cedricdcc commented 5 months ago

Links to #17

marc-portier commented 4 months ago

Point is the current implementation is using some python hackery to convey / decide on which level (graph, triple, term) the cleaning needs to be applied. (Other way of thinking about this: python lacks parameter overloading? )

Main reason should be if we can (if possible / needed) avoid re-iterating / traversing the graph to clean.

But obviously code-readability (and ease of use to create own cleaner functions) is another target to achieve.