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

Existence validator #435

Merged
merged 4 commits into from
Sep 11, 2015
Merged

Conversation

zangsir
Copy link
Collaborator

@zangsir zangsir commented Sep 6, 2015

This includes several commits on the works of an annotation existence validator (issue Annotation name validation #190). The validator is incorporated along with the AQL checks in the backend and it is being run whenever a change in the query window or in the corpus selection changes. The validator also supports the case of multiple corpora selection (it is valid as long as the annotation exists in one of the selected corpora).

korpling changes 04/17/15
…s a number of changes in front and back ends. In the front end, I modified the QueryController class to perform validateQuery( ) with one more argument, the corpusName, which will be passed to back end at the time of validation (and obviously necessary for the new existence validator). Before, this argument was not passed from the front end and the corpusList in QueryServiceImpl was a empty linkedList (since previously no functionality in the validation needs the corpus name).

In the backend, I mainly added AnnotationExistenceValidator class. This is configured within the Java Spring framework, with the added entry in AnnisParser-Context.xml (including reference to annisDao). The new class simply get the available node annotations in the corpus (if selected), and checks if the nodes in the input query matches one of these valid annotation names.

One problem as of now is that, if no corpus is selected at the time that the validation happens, then the Node existence validation will not be performed. To change that situation we need to think of whether we want all validations to happen only when a corpus is selected by the user.
… corpus selection problem (validation happens when corpos selection changes now), and the corpora accumulation bugs in repeated validation processes with different corpus selections.
…is commit I finally add the functionality of the validation when multiple corpora are selected.In that scenario, the annotation name is deemed valid as long as it exists in one of the selected corpora.
@thomaskrause thomaskrause added this to the 3.4.0 milestone Sep 11, 2015
@thomaskrause thomaskrause self-assigned this Sep 11, 2015
@thomaskrause thomaskrause merged commit 6916120 into korpling:develop Sep 11, 2015
@thomaskrause
Copy link
Member

I used this opportunity to clean up some of the existing internal AQL error handling and now semantic errors are also shown in the AQL editor with the locations where the error actually occurred.
Also I changed your code in a way that the REST API parameters are more robust and have the same name as in the rest of the API. Please also check that the unit tests are actually executed without errors, due do some Spring configuration issues this was not the case in you code (I fixed that issue in commit 258776e).

@thomaskrause thomaskrause modified the milestones: 3.4.0, 3.4.0-preview1 Sep 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants