Struct graphannis::Graph
source · pub struct Graph { /* private fields */ }
Expand description
A representation of a graph including node annotations and edges. Edges are partioned into components and each component is implemented by specialized graph storage implementation.
Use the CorpusStorage struct to create and manage instances of a Graph
.
Graphs can have an optional location on the disk. In this case, changes to the graph via the apply_update(…) function are automatically persisted to this location.
Implementations
sourceimpl Graph
impl Graph
sourcepub fn get_graphstorage(&self, c: &Component) -> Option<Arc<dyn GraphStorage>>
pub fn get_graphstorage(&self, c: &Component) -> Option<Arc<dyn GraphStorage>>
Get a read-only graph storage reference for the given component c
.
sourcepub fn get_all_components(
&self,
ctype: Option<ComponentType>,
name: Option<&str>
) -> Vec<Component> ⓘ
pub fn get_all_components(
&self,
ctype: Option<ComponentType>,
name: Option<&str>
) -> Vec<Component> ⓘ
Returns all components of the graph given an optional type (ctype
) and name
.
This allows to filter which components to recieve.
If you want to retrieve all components, use None
as value for both arguments.
sourcepub fn get_node_type_key(&self) -> AnnoKey
pub fn get_node_type_key(&self) -> AnnoKey
Return the annotation key which is used for the special annis::node_type
annotation which every node must have to mark its existance.
pub fn size_of_cached(&self, ops: &mut MallocSizeOfOps) -> usize
Trait Implementations
sourceimpl AnnotationStorage<u64> for Graph
impl AnnotationStorage<u64> for Graph
sourcefn get_annotations_for_item(&self, item: &NodeID) -> Vec<Annotation> ⓘ
fn get_annotations_for_item(&self, item: &NodeID) -> Vec<Annotation> ⓘ
item
(node or edge).sourcefn number_of_annotations(&self) -> usize
fn number_of_annotations(&self) -> usize
AnnotationStorage
.sourcefn number_of_annotations_by_name(&self, ns: Option<String>, name: String) -> usize
fn number_of_annotations_by_name(&self, ns: Option<String>, name: String) -> usize
AnnotationStorage
filtered by name
and optional namespace (ns
).sourcefn exact_anno_search<'a>(
&'a self,
namespace: Option<String>,
name: String,
value: Option<String>
) -> Box<dyn Iterator<Item = Match> + 'a>
fn exact_anno_search<'a>(
&'a self,
namespace: Option<String>,
name: String,
value: Option<String>
) -> Box<dyn Iterator<Item = Match> + 'a>
name
must be given as argument, the other arguments are optional. Read moresourcefn regex_anno_search<'a>(
&'a self,
namespace: Option<String>,
name: String,
pattern: &str
) -> Box<dyn Iterator<Item = Match> + 'a>
fn regex_anno_search<'a>(
&'a self,
namespace: Option<String>,
name: String,
pattern: &str
) -> Box<dyn Iterator<Item = Match> + 'a>
name
and the pattern
for the value must be given as argument, thenamespace
argument is optional and can be used as additional constraint. Read moresourcefn guess_max_count(
&self,
ns: Option<String>,
name: String,
lower_val: &str,
upper_val: &str
) -> usize
fn guess_max_count(
&self,
ns: Option<String>,
name: String,
lower_val: &str,
upper_val: &str
) -> usize
sourcefn guess_max_count_regex(
&self,
ns: Option<String>,
name: String,
pattern: &str
) -> usize
fn guess_max_count_regex(
&self,
ns: Option<String>,
name: String,
pattern: &str
) -> usize
sourcefn get_all_values(&self, key: &AnnoKey, most_frequent_first: bool) -> Vec<&str> ⓘ
fn get_all_values(&self, key: &AnnoKey, most_frequent_first: bool) -> Vec<&str> ⓘ
key
.
If the most_frequent_first
parameter is true, the results are sorted by their frequency. Read more