graphannis/
lib.rs

1//! This is a graph-based linguistic corpus query system which implements the ANNIS Query Language (AQL).
2//! The main entry point to the API is the [CorpusStorage](struct.CorpusStorage.html) struct which allows to manage and query a database of corpora.
3
4#![deny(
5    clippy::panic,
6    clippy::panic_in_result_fn,
7    clippy::expect_used,
8    clippy::exit,
9    clippy::todo,
10    clippy::unwrap_in_result
11)]
12
13#[macro_use]
14extern crate log;
15
16#[macro_use]
17extern crate serde_derive;
18
19#[macro_use]
20extern crate lazy_static;
21
22#[macro_use]
23extern crate lalrpop_util;
24
25mod annis;
26
27pub use crate::annis::db::corpusstorage::CorpusStorage;
28
29/// Types that are used by the `CorpusStorage` API.
30pub mod corpusstorage {
31    pub use crate::annis::db::corpusstorage::SearchQuery;
32    pub use crate::annis::db::corpusstorage::{
33        CacheStrategy, CorpusInfo, ExportFormat, FrequencyDefEntry, GraphStorageInfo, ImportFormat,
34        LoadStatus, QueryLanguage, ResultOrder,
35    };
36    pub use crate::annis::types::{
37        CountExtra, FrequencyTable, FrequencyTableRow, QueryAttributeDescription,
38    };
39}
40
41pub use graphannis_core::graph::update;
42
43pub use graphannis_core::graph::Graph;
44
45/// A specialization of the [`Graph`], using components needed to represent and query corpus annotation graphs.
46pub type AnnotationGraph =
47    graphannis_core::graph::Graph<annis::db::aql::model::AnnotationComponentType>;
48
49/// Types that are used by the `Graph` API.
50pub mod graph {
51    pub use graphannis_core::annostorage::AnnotationStorage;
52    pub use graphannis_core::annostorage::Match;
53    pub use graphannis_core::annostorage::MatchGroup;
54    pub use graphannis_core::graph::storage::GraphStatistic;
55    pub use graphannis_core::graph::storage::{EdgeContainer, GraphStorage, WriteableGraphStorage};
56    pub use graphannis_core::types::{AnnoKey, Annotation, Component, Edge, NodeID};
57}
58
59/// Types that define the annotation graph model.
60pub mod model {
61    pub use crate::annis::db::aql::model::AnnotationComponentType;
62    pub type AnnotationComponent =
63        graphannis_core::types::Component<crate::model::AnnotationComponentType>;
64}
65
66/// Helper functions to execute AQL queries on an [`AnnotationGraph`].
67pub mod aql {
68    pub use crate::annis::db::aql::disjunction::Disjunction;
69    pub use crate::annis::db::aql::execute_query_on_graph;
70    pub use crate::annis::db::aql::parse;
71}
72
73/// Contains the graphANNIS-specific error types.
74pub mod errors {
75    pub use crate::annis::errors::*;
76}
77
78/// Utility functions.
79pub mod util {
80    pub use crate::annis::util::SearchDef;
81    pub use crate::annis::util::get_queries_from_csv;
82    pub use crate::annis::util::node_names_from_match;
83}