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

Allow to execute AQL directly on loaded AnnotationGraph objects. #278

Merged
merged 2 commits into from
Jan 10, 2024

Conversation

thomaskrause
Copy link
Member

This API is an alternative for using a CorpusStorage when only one corpus is handled and adds the new functions aql::execute_query_on_graph and aql::parse functions.

use graphannis::*;

let graph = AnnotationGraph::with_default_graphstorages(false)?;
let query = aql::parse("tok", false)?;
let it = aql::execute_query_on_graph(&graph, &query, true, None)?;
assert_eq!(0, it.count());

This API is an alternative for using a `CorpusStorage` when only one corpus is handled and adds the new functions `aql::execute_query_on_graph` and `aql::parse` functions.

```rust
use graphannis::*;

let graph = AnnotationGraph::with_default_graphstorages(false)?;
let query = aql::parse("tok", false)?;
let it = aql::execute_query_on_graph(&graph, &query, true, None)?;
assert_eq!(0, it.count());
```
Copy link

codecov bot commented Jan 10, 2024

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (fb32b9d) 65.04% compared to head (cd63bf7) 65.10%.

Files Patch % Lines
graphannis/src/annis/db/aql/mod.rs 93.10% 1 Missing and 1 partial ⚠️
graphannis/src/annis/db/aql/disjunction.rs 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #278      +/-   ##
==========================================
+ Coverage   65.04%   65.10%   +0.05%     
==========================================
  Files          75       75              
  Lines       19015    19044      +29     
  Branches    19015    19044      +29     
==========================================
+ Hits        12369    12399      +30     
  Misses       5304     5304              
+ Partials     1342     1341       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@thomaskrause thomaskrause marked this pull request as ready for review January 10, 2024 20:03
@thomaskrause thomaskrause merged commit fb8bbb2 into main Jan 10, 2024
13 checks passed
@thomaskrause thomaskrause deleted the feature/query-on-anno-graph branch January 10, 2024 20:03
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

Successfully merging this pull request may close these issues.

1 participant