diversicon-kb / diversicon-core

A knowledge base for lexicons and concepts, based on UBY
http://diversicon-kb.eu/tools
Other
0 stars 0 forks source link

Implement force import flag #34

Closed DavidLeoni closed 7 years ago

DavidLeoni commented 7 years ago

When importing, by default we should issue errors for missing dependencies, like non existing namespaces and external ids pointing to nowhere. A 'force` flag will turn errors into warnings and allow the import.

DavidLeoni commented 7 years ago

Improved a lot XML validation, which now checks that:

  1. XML structure and metadata are coherent
  2. internal XML references are satisfied (i.e. phablet links to existing smartphone synset)
  3. external references are satisfied and present in the db (i.e. links to Wordnet computer synset are already present in the db ). if external references are not satisfied (i.e. in the XML Wordnet is referenced but was not imported yet) WARNINGs are emitted.

If any ERROR is reported, import fails. If any WARNING is reported, import fails, because by default during import there is strict validation.

To allow out-of-order import and circular references among lexical resources, there is now a force flag that allows to ignore WARNINGs by setting non-strict validation.

This system also has now a separate function that allows to validate an XML without attempting to import it. For now such validation just performs steps 1 and 2, without matching it against the db.

Remains to implement a 'dry run' functionality, that includes step 3 without proceeding to the actual import (see #40).