Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add entity check logging to KB_pattern_writer #164

Open
dosumis opened this issue Feb 24, 2020 · 3 comments
Open

Add entity check logging to KB_pattern_writer #164

dosumis opened this issue Feb 24, 2020 · 3 comments
Assignees

Comments

@dosumis
Copy link
Member

dosumis commented Feb 24, 2020

All warnings should be added to log stack in addition to being emitted as STDERR. Currently this only affects entity checks, but log should be generic - allowing for other checks in future.

The point of this is to separate stack traces from more fundamental errors from database loading user facing errors.

@dosumis dosumis self-assigned this Feb 24, 2020
dosumis added a commit that referenced this issue Feb 24, 2020
Log is at kb_owl_pattern_writer.ec.log
Message does not have context of individual being added,
but maybe that's OK.
dosumis added a commit that referenced this issue Feb 26, 2020
@dosumis
Copy link
Member Author

dosumis commented Feb 28, 2020

First phase of this is done (see #170). This generates a log on the entity checker - which carries out checks during addition of patterns to the stack. For pattern addition - these pre-addition checks should catch everything (we don't want partial pattern commits), but commit time failures can't be ruled out.

Second phase - add logging to commits. We want this to work uniformly across writer objects.

Overview:

  • As usual, every method should return something useful or False
  • KB_tools write objects accumulate a stack of cypher statements until .commit() is called.
  • KB_tools Writer object commits should return False if any part of the commit stack has failed
  • Error messages that indicate failure of a statement in the commit stack are logged (not returned by the commit statement).
  • If the error log has any content, then commit returns False, otherwise it returns True. It is the responsibility of the calling script to check for False return and then check the log.
  • We need a mechanism to reliably clear the error log between commits. As we are only logging commit-time errors, this can happen at the beginning of a commit. This has the disadvantage that the old error log hangs around until the next commit.
  • .get_log => returns log and clears it
  • pattern error log is simply a concatenation of edge and node writer error logs.

@dosumis
Copy link
Member Author

dosumis commented Feb 28, 2020

CC @matentzn

@dosumis
Copy link
Member Author

dosumis commented Mar 2, 2020

#171 Fixes return for pattern writer. More work is needed to standardize across other kb_writer objects, but this has been moved to another ticket
#172

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant