From 9bd4352261551d004637e550414008c26329ea14 Mon Sep 17 00:00:00 2001 From: Thomas Krause Date: Wed, 13 Aug 2025 14:48:27 +0200 Subject: [PATCH 1/7] Remove usage of smartstring crate --- core/Cargo.toml | 11 +++++------ core/src/annostorage/inmemory.rs | 14 +++++--------- core/src/annostorage/ondisk.rs | 6 ++---- core/src/graph/mod.rs | 15 +++++---------- core/src/types.rs | 1 - graphannis/Cargo.toml | 1 - graphannis/src/annis/db/aql/operators/near.rs | 2 +- graphannis/src/annis/db/corpusstorage.rs | 7 +++---- graphannis/src/annis/db/relannis.rs | 13 +++++-------- 9 files changed, 26 insertions(+), 44 deletions(-) diff --git a/core/Cargo.toml b/core/Cargo.toml index d14d51cc3..c375f004f 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -22,16 +22,15 @@ normpath = "1.1.1" num-traits = "0.2" percent-encoding = "2.1" quick-xml = "0.28" -rand = {version = "0.8", features = ["small_rng"]} -rayon = {version = "1.3", default-features = false} +rand = { version = "0.8", features = ["small_rng"] } +rayon = { version = "1.3", default-features = false } regex = "1" regex-syntax = "0.8" rustc-hash = "1.0" -serde = {version = "1.0", features = ["rc"]} +serde = { version = "1.0", features = ["rc"] } serde_bytes = "0.11" serde_derive = "1.0" smallvec = "1.6" -smartstring = {version = "1", features = ["serde"]} sstable = "0.11" strum = "0.21" strum_macros = "0.21" @@ -41,11 +40,11 @@ toml = "0.8" transient-btree-index = "0.5" [target.'cfg(windows)'.dependencies] -winapi = {version = "0.3", features = ["heapapi"]} +winapi = { version = "0.3", features = ["heapapi"] } [dev-dependencies] env_logger = "0.9" fake = "2.2" -insta = {version = "1.38.0", features = ["json"]} +insta = { version = "1.38.0", features = ["json"] } pretty_assertions = "1.3" serde_json = "1.0" diff --git a/core/src/annostorage/inmemory.rs b/core/src/annostorage/inmemory.rs index d59b70e78..8305185d8 100644 --- a/core/src/annostorage/inmemory.rs +++ b/core/src/annostorage/inmemory.rs @@ -10,8 +10,6 @@ use itertools::Itertools; use rand::seq::IteratorRandom; use rand::thread_rng; use rustc_hash::FxHashSet; -use smartstring::alias::String; -use smartstring::{LazyCompact, SmartString}; use std::borrow::Cow; use std::collections::{BTreeMap, BTreeSet, HashMap}; use std::hash::Hash; @@ -34,10 +32,10 @@ pub struct AnnoStorageImpl { /// Maps a distinct annotation key to the number of elements having this annotation key. anno_key_sizes: BTreeMap, anno_keys: SymbolTable, - anno_values: SymbolTable, + anno_values: SymbolTable, /// additional statistical information - histogram_bounds: BTreeMap>, + histogram_bounds: BTreeMap>, largest_item: Option, total_number_of_annos: usize, } @@ -357,7 +355,7 @@ where let it = self.anno_key_sizes.range( AnnoKey { name: name.into(), - ns: smartstring::alias::String::default(), + ns: String::default(), }.., ); let mut result: Vec = Vec::default(); @@ -1021,8 +1019,7 @@ impl NodeAnnotationStorage for AnnoStorageImpl { fn get_node_id_from_name(&self, node_name: &str) -> Result> { if let (Some(anno_name_symbol), Some(value_symbol)) = ( self.anno_keys.get_symbol(&NODE_NAME_KEY), - self.anno_values - .get_symbol(&SmartString::::from(node_name)), + self.anno_values.get_symbol(&String::from(node_name)), ) { if let Some(items_with_anno) = self.by_anno.get(&anno_name_symbol) { if let Some(items) = items_with_anno.get(&value_symbol) { @@ -1037,8 +1034,7 @@ impl NodeAnnotationStorage for AnnoStorageImpl { fn has_node_name(&self, node_name: &str) -> Result { if let (Some(anno_name_symbol), Some(value_symbol)) = ( self.anno_keys.get_symbol(&NODE_NAME_KEY), - self.anno_values - .get_symbol(&SmartString::::from(node_name)), + self.anno_values.get_symbol(&String::from(node_name)), ) { if let Some(items_with_anno) = self.by_anno.get(&anno_name_symbol) { if let Some(items) = items_with_anno.get(&value_symbol) { diff --git a/core/src/annostorage/ondisk.rs b/core/src/annostorage/ondisk.rs index 4725c9079..da2b11658 100644 --- a/core/src/annostorage/ondisk.rs +++ b/core/src/annostorage/ondisk.rs @@ -20,8 +20,6 @@ use std::path::{Path, PathBuf}; use std::sync::Arc; use transient_btree_index::BtreeConfig; -use smartstring::alias::String as SmartString; - use super::{EdgeAnnotationStorage, NodeAnnotationStorage}; pub const SUBFOLDER_NAME: &str = "nodes_diskmap_v1"; @@ -520,7 +518,7 @@ where let it = self.anno_key_sizes.range( AnnoKey { name: name.into(), - ns: SmartString::default(), + ns: String::default(), }.., ); let mut result: Vec = Vec::default(); @@ -662,7 +660,7 @@ where None => self.anno_key_sizes.range( AnnoKey { name: name.into(), - ns: SmartString::default(), + ns: String::default(), }..AnnoKey { name: name.into(), ns: std::char::MAX.to_string().into(), diff --git a/core/src/graph/mod.rs b/core/src/graph/mod.rs index 80d167fd8..4c76c5cd2 100644 --- a/core/src/graph/mod.rs +++ b/core/src/graph/mod.rs @@ -13,7 +13,6 @@ use crate::{ }; use clru::CLruCache; use rayon::prelude::*; -use smartstring::alias::String as SmartString; use std::ops::Bound::Included; use std::path::{Path, PathBuf}; use std::string::ToString; @@ -132,13 +131,13 @@ pub fn find_components_from_disk>( // try to load the component with the empty name let layer_file_name = layer.file_name(); let layer_name_from_file = layer_file_name.to_string_lossy(); - let layer_name: SmartString = if layer_name_from_file == DEFAULT_EMPTY_LAYER { - SmartString::default() + let layer_name = if layer_name_from_file == DEFAULT_EMPTY_LAYER { + String::default() } else { layer_name_from_file.into() }; let empty_name_component = - Component::new(c.clone(), layer_name.clone(), SmartString::default()); + Component::new(c.clone(), layer_name.clone(), String::default()); { let cfg_file = PathBuf::from(location.as_ref()) .join(component_to_relative_path(&empty_name_component)) @@ -1088,7 +1087,7 @@ impl Graph { if let (Some(ctype), Some(name)) = (&ctype, name) { // lookup component from sorted map let mut result: Vec<_> = Vec::new(); - let ckey = Component::new(ctype.clone(), SmartString::default(), name.into()); + let ckey = Component::new(ctype.clone(), String::default(), name.into()); for (c, _) in self.components.range(ckey..) { if c.name != name || &c.get_type() != ctype { @@ -1100,11 +1099,7 @@ impl Graph { } else if let Some(ctype) = &ctype { // lookup component from sorted map let mut result: Vec<_> = Vec::new(); - let ckey = Component::new( - ctype.clone(), - SmartString::default(), - SmartString::default(), - ); + let ckey = Component::new(ctype.clone(), String::default(), String::default()); for (c, _) in self.components.range(ckey..) { if &c.get_type() != ctype { diff --git a/core/src/types.rs b/core/src/types.rs index 6b223a87a..182e47eb2 100644 --- a/core/src/types.rs +++ b/core/src/types.rs @@ -1,7 +1,6 @@ use num_traits::{Bounded, FromPrimitive, Num, ToPrimitive}; use serde::de::DeserializeOwned; use serde::Serialize; -use smartstring::alias::String; use std::error::Error; use std::fmt; use std::ops::AddAssign; diff --git a/graphannis/Cargo.toml b/graphannis/Cargo.toml index 17c5431b6..fca1ef6e9 100644 --- a/graphannis/Cargo.toml +++ b/graphannis/Cargo.toml @@ -44,7 +44,6 @@ rustc-hash = "1.0" serde = { version = "1.0", features = ["rc"] } serde_derive = "1.0" smallvec = "1.6" -smartstring = { version = "1", features = ["serde"] } strum = "0.21" strum_macros = "0.21" sys-info = "0.9" diff --git a/graphannis/src/annis/db/aql/operators/near.rs b/graphannis/src/annis/db/aql/operators/near.rs index eab7f0661..17336ef08 100644 --- a/graphannis/src/annis/db/aql/operators/near.rs +++ b/graphannis/src/annis/db/aql/operators/near.rs @@ -50,7 +50,7 @@ impl BinaryOperatorSpec for NearSpec { ordering_layer.into(), self.segmentation .as_ref() - .map_or_else(smartstring::alias::String::default, |s| s.into()), + .map_or_else(String::default, |s| s.into()), ); let mut v = HashSet::default(); diff --git a/graphannis/src/annis/db/corpusstorage.rs b/graphannis/src/annis/db/corpusstorage.rs index 5f779b435..1c7519bb4 100644 --- a/graphannis/src/annis/db/corpusstorage.rs +++ b/graphannis/src/annis/db/corpusstorage.rs @@ -37,7 +37,6 @@ use linked_hash_map::LinkedHashMap; use memory_stats::memory_stats; use percent_encoding::{percent_decode_str, utf8_percent_encode, AsciiSet, CONTROLS}; use rand::Rng; -use smartstring::alias::String as SmartString; use std::collections::HashSet; use std::fmt; use std::fs::File; @@ -2001,7 +2000,7 @@ impl CorpusStorage { let timeout = TimeoutCheck::new(query.timeout); // Sort corpus names - let mut corpus_names: Vec = query + let mut corpus_names: Vec = query .corpus_names .iter() .map(|c| c.as_ref().into()) @@ -2466,7 +2465,7 @@ impl CorpusStorage { } else { result.push(Annotation { key: key.clone(), - val: SmartString::default(), + val: String::default(), }); } } @@ -2519,7 +2518,7 @@ impl CorpusStorage { } else { result.push(Annotation { key: key.clone(), - val: SmartString::new(), + val: String::new(), }); } } diff --git a/graphannis/src/annis/db/relannis.rs b/graphannis/src/annis/db/relannis.rs index 60f8d57eb..77b950be3 100644 --- a/graphannis/src/annis/db/relannis.rs +++ b/graphannis/src/annis/db/relannis.rs @@ -24,8 +24,6 @@ use graphannis_core::{ }; use itertools::Itertools; use percent_encoding::utf8_percent_encode; -use smartstring::alias::String; -use smartstring::{LazyCompact, SmartString}; use std::collections::BTreeMap; use std::collections::HashMap; use std::convert::TryInto; @@ -35,8 +33,7 @@ use std::ops::Bound; use std::path::{Path, PathBuf}; lazy_static! { - static ref INVALID_STRING: SmartString = - SmartString::::from(std::char::MAX.to_string()); + static ref INVALID_STRING: String = std::char::MAX.to_string(); static ref DEFAULT_VISUALIZER_RULES: Vec<(i64, bool, VisualizerRule)> = vec![ ( -1, @@ -793,7 +790,7 @@ fn get_field( i: usize, column_name: &str, file: &Path, -) -> crate::errors::Result>> { +) -> crate::errors::Result> { let r = record.get(i).ok_or_else(|| RelAnnisError::MissingColumn { pos: i, name: column_name.to_string(), @@ -808,9 +805,9 @@ fn get_field( } } -fn escape_field(val: &str) -> SmartString { +fn escape_field(val: &str) -> String { let mut chars = val.chars().peekable(); - let mut unescaped = SmartString::::new(); + let mut unescaped = String::new(); loop { match chars.next() { @@ -858,7 +855,7 @@ fn get_field_not_null( i: usize, column_name: &str, file: &Path, -) -> crate::errors::Result> { +) -> crate::errors::Result { let result = get_field(record, i, column_name, file)?.ok_or_else(|| RelAnnisError::UnexpectedNull { pos: i, From 991dce9de284354219ac939a5abc34bdab55bab7 Mon Sep 17 00:00:00 2001 From: Thomas Krause Date: Wed, 13 Aug 2025 16:32:33 +0200 Subject: [PATCH 2/7] Fix formatting --- capi/src/data.rs | 7 +- cli/src/bin/annis_bench_queries.rs | 4 +- core/src/annostorage/ondisk.rs | 47 ++--- core/src/annostorage/symboltable.rs | 14 +- core/src/dfs.rs | 3 +- core/src/graph/mod.rs | 148 +++++++------- core/src/graph/serialization/graphml.rs | 180 ++++++++--------- core/src/graph/storage/adjacencylist.rs | 28 +-- core/src/graph/storage/dense_adjacency.rs | 45 +++-- core/src/graph/storage/disk_adjacency.rs | 4 +- core/src/graph/storage/disk_path.rs | 8 +- core/src/graph/storage/disk_path/tests.rs | 2 +- core/src/graph/storage/legacy.rs | 2 +- core/src/graph/storage/linear.rs | 137 +++++++------ core/src/graph/storage/mod.rs | 8 +- core/src/graph/storage/prepost.rs | 18 +- core/src/graph/storage/registry.rs | 10 +- core/src/types.rs | 4 +- core/src/util/disk_collections.rs | 43 +++-- core/src/util/disk_collections/tests.rs | 2 +- core/src/util/example_graphs.rs | 2 +- core/src/util/mod.rs | 2 +- examples/tutorial/src/bin/apply_update.rs | 2 +- examples/tutorial/src/bin/find_subgraph.rs | 2 +- examples/tutorial/src/bin/query.rs | 2 +- examples/tutorial/src/bin/subcorpus_graph.rs | 2 +- graphannis/benches/graphannis.rs | 4 +- graphannis/src/annis/db/aql/conjunction.rs | 79 ++++---- .../src/annis/db/aql/conjunction/tests.rs | 5 +- graphannis/src/annis/db/aql/disjunction.rs | 2 +- graphannis/src/annis/db/aql/mod.rs | 24 +-- graphannis/src/annis/db/aql/model.rs | 115 ++++++----- graphannis/src/annis/db/aql/model/tests.rs | 4 +- .../src/annis/db/aql/operators/arity.rs | 2 +- .../src/annis/db/aql/operators/edge_op.rs | 37 ++-- .../src/annis/db/aql/operators/equal_value.rs | 37 ++-- .../annis/db/aql/operators/identical_cov.rs | 15 +- .../annis/db/aql/operators/identical_node.rs | 2 +- .../src/annis/db/aql/operators/inclusion.rs | 2 +- .../annis/db/aql/operators/leftalignment.rs | 2 +- graphannis/src/annis/db/aql/operators/near.rs | 2 +- .../src/annis/db/aql/operators/negated_op.rs | 2 +- .../annis/db/aql/operators/non_existing.rs | 2 +- .../src/annis/db/aql/operators/overlap.rs | 2 +- .../src/annis/db/aql/operators/precedence.rs | 2 +- .../annis/db/aql/operators/rightalignment.rs | 2 +- .../src/annis/db/corpusstorage/subgraph.rs | 78 ++++---- .../src/annis/db/corpusstorage/tests.rs | 181 ++++++++++-------- graphannis/src/annis/db/example_generator.rs | 2 +- graphannis/src/annis/db/exec/filter.rs | 6 +- graphannis/src/annis/db/exec/nestedloop.rs | 7 +- .../src/annis/db/exec/parallel/indexjoin.rs | 2 +- .../src/annis/db/exec/parallel/nestedloop.rs | 9 +- graphannis/src/annis/db/exec/tokensearch.rs | 13 +- graphannis/src/annis/db/plan.rs | 7 +- graphannis/src/annis/db/relannis.rs | 157 +++++++-------- graphannis/src/annis/db/token_helper.rs | 2 +- .../src/annis/util/sortablecontainer.rs | 2 +- graphannis/src/lib.rs | 2 +- graphannis/tests/searchtest.rs | 16 +- webservice/src/api/administration.rs | 67 ++++--- webservice/src/api/corpora.rs | 8 +- webservice/src/api/mod.rs | 2 +- webservice/src/api/search.rs | 6 +- webservice/src/extractors.rs | 32 ++-- webservice/src/main.rs | 8 +- webservice/src/tests.rs | 6 +- 67 files changed, 885 insertions(+), 796 deletions(-) diff --git a/capi/src/data.rs b/capi/src/data.rs index 731ded6a2..66a022165 100644 --- a/capi/src/data.rs +++ b/capi/src/data.rs @@ -49,9 +49,10 @@ pub type IterPtr = Box>>; fn iter_next(ptr: *mut Box>>, err: *mut *mut ErrorList) -> *mut T { let it: &mut Box>> = cast_mut(ptr); if let Some(v) = it.next() - && let Some(v) = map_cerr(v, err) { - return Box::into_raw(Box::new(v)); - } + && let Some(v) = map_cerr(v, err) + { + return Box::into_raw(Box::new(v)); + } std::ptr::null_mut() } diff --git a/cli/src/bin/annis_bench_queries.rs b/cli/src/bin/annis_bench_queries.rs index 49141d9be..d717402c2 100644 --- a/cli/src/bin/annis_bench_queries.rs +++ b/cli/src/bin/annis_bench_queries.rs @@ -5,16 +5,16 @@ extern crate graphannis; use clap::*; use criterion::BenchmarkGroup; -use criterion::{measurement::Measurement, Criterion}; +use criterion::{Criterion, measurement::Measurement}; use std::collections::BTreeSet; use std::path::{Path, PathBuf}; use std::time::Duration; use std::sync::Arc; +use graphannis::CorpusStorage; use graphannis::corpusstorage::{QueryLanguage, SearchQuery}; use graphannis::util::{self, SearchDef}; -use graphannis::CorpusStorage; pub fn create_query_input( data_dir: &Path, diff --git a/core/src/annostorage/ondisk.rs b/core/src/annostorage/ondisk.rs index b880dc9ca..539590660 100644 --- a/core/src/annostorage/ondisk.rs +++ b/core/src/annostorage/ondisk.rs @@ -705,9 +705,10 @@ where }) .filter_map_ok(move |(item, anno_key, item_value)| { if let Some(item_value) = item_value - && item_value != value { - return Some((item, anno_key).into()); - } + && item_value != value + { + return Some((item, anno_key).into()); + } None }); Box::new(it) @@ -938,27 +939,27 @@ where .copied() .unwrap_or_default(); if let Some(histo) = self.histogram_bounds.get(&anno_key) - && !histo.is_empty() { - let sampled_values = histo.iter().choose_multiple(&mut rng, 20); - - let matches = sampled_values - .iter() - .filter(|v| pattern.is_match(v)) - .count(); - if sampled_values.len() == matches { - // Assume all values match - guessed_count += anno_size; - } else if matches == 0 { - // No match found, but use the bucket size as pessimistic guess - guessed_count += - (anno_size as f64 / sampled_values.len() as f64) as usize; - } else { - // Use the percent of matched values to guess the overall number - let match_ratio = - (matches as f64) / (sampled_values.len() as f64); - guessed_count += ((anno_size as f64) * match_ratio) as usize; - } + && !histo.is_empty() + { + let sampled_values = histo.iter().choose_multiple(&mut rng, 20); + + let matches = sampled_values + .iter() + .filter(|v| pattern.is_match(v)) + .count(); + if sampled_values.len() == matches { + // Assume all values match + guessed_count += anno_size; + } else if matches == 0 { + // No match found, but use the bucket size as pessimistic guess + guessed_count += + (anno_size as f64 / sampled_values.len() as f64) as usize; + } else { + // Use the percent of matched values to guess the overall number + let match_ratio = (matches as f64) / (sampled_values.len() as f64); + guessed_count += ((anno_size as f64) * match_ratio) as usize; } + } } } } diff --git a/core/src/annostorage/symboltable.rs b/core/src/annostorage/symboltable.rs index d7d278761..0d778e6bf 100644 --- a/core/src/annostorage/symboltable.rs +++ b/core/src/annostorage/symboltable.rs @@ -84,17 +84,19 @@ where pub fn get_value(&self, id: usize) -> Option> { if id < self.by_id.len() - && let Some(ref val) = self.by_id[id] { - return Some(val.clone()); - } + && let Some(ref val) = self.by_id[id] + { + return Some(val.clone()); + } None } pub fn get_value_ref(&self, id: usize) -> Option<&T> { if id < self.by_id.len() - && let Some(ref val) = self.by_id[id] { - return Some(val.as_ref()); - } + && let Some(ref val) = self.by_id[id] + { + return Some(val.as_ref()); + } None } diff --git a/core/src/dfs.rs b/core/src/dfs.rs index b849a60b2..211720b15 100644 --- a/core/src/dfs.rs +++ b/core/src/dfs.rs @@ -113,8 +113,7 @@ impl<'a> CycleSafeDFS<'a> { } trace!( "enter_node finished with result {} for node {}", - found, - node + found, node ); Ok(found) } diff --git a/core/src/graph/mod.rs b/core/src/graph/mod.rs index 67e1ec4a3..5d1f27761 100644 --- a/core/src/graph/mod.rs +++ b/core/src/graph/mod.rs @@ -520,11 +520,12 @@ impl Graph { )?; // only add edge if both nodes already exist if let (Some(source), Some(target)) = (source, target) - && let Ok(ctype) = CT::from_str(component_type) { - let c = Component::new(ctype, layer.into(), component_name.into()); - let gs = self.get_or_create_writable(&c)?; - gs.add_edge(Edge { source, target })?; - } + && let Ok(ctype) = CT::from_str(component_type) + { + let c = Component::new(ctype, layer.into(), component_name.into()); + let gs = self.get_or_create_writable(&c)?; + gs.add_edge(Edge { source, target })?; + } } UpdateEvent::DeleteEdge { source_node, @@ -542,12 +543,13 @@ impl Graph { &mut node_id_cache, )?; if let (Some(source), Some(target)) = (source, target) - && let Ok(ctype) = CT::from_str(component_type) { - let c = Component::new(ctype, layer.into(), component_name.into()); + && let Ok(ctype) = CT::from_str(component_type) + { + let c = Component::new(ctype, layer.into(), component_name.into()); - let gs = self.get_or_create_writable(&c)?; - gs.delete_edge(&Edge { source, target })?; - } + let gs = self.get_or_create_writable(&c)?; + gs.delete_edge(&Edge { source, target })?; + } } UpdateEvent::AddEdgeLabel { source_node, @@ -568,22 +570,23 @@ impl Graph { &mut node_id_cache, )?; if let (Some(source), Some(target)) = (source, target) - && let Ok(ctype) = CT::from_str(component_type) { - let c = Component::new(ctype, layer.into(), component_name.into()); - let gs = self.get_or_create_writable(&c)?; - // only add label if the edge already exists - let e = Edge { source, target }; - if gs.is_connected(source, target, 1, Included(1))? { - let anno = Annotation { - key: AnnoKey { - ns: anno_ns.into(), - name: anno_name.into(), - }, - val: anno_value.into(), - }; - gs.add_edge_annotation(e, anno)?; - } + && let Ok(ctype) = CT::from_str(component_type) + { + let c = Component::new(ctype, layer.into(), component_name.into()); + let gs = self.get_or_create_writable(&c)?; + // only add label if the edge already exists + let e = Edge { source, target }; + if gs.is_connected(source, target, 1, Included(1))? { + let anno = Annotation { + key: AnnoKey { + ns: anno_ns.into(), + name: anno_name.into(), + }, + val: anno_value.into(), + }; + gs.add_edge_annotation(e, anno)?; } + } } UpdateEvent::DeleteEdgeLabel { source_node, @@ -603,19 +606,20 @@ impl Graph { &mut node_id_cache, )?; if let (Some(source), Some(target)) = (source, target) - && let Ok(ctype) = CT::from_str(component_type) { - let c = Component::new(ctype, layer.into(), component_name.into()); - let gs = self.get_or_create_writable(&c)?; - // only add label if the edge already exists - let e = Edge { source, target }; - if gs.is_connected(source, target, 1, Included(1))? { - let key = AnnoKey { - ns: anno_ns.into(), - name: anno_name.into(), - }; - gs.delete_edge_annotation(&e, &key)?; - } + && let Ok(ctype) = CT::from_str(component_type) + { + let c = Component::new(ctype, layer.into(), component_name.into()); + let gs = self.get_or_create_writable(&c)?; + // only add label if the edge already exists + let e = Edge { source, target }; + if gs.is_connected(source, target, 1, Included(1))? { + let key = AnnoKey { + ns: anno_ns.into(), + name: anno_name.into(), + }; + gs.delete_edge_annotation(&e, &key)?; } + } } } // end match update entry type ComponentType::after_update_event(change, self, &mut update_graph_index)?; @@ -885,9 +889,10 @@ impl Graph { pub fn is_loaded(&self, c: &Component) -> bool { let entry: Option<&Option>> = self.components.get(c); if let Some(gs_opt) = entry - && gs_opt.is_some() { - return true; - } + && gs_opt.is_some() + { + return true; + } false } @@ -1017,32 +1022,33 @@ impl Graph { pub fn optimize_gs_impl(&mut self, c: &Component) -> Result<()> { if let Some(gs) = self.get_graphstorage(c) - && let Some(stats) = gs.get_statistics() { - let opt_info = registry::get_optimal_impl_heuristic(self, stats); - - // convert if necessary - if opt_info.id != gs.serialization_id() { - let mut new_gs = registry::create_from_info(&opt_info)?; - let converted = if let Some(new_gs_mut) = Arc::get_mut(&mut new_gs) { - info!( - "converting component {} to implementation {}", - c, opt_info.id, - ); - new_gs_mut.copy(self.get_node_annos(), gs.as_ref())?; - true - } else { - false - }; - if converted { - // insert into components map - info!( - "finished conversion of component {} to implementation {}", - c, opt_info.id, - ); - self.components.insert(c.clone(), Some(new_gs.clone())); - } + && let Some(stats) = gs.get_statistics() + { + let opt_info = registry::get_optimal_impl_heuristic(self, stats); + + // convert if necessary + if opt_info.id != gs.serialization_id() { + let mut new_gs = registry::create_from_info(&opt_info)?; + let converted = if let Some(new_gs_mut) = Arc::get_mut(&mut new_gs) { + info!( + "converting component {} to implementation {}", + c, opt_info.id, + ); + new_gs_mut.copy(self.get_node_annos(), gs.as_ref())?; + true + } else { + false + }; + if converted { + // insert into components map + info!( + "finished conversion of component {} to implementation {}", + c, opt_info.id, + ); + self.components.insert(c.clone(), Some(new_gs.clone())); } } + } Ok(()) } @@ -1109,13 +1115,15 @@ impl Graph { .keys() .filter(move |c| { if let Some(ctype) = ctype.clone() - && ctype != c.get_type() { - return false; - } + && ctype != c.get_type() + { + return false; + } if let Some(name) = name - && name != c.name { - return false; - } + && name != c.name + { + return false; + } true }) .cloned(); diff --git a/core/src/graph/serialization/graphml.rs b/core/src/graph/serialization/graphml.rs index 7cd01a9ef..e225dadea 100644 --- a/core/src/graph/serialization/graphml.rs +++ b/core/src/graph/serialization/graphml.rs @@ -2,18 +2,18 @@ use crate::{ annostorage::{Match, ValueSearch}, errors::{GraphAnnisCoreError, Result}, graph::{ + ANNIS_NS, Graph, NODE_NAME, NODE_NAME_KEY, NODE_TYPE, NODE_TYPE_KEY, update::{GraphUpdate, UpdateEvent}, - Graph, ANNIS_NS, NODE_NAME, NODE_NAME_KEY, NODE_TYPE, NODE_TYPE_KEY, }, types::{AnnoKey, Annotation, Component, ComponentType, Edge}, util::{join_qname, split_qname}, }; use itertools::Itertools; use quick_xml::{ + Reader, Writer, events::{ - attributes::Attributes, BytesCData, BytesDecl, BytesEnd, BytesStart, BytesText, Event, + BytesCData, BytesDecl, BytesEnd, BytesStart, BytesText, Event, attributes::Attributes, }, - Reader, Writer, }; use std::{ cmp::Ordering, @@ -79,27 +79,28 @@ fn write_annotation_keys( } for c in all_components { if !autogenerated_components.contains(&c) - && let Some(gs) = graph.get_graphstorage(&c) { - for key in gs.get_anno_storage().annotation_keys()? { - #[allow(clippy::map_entry)] - if !key_id_mapping.contains_key(&key) { - let new_id = format!("k{}", id_counter); - id_counter += 1; + && let Some(gs) = graph.get_graphstorage(&c) + { + for key in gs.get_anno_storage().annotation_keys()? { + #[allow(clippy::map_entry)] + if !key_id_mapping.contains_key(&key) { + let new_id = format!("k{}", id_counter); + id_counter += 1; - let qname = join_qname(&key.ns, &key.name); + let qname = join_qname(&key.ns, &key.name); - let mut key_start = BytesStart::new("key"); - key_start.push_attribute(("id", new_id.as_str())); - key_start.push_attribute(("for", "node")); - key_start.push_attribute(("attr.name", qname.as_str())); - key_start.push_attribute(("attr.type", "string")); + let mut key_start = BytesStart::new("key"); + key_start.push_attribute(("id", new_id.as_str())); + key_start.push_attribute(("for", "node")); + key_start.push_attribute(("attr.name", qname.as_str())); + key_start.push_attribute(("attr.type", "string")); - writer.write_event(Event::Empty(key_start))?; + writer.write_event(Event::Empty(key_start))?; - key_id_mapping.insert(key, new_id); - } + key_id_mapping.insert(key, new_id); } } + } } Ok(key_id_mapping) @@ -211,66 +212,67 @@ fn write_edges( for c in all_components { // Create edge annotation keys for all components, but skip auto-generated ones if !autogenerated_components.contains(&c) - && let Some(gs) = graph.get_graphstorage(&c) { - let source_nodes_iterator = if sorted { - Box::new(gs.source_nodes().sorted_unstable_by(compare_results)) - } else { - gs.source_nodes() - }; - for source in source_nodes_iterator { - let source = source?; - if let Some(source_id) = graph - .get_node_annos() - .get_value_for_item(&source, &NODE_NAME_KEY)? - { - let target_nodes_iterator = if sorted { - Box::new( - gs.get_outgoing_edges(source) - .sorted_unstable_by(compare_results), - ) - } else { + && let Some(gs) = graph.get_graphstorage(&c) + { + let source_nodes_iterator = if sorted { + Box::new(gs.source_nodes().sorted_unstable_by(compare_results)) + } else { + gs.source_nodes() + }; + for source in source_nodes_iterator { + let source = source?; + if let Some(source_id) = graph + .get_node_annos() + .get_value_for_item(&source, &NODE_NAME_KEY)? + { + let target_nodes_iterator = if sorted { + Box::new( gs.get_outgoing_edges(source) - }; - for target in target_nodes_iterator { - let target = target?; - if let Some(target_id) = graph - .get_node_annos() - .get_value_for_item(&target, &NODE_NAME_KEY)? - { - let edge = Edge { source, target }; - - let mut edge_id = edge_counter.to_string(); - edge_counter += 1; - edge_id.insert(0, 'e'); - - let mut edge_start = BytesStart::new("edge"); - edge_start.push_attribute(("id", edge_id.as_str())); - edge_start.push_attribute(("source", source_id.as_ref())); - edge_start.push_attribute(("target", target_id.as_ref())); - // Use the "label" attribute as component type. This is consistent with how Neo4j interprets this non-standard attribute - edge_start.push_attribute(("label", c.to_string().as_ref())); - - writer.write_event(Event::Start(edge_start))?; - - // Write all annotations of the node as "data" element, but sort - // them using the internal annotation key (k0, k1, k2, etc.) - let mut edge_annotations = - gs.get_anno_storage().get_annotations_for_item(&edge)?; - edge_annotations.sort_unstable_by_key(|anno| { - key_id_mapping - .get(&anno.key) - .map(|internal_key| internal_key.as_str()) - .unwrap_or("") - }); - for anno in edge_annotations { - write_data(anno, writer, key_id_mapping)?; - } - writer.write_event(Event::End(BytesEnd::new("edge")))?; + .sorted_unstable_by(compare_results), + ) + } else { + gs.get_outgoing_edges(source) + }; + for target in target_nodes_iterator { + let target = target?; + if let Some(target_id) = graph + .get_node_annos() + .get_value_for_item(&target, &NODE_NAME_KEY)? + { + let edge = Edge { source, target }; + + let mut edge_id = edge_counter.to_string(); + edge_counter += 1; + edge_id.insert(0, 'e'); + + let mut edge_start = BytesStart::new("edge"); + edge_start.push_attribute(("id", edge_id.as_str())); + edge_start.push_attribute(("source", source_id.as_ref())); + edge_start.push_attribute(("target", target_id.as_ref())); + // Use the "label" attribute as component type. This is consistent with how Neo4j interprets this non-standard attribute + edge_start.push_attribute(("label", c.to_string().as_ref())); + + writer.write_event(Event::Start(edge_start))?; + + // Write all annotations of the node as "data" element, but sort + // them using the internal annotation key (k0, k1, k2, etc.) + let mut edge_annotations = + gs.get_anno_storage().get_annotations_for_item(&edge)?; + edge_annotations.sort_unstable_by_key(|anno| { + key_id_mapping + .get(&anno.key) + .map(|internal_key| internal_key.as_str()) + .unwrap_or("") + }); + for anno in edge_annotations { + write_data(anno, writer, key_id_mapping)?; } + writer.write_event(Event::End(BytesEnd::new("edge")))?; } } } } + } } Ok(()) } @@ -594,10 +596,13 @@ fn read_graphml( } Event::CData(t) => { if let Some(current_data_key) = ¤t_data_key - && in_graph && level == 3 && current_data_key == "k0" { - // This is the configuration content - config = Some(String::from_utf8_lossy(&t).to_string()); - } + && in_graph + && level == 3 + && current_data_key == "k0" + { + // This is the configuration content + config = Some(String::from_utf8_lossy(&t).to_string()); + } } Event::End(ref e) => { match e.name().0 { @@ -636,17 +641,18 @@ fn read_graphml( } b"data" => { if let Some(current_data_key) = current_data_key - && let Some(anno_key) = keys.get(¤t_data_key) { - // Copy all data attributes into our own map - if let Some(v) = current_data_value.take() { - data.insert(anno_key.clone(), v); - } else { - // If there is an end tag without any text - // data event, the value exists but is - // empty. - data.insert(anno_key.clone(), String::default()); - } + && let Some(anno_key) = keys.get(¤t_data_key) + { + // Copy all data attributes into our own map + if let Some(v) = current_data_value.take() { + data.insert(anno_key.clone(), v); + } else { + // If there is an end tag without any text + // data event, the value exists but is + // empty. + data.insert(anno_key.clone(), String::default()); } + } current_data_value = None; current_data_key = None; @@ -716,7 +722,7 @@ where mod tests { use super::*; use crate::{ - graph::{GraphUpdate, DEFAULT_NS}, + graph::{DEFAULT_NS, GraphUpdate}, types::DefaultComponentType, }; use pretty_assertions::assert_eq; diff --git a/core/src/graph/storage/adjacencylist.rs b/core/src/graph/storage/adjacencylist.rs index f4386a6e3..6b23a5529 100644 --- a/core/src/graph/storage/adjacencylist.rs +++ b/core/src/graph/storage/adjacencylist.rs @@ -1,6 +1,6 @@ use crate::{ annostorage::{ - inmemory::AnnoStorageImpl, AnnotationStorage, EdgeAnnotationStorage, NodeAnnotationStorage, + AnnotationStorage, EdgeAnnotationStorage, NodeAnnotationStorage, inmemory::AnnoStorageImpl, }, dfs::CycleSafeDFS, errors::Result, @@ -8,10 +8,9 @@ use crate::{ }; use super::{ - deserialize_gs_field, + EdgeContainer, GraphStatistic, GraphStorage, WriteableGraphStorage, deserialize_gs_field, legacy::{self, AdjacencyListStorageV1}, - load_statistics_from_location, save_statistics_to_toml, serialize_gs_field, EdgeContainer, - GraphStatistic, GraphStorage, WriteableGraphStorage, + load_statistics_from_location, save_statistics_to_toml, serialize_gs_field, }; use itertools::Itertools; use rustc_hash::FxHashSet; @@ -295,22 +294,25 @@ impl WriteableGraphStorage for AdjacencyListStorage { fn add_edge_annotation(&mut self, edge: Edge, anno: Annotation) -> Result<()> { if let Some(outgoing) = self.edges.get(&edge.source) - && outgoing.contains(&edge.target) { - self.annos.insert(edge, anno)?; - } + && outgoing.contains(&edge.target) + { + self.annos.insert(edge, anno)?; + } Ok(()) } fn delete_edge(&mut self, edge: &Edge) -> Result<()> { if let Some(outgoing) = self.edges.get_mut(&edge.source) - && let Ok(idx) = outgoing.binary_search(&edge.target) { - outgoing.remove(idx); - } + && let Ok(idx) = outgoing.binary_search(&edge.target) + { + outgoing.remove(idx); + } if let Some(ingoing) = self.inverse_edges.get_mut(&edge.target) - && let Ok(idx) = ingoing.binary_search(&edge.source) { - ingoing.remove(idx); - } + && let Ok(idx) = ingoing.binary_search(&edge.source) + { + ingoing.remove(idx); + } self.annos.remove_item(edge)?; Ok(()) diff --git a/core/src/graph/storage/dense_adjacency.rs b/core/src/graph/storage/dense_adjacency.rs index 4daffa08c..66c6413b5 100644 --- a/core/src/graph/storage/dense_adjacency.rs +++ b/core/src/graph/storage/dense_adjacency.rs @@ -1,10 +1,11 @@ use super::{ - deserialize_gs_field, legacy::DenseAdjacencyListStorageV1, load_statistics_from_location, - save_statistics_to_toml, serialize_gs_field, EdgeContainer, GraphStatistic, GraphStorage, + EdgeContainer, GraphStatistic, GraphStorage, deserialize_gs_field, + legacy::DenseAdjacencyListStorageV1, load_statistics_from_location, save_statistics_to_toml, + serialize_gs_field, }; use crate::{ annostorage::{ - inmemory::AnnoStorageImpl, AnnotationStorage, EdgeAnnotationStorage, NodeAnnotationStorage, + AnnotationStorage, EdgeAnnotationStorage, NodeAnnotationStorage, inmemory::AnnoStorageImpl, }, dfs::CycleSafeDFS, errors::Result, @@ -49,9 +50,10 @@ impl EdgeContainer for DenseAdjacencyListStorage { ) -> Box> + 'a> { if let Some(node) = node.to_usize() && node < self.edges.len() - && let Some(outgoing) = self.edges[node] { - return Box::new(std::iter::once(Ok(outgoing))); - } + && let Some(outgoing) = self.edges[node] + { + return Box::new(std::iter::once(Ok(outgoing))); + } Box::new(std::iter::empty()) } @@ -178,23 +180,24 @@ impl GraphStorage for DenseAdjacencyListStorage { for source in orig.source_nodes() { let source = source?; if let Some(idx) = source.to_usize() - && let Some(target) = orig.get_outgoing_edges(source).next() { - let target = target?; - // insert edge - self.edges[idx] = Some(target); + && let Some(target) = orig.get_outgoing_edges(source).next() + { + let target = target?; + // insert edge + self.edges[idx] = Some(target); - // insert inverse edge - let e = Edge { source, target }; - let inverse_entry = self.inverse_edges.entry(e.target).or_default(); - // no need to insert it: edge already exists - if let Err(insertion_idx) = inverse_entry.binary_search(&e.source) { - inverse_entry.insert(insertion_idx, e.source); - } - // insert annotation - for a in orig.get_anno_storage().get_annotations_for_item(&e)? { - self.annos.insert(e.clone(), a)?; - } + // insert inverse edge + let e = Edge { source, target }; + let inverse_entry = self.inverse_edges.entry(e.target).or_default(); + // no need to insert it: edge already exists + if let Err(insertion_idx) = inverse_entry.binary_search(&e.source) { + inverse_entry.insert(insertion_idx, e.source); } + // insert annotation + for a in orig.get_anno_storage().get_annotations_for_item(&e)? { + self.annos.insert(e.clone(), a)?; + } + } } self.stats = orig.get_statistics().cloned(); self.annos.calculate_statistics()?; diff --git a/core/src/graph/storage/disk_adjacency.rs b/core/src/graph/storage/disk_adjacency.rs index f38b9bdfb..d3e992409 100644 --- a/core/src/graph/storage/disk_adjacency.rs +++ b/core/src/graph/storage/disk_adjacency.rs @@ -1,10 +1,10 @@ use super::*; use crate::{ - annostorage::{ondisk::AnnoStorageImpl, NodeAnnotationStorage}, + annostorage::{NodeAnnotationStorage, ondisk::AnnoStorageImpl}, dfs::CycleSafeDFS, errors::Result, - util::disk_collections::{DiskMap, EvictionStrategy, DEFAULT_BLOCK_CACHE_CAPACITY}, + util::disk_collections::{DEFAULT_BLOCK_CACHE_CAPACITY, DiskMap, EvictionStrategy}, }; use itertools::Itertools; use rustc_hash::FxHashSet; diff --git a/core/src/graph/storage/disk_path.rs b/core/src/graph/storage/disk_path.rs index 9264bd616..a5a668c96 100644 --- a/core/src/graph/storage/disk_path.rs +++ b/core/src/graph/storage/disk_path.rs @@ -8,17 +8,17 @@ use tempfile::tempfile; use transient_btree_index::BtreeConfig; use crate::{ - annostorage::{ondisk::AnnoStorageImpl, AnnotationStorage}, + annostorage::{AnnotationStorage, ondisk::AnnoStorageImpl}, dfs::CycleSafeDFS, errors::Result, try_as_boxed_iter, types::{Edge, NodeID}, - util::disk_collections::{DiskMap, EvictionStrategy, DEFAULT_BLOCK_CACHE_CAPACITY}, + util::disk_collections::{DEFAULT_BLOCK_CACHE_CAPACITY, DiskMap, EvictionStrategy}, }; use super::{ - load_statistics_from_location, save_statistics_to_toml, EdgeContainer, GraphStatistic, - GraphStorage, + EdgeContainer, GraphStatistic, GraphStorage, load_statistics_from_location, + save_statistics_to_toml, }; use binary_layout::prelude::*; diff --git a/core/src/graph/storage/disk_path/tests.rs b/core/src/graph/storage/disk_path/tests.rs index e2418c3a3..e78717d67 100644 --- a/core/src/graph/storage/disk_path/tests.rs +++ b/core/src/graph/storage/disk_path/tests.rs @@ -1,6 +1,6 @@ use super::*; use crate::{ - graph::storage::{adjacencylist::AdjacencyListStorage, WriteableGraphStorage}, + graph::storage::{WriteableGraphStorage, adjacencylist::AdjacencyListStorage}, types::{AnnoKey, Annotation}, }; use pretty_assertions::assert_eq; diff --git a/core/src/graph/storage/legacy.rs b/core/src/graph/storage/legacy.rs index ad011bd48..2d39eaaf3 100644 --- a/core/src/graph/storage/legacy.rs +++ b/core/src/graph/storage/legacy.rs @@ -14,9 +14,9 @@ use crate::{ }; use super::{ + GraphStatistic, linear::RelativePosition, prepost::{OrderVecEntry, PrePost}, - GraphStatistic, }; /// Some general statistical numbers specific to a graph component diff --git a/core/src/graph/storage/linear.rs b/core/src/graph/storage/linear.rs index dc6aab964..9fcd67363 100644 --- a/core/src/graph/storage/linear.rs +++ b/core/src/graph/storage/linear.rs @@ -1,10 +1,11 @@ use super::{ - deserialize_gs_field, legacy::LinearGraphStorageV1, load_statistics_from_location, - save_statistics_to_toml, serialize_gs_field, EdgeContainer, GraphStatistic, GraphStorage, + EdgeContainer, GraphStatistic, GraphStorage, deserialize_gs_field, + legacy::LinearGraphStorageV1, load_statistics_from_location, save_statistics_to_toml, + serialize_gs_field, }; use crate::{ annostorage::{ - inmemory::AnnoStorageImpl, AnnotationStorage, EdgeAnnotationStorage, NodeAnnotationStorage, + AnnotationStorage, EdgeAnnotationStorage, NodeAnnotationStorage, inmemory::AnnoStorageImpl, }, dfs::CycleSafeDFS, errors::Result, @@ -94,9 +95,10 @@ where if let Some(chain) = self.node_chains.get(&pos.root) { let next_pos = pos.pos.clone() + PosT::one(); if let Some(next_pos) = next_pos.to_usize() - && next_pos < chain.len() { - return Box::from(std::iter::once(Ok(chain[next_pos]))); - } + && next_pos < chain.len() + { + return Box::from(std::iter::once(Ok(chain[next_pos]))); + } } } Box::from(std::iter::empty()) @@ -110,9 +112,10 @@ where // find the previous node in the chain if let Some(chain) = self.node_chains.get(&pos.root) && let Some(pos) = pos.pos.to_usize() - && let Some(previous_pos) = pos.checked_sub(1) { - return Box::from(std::iter::once(Ok(chain[previous_pos]))); - } + && let Some(previous_pos) = pos.checked_sub(1) + { + return Box::from(std::iter::once(Ok(chain[previous_pos]))); + } } Box::from(std::iter::empty()) } @@ -205,26 +208,23 @@ where ) -> Box> + 'a> { if let Some(start_pos) = self.node_to_pos.get(&source) && let Some(chain) = self.node_chains.get(&start_pos.root) - && let Some(offset) = start_pos.pos.to_usize() - && let Some(min_distance) = offset.checked_add(min_distance) - && min_distance < chain.len() { - let max_distance = match max_distance { - std::ops::Bound::Unbounded => { - return Box::new(chain[min_distance..].iter().map(|n| Ok(*n))); - } - std::ops::Bound::Included(max_distance) => { - offset + max_distance + 1 - } - std::ops::Bound::Excluded(max_distance) => offset + max_distance, - }; - // clip to chain length - let max_distance = std::cmp::min(chain.len(), max_distance); - if min_distance < max_distance { - return Box::new( - chain[min_distance..max_distance].iter().map(|n| Ok(*n)), - ); - } - } + && let Some(offset) = start_pos.pos.to_usize() + && let Some(min_distance) = offset.checked_add(min_distance) + && min_distance < chain.len() + { + let max_distance = match max_distance { + std::ops::Bound::Unbounded => { + return Box::new(chain[min_distance..].iter().map(|n| Ok(*n))); + } + std::ops::Bound::Included(max_distance) => offset + max_distance + 1, + std::ops::Bound::Excluded(max_distance) => offset + max_distance, + }; + // clip to chain length + let max_distance = std::cmp::min(chain.len(), max_distance); + if min_distance < max_distance { + return Box::new(chain[min_distance..max_distance].iter().map(|n| Ok(*n))); + } + } Box::new(std::iter::empty()) } @@ -236,31 +236,24 @@ where ) -> Box> + 'a> { if let Some(start_pos) = self.node_to_pos.get(&source) && let Some(chain) = self.node_chains.get(&start_pos.root) - && let Some(offset) = start_pos.pos.to_usize() { - let max_distance = match max_distance { - std::ops::Bound::Unbounded => 0, - std::ops::Bound::Included(max_distance) => { - offset.saturating_sub(max_distance) - } - std::ops::Bound::Excluded(max_distance) => { - offset.saturating_sub(max_distance + 1) - } - }; + && let Some(offset) = start_pos.pos.to_usize() + { + let max_distance = match max_distance { + std::ops::Bound::Unbounded => 0, + std::ops::Bound::Included(max_distance) => offset.saturating_sub(max_distance), + std::ops::Bound::Excluded(max_distance) => offset.saturating_sub(max_distance + 1), + }; - if let Some(min_distance) = offset.checked_sub(min_distance) { - if min_distance < chain.len() && max_distance <= min_distance { - // return all entries in the chain between min_distance..max_distance (inclusive) - return Box::new( - chain[max_distance..=min_distance].iter().map(|n| Ok(*n)), - ); - } else if max_distance < chain.len() { - // return all entries in the chain between min_distance..max_distance - return Box::new( - chain[max_distance..chain.len()].iter().map(|n| Ok(*n)), - ); - } - } + if let Some(min_distance) = offset.checked_sub(min_distance) { + if min_distance < chain.len() && max_distance <= min_distance { + // return all entries in the chain between min_distance..max_distance (inclusive) + return Box::new(chain[max_distance..=min_distance].iter().map(|n| Ok(*n))); + } else if max_distance < chain.len() { + // return all entries in the chain between min_distance..max_distance + return Box::new(chain[max_distance..chain.len()].iter().map(|n| Ok(*n))); } + } + } Box::new(std::iter::empty()) } @@ -271,12 +264,14 @@ where if let (Some(source_pos), Some(target_pos)) = (self.node_to_pos.get(&source), self.node_to_pos.get(&target)) - && source_pos.root == target_pos.root && source_pos.pos <= target_pos.pos { - let diff = target_pos.pos.clone() - source_pos.pos.clone(); - if let Some(diff) = diff.to_usize() { - return Ok(Some(diff)); - } + && source_pos.root == target_pos.root + && source_pos.pos <= target_pos.pos + { + let diff = target_pos.pos.clone() - source_pos.pos.clone(); + if let Some(diff) = diff.to_usize() { + return Ok(Some(diff)); } + } Ok(None) } @@ -289,22 +284,24 @@ where ) -> Result { if let (Some(source_pos), Some(target_pos)) = (self.node_to_pos.get(&source), self.node_to_pos.get(&target)) - && source_pos.root == target_pos.root && source_pos.pos <= target_pos.pos { - let diff = target_pos.pos.clone() - source_pos.pos.clone(); - if let Some(diff) = diff.to_usize() { - match max_distance { - std::ops::Bound::Unbounded => { - return Ok(diff >= min_distance); - } - std::ops::Bound::Included(max_distance) => { - return Ok(diff >= min_distance && diff <= max_distance); - } - std::ops::Bound::Excluded(max_distance) => { - return Ok(diff >= min_distance && diff < max_distance); - } + && source_pos.root == target_pos.root + && source_pos.pos <= target_pos.pos + { + let diff = target_pos.pos.clone() - source_pos.pos.clone(); + if let Some(diff) = diff.to_usize() { + match max_distance { + std::ops::Bound::Unbounded => { + return Ok(diff >= min_distance); + } + std::ops::Bound::Included(max_distance) => { + return Ok(diff >= min_distance && diff <= max_distance); + } + std::ops::Bound::Excluded(max_distance) => { + return Ok(diff >= min_distance && diff < max_distance); } } } + } Ok(false) } diff --git a/core/src/graph/storage/mod.rs b/core/src/graph/storage/mod.rs index 52f0498fc..6d3e4f286 100644 --- a/core/src/graph/storage/mod.rs +++ b/core/src/graph/storage/mod.rs @@ -56,7 +56,13 @@ impl std::fmt::Display for GraphStatistic { write!( f, "nodes={}, root nodes={}, avg_fan_out={:.2}, max_fan_out={}, fan_out_99%={}, inv_fan_out_99%={}, max_depth={}", - self.nodes, self.root_nodes, self.avg_fan_out, self.max_fan_out, self.fan_out_99_percentile, self.inverse_fan_out_99_percentile, self.max_depth + self.nodes, + self.root_nodes, + self.avg_fan_out, + self.max_fan_out, + self.fan_out_99_percentile, + self.inverse_fan_out_99_percentile, + self.max_depth )?; if self.cyclic { write!(f, ", cyclic")?; diff --git a/core/src/graph/storage/prepost.rs b/core/src/graph/storage/prepost.rs index fb49f3602..275ed982c 100644 --- a/core/src/graph/storage/prepost.rs +++ b/core/src/graph/storage/prepost.rs @@ -409,10 +409,11 @@ where // check the level if let (Some(source_level), Some(target_level)) = (order_source.level.to_usize(), order_target.level.to_usize()) - && source_level <= target_level { - was_found = true; - min_level = std::cmp::min(target_level - source_level, min_level); - } + && source_level <= target_level + { + was_found = true; + min_level = std::cmp::min(target_level - source_level, min_level); + } } } } @@ -449,10 +450,11 @@ where // check the level if let (Some(source_level), Some(target_level)) = (order_source.level.to_usize(), order_target.level.to_usize()) - && source_level <= target_level { - let diff_level = target_level - source_level; - return Ok(min_distance <= diff_level && diff_level <= max_distance); - } + && source_level <= target_level + { + let diff_level = target_level - source_level; + return Ok(min_distance <= diff_level && diff_level <= max_distance); + } } } } diff --git a/core/src/graph/storage/registry.rs b/core/src/graph/storage/registry.rs index 1ff7b6bc9..d2f7ae477 100644 --- a/core/src/graph/storage/registry.rs +++ b/core/src/graph/storage/registry.rs @@ -4,8 +4,8 @@ use super::disk_adjacency::DiskAdjacencyListStorage; use super::disk_path::DiskPathStorage; use super::linear::LinearGraphStorage; +use super::{GraphStatistic, GraphStorage, prepost::PrePostOrderStorage}; use super::{disk_adjacency, disk_path}; -use super::{prepost::PrePostOrderStorage, GraphStatistic, GraphStorage}; use crate::{ errors::{GraphAnnisCoreError, Result}, graph::Graph, @@ -114,9 +114,11 @@ fn get_adjacencylist_impl(db: &Graph, stats: &GraphStatis } else { // check if a large percentage of nodes are part of the graph storage if let Ok(Some(largest_node_id)) = db.node_annos.get_largest_item() - && stats.max_fan_out <= 1 && (stats.nodes as f64 / largest_node_id as f64) >= 0.75 { - return create_info::(); - } + && stats.max_fan_out <= 1 + && (stats.nodes as f64 / largest_node_id as f64) >= 0.75 + { + return create_info::(); + } create_info::() } diff --git a/core/src/types.rs b/core/src/types.rs index 182e47eb2..984b38c92 100644 --- a/core/src/types.rs +++ b/core/src/types.rs @@ -1,6 +1,6 @@ use num_traits::{Bounded, FromPrimitive, Num, ToPrimitive}; -use serde::de::DeserializeOwned; use serde::Serialize; +use serde::de::DeserializeOwned; use std::error::Error; use std::fmt; use std::ops::AddAssign; @@ -13,7 +13,7 @@ use super::serializer::{FixedSizeKeySerializer, KeySerializer}; use crate::serializer::KeyVec; use crate::{ errors::{ComponentTypeError, GraphAnnisCoreError}, - graph::{update::UpdateEvent, Graph}, + graph::{Graph, update::UpdateEvent}, }; use fmt::Debug; use std::result::Result as StdResult; diff --git a/core/src/util/disk_collections.rs b/core/src/util/disk_collections.rs index ad4d94b92..28cfea741 100644 --- a/core/src/util/disk_collections.rs +++ b/core/src/util/disk_collections.rs @@ -74,12 +74,12 @@ where let mut disk_table = None; if let Some(persisted_file) = persisted_file - && persisted_file.is_file() { - // Use existing file as read-only table which contains the whole map - let table = - Table::new_from_file(custom_options(block_cache_capacity), persisted_file)?; - disk_table = Some(table); - } + && persisted_file.is_file() + { + // Use existing file as read-only table which contains the whole map + let table = Table::new_from_file(custom_options(block_cache_capacity), persisted_file)?; + disk_table = Some(table); + } Ok(DiskMap { eviction_strategy, @@ -129,15 +129,16 @@ where } // Check C1 (BTree disk index) if let Some(c1) = &self.c1 - && let Some(entry) = c1.get(key)? { - if let Some(value) = entry { - return Ok(Some(Cow::Owned(value))); - } else { - // Value was explicitly deleted with a tombstone entry. - // Do not query C1 and C2. - return Ok(None); - } + && let Some(entry) = c1.get(key)? + { + if let Some(value) = entry { + return Ok(Some(Cow::Owned(value))); + } else { + // Value was explicitly deleted with a tombstone entry. + // Do not query C1 and C2. + return Ok(None); } + } // Check the C2 (sstable) if let Some(c2) = &self.c2 { @@ -169,9 +170,10 @@ where // Check C1 (BTree disk index) if let Some(c1) = &self.c1 - && c1.contains_key(key)? { - return Ok(true); - } + && c1.contains_key(key)? + { + return Ok(true); + } // Use a iterator on the single disk to check if there is an entry with this, without getting the value. // Since we don't serialize tombstone entries when compacting or writing the disk table to an output file, @@ -181,9 +183,10 @@ where let key = K::create_key(key); table_it.seek(&key); if let Some(it_key) = table_it.current_key() - && it_key == key.as_ref() { - return Ok(true); - } + && it_key == key.as_ref() + { + return Ok(true); + } } Ok(false) } diff --git a/core/src/util/disk_collections/tests.rs b/core/src/util/disk_collections/tests.rs index a5939cf62..e5e74552b 100644 --- a/core/src/util/disk_collections/tests.rs +++ b/core/src/util/disk_collections/tests.rs @@ -1,8 +1,8 @@ use super::*; +use fake::Fake; use fake::faker::name::raw::*; use fake::locales::*; -use fake::Fake; use tempfile::NamedTempFile; #[test] diff --git a/core/src/util/example_graphs.rs b/core/src/util/example_graphs.rs index 1f082c29c..02a19d959 100644 --- a/core/src/util/example_graphs.rs +++ b/core/src/util/example_graphs.rs @@ -1,6 +1,6 @@ use crate::errors::Result; -use crate::graph::storage::adjacencylist::AdjacencyListStorage; use crate::graph::storage::WriteableGraphStorage; +use crate::graph::storage::adjacencylist::AdjacencyListStorage; use crate::types::{AnnoKey, Annotation, Edge}; /// Creates an example graph storage with the folllowing structure: diff --git a/core/src/util/mod.rs b/core/src/util/mod.rs index 479b1b4a3..12b479e63 100644 --- a/core/src/util/mod.rs +++ b/core/src/util/mod.rs @@ -1,5 +1,5 @@ use crate::errors::{GraphAnnisCoreError, Result}; -use percent_encoding::{utf8_percent_encode, AsciiSet, CONTROLS}; +use percent_encoding::{AsciiSet, CONTROLS, utf8_percent_encode}; use std::borrow::Cow; pub mod disk_collections; diff --git a/examples/tutorial/src/bin/apply_update.rs b/examples/tutorial/src/bin/apply_update.rs index 9dfd42166..c494687e5 100644 --- a/examples/tutorial/src/bin/apply_update.rs +++ b/examples/tutorial/src/bin/apply_update.rs @@ -1,5 +1,5 @@ -use graphannis::update::{GraphUpdate, UpdateEvent}; use graphannis::CorpusStorage; +use graphannis::update::{GraphUpdate, UpdateEvent}; use std::path::PathBuf; fn main() -> Result<(), Box> { diff --git a/examples/tutorial/src/bin/find_subgraph.rs b/examples/tutorial/src/bin/find_subgraph.rs index baf7e4907..c6e62f06d 100644 --- a/examples/tutorial/src/bin/find_subgraph.rs +++ b/examples/tutorial/src/bin/find_subgraph.rs @@ -1,6 +1,6 @@ +use graphannis::CorpusStorage; use graphannis::corpusstorage::{QueryLanguage, ResultOrder, SearchQuery}; use graphannis::util; -use graphannis::CorpusStorage; use std::path::PathBuf; fn main() { diff --git a/examples/tutorial/src/bin/query.rs b/examples/tutorial/src/bin/query.rs index d4fbab2a8..a738f1273 100644 --- a/examples/tutorial/src/bin/query.rs +++ b/examples/tutorial/src/bin/query.rs @@ -1,5 +1,5 @@ -use graphannis::corpusstorage::{QueryLanguage, ResultOrder, SearchQuery}; use graphannis::CorpusStorage; +use graphannis::corpusstorage::{QueryLanguage, ResultOrder, SearchQuery}; use std::path::PathBuf; fn main() { diff --git a/examples/tutorial/src/bin/subcorpus_graph.rs b/examples/tutorial/src/bin/subcorpus_graph.rs index 07c332477..d7a75b7d7 100644 --- a/examples/tutorial/src/bin/subcorpus_graph.rs +++ b/examples/tutorial/src/bin/subcorpus_graph.rs @@ -1,5 +1,5 @@ -use graphannis::update::{GraphUpdate, UpdateEvent}; use graphannis::CorpusStorage; +use graphannis::update::{GraphUpdate, UpdateEvent}; use std::path::PathBuf; fn main() -> Result<(), Box> { diff --git a/graphannis/benches/graphannis.rs b/graphannis/benches/graphannis.rs index 1e474bf24..6fbbe0692 100644 --- a/graphannis/benches/graphannis.rs +++ b/graphannis/benches/graphannis.rs @@ -7,13 +7,13 @@ extern crate rand; extern crate rustc_hash; use criterion::Criterion; +use fake::Fake; use fake::faker::name::raw::*; use fake::locales::*; -use fake::Fake; +use graphannis::CorpusStorage; use graphannis::corpusstorage::ResultOrder; use graphannis::corpusstorage::{QueryLanguage, SearchQuery}; use graphannis::update::{GraphUpdate, UpdateEvent}; -use graphannis::CorpusStorage; use std::collections::HashSet; use std::path::Path; use std::path::PathBuf; diff --git a/graphannis/src/annis/db/aql/conjunction.rs b/graphannis/src/annis/db/aql/conjunction.rs index 73c9a0af7..9268699c5 100644 --- a/graphannis/src/annis/db/aql/conjunction.rs +++ b/graphannis/src/annis/db/aql/conjunction.rs @@ -132,10 +132,11 @@ fn should_switch_operand_order( node2cost: &BTreeMap, ) -> bool { if let Some((cost_lhs, cost_rhs)) = get_cost_estimates(op_spec, node2cost) - && cost_rhs.output < cost_lhs.output { - // switch operands - return true; - } + && cost_rhs.output < cost_lhs.output + { + // switch operands + return true; + } false } @@ -184,18 +185,19 @@ fn create_join<'b>( idx_right: usize, ) -> Result> + 'b>> { if exec_right.as_nodesearch().is_some() - && let BinaryOperator::Index(op) = op_entry.op { - // we can use directly use an index join - return create_index_join( - db, - config, - op, - &op_entry.args, - exec_left, - exec_right, - idx_left, - ); - } + && let BinaryOperator::Index(op) = op_entry.op + { + // we can use directly use an index join + return create_index_join( + db, + config, + op, + &op_entry.args, + exec_left, + exec_right, + idx_left, + ); + } if exec_left.as_nodesearch().is_some() { // avoid a nested loop join by switching the operand and using and index join when possible @@ -408,9 +410,10 @@ impl Conjunction { ) -> Result { let idx = self.resolve_variable_pos(variable, location.clone())?; if let Some(pos) = idx.checked_sub(self.var_idx_offset) - && pos < self.nodes.len() { - return Ok(self.nodes[pos].clone()); - } + && pos < self.nodes.len() + { + return Ok(self.nodes[pos].clone()); + } Err(GraphAnnisError::AQLSemanticError(AQLError { desc: format!("Operand \"#{}\" not found", variable), @@ -703,12 +706,13 @@ impl Conjunction { let inverse_op = op.get_inverse_operator(g)?; if let Some(inverse_op) = inverse_op - && should_switch_operand_order(op_spec_entry, &helper.node2cost) { - spec_idx_left = op_spec_entry.args.right; - spec_idx_right = op_spec_entry.args.left; + && should_switch_operand_order(op_spec_entry, &helper.node2cost) + { + spec_idx_left = op_spec_entry.args.right; + spec_idx_right = op_spec_entry.args.left; - op = inverse_op; - } + op = inverse_op; + } // substract the offset from the specificated numbers to get the internal node number for this conjunction spec_idx_left -= self.var_idx_offset; @@ -903,19 +907,20 @@ impl Conjunction { if first_component_id.is_none() { first_component_id = Some(*cid); } else if let Some(first) = first_component_id - && first != *cid { - // add location and description which node is not connected - let n_var = &self.nodes[*node_nr].var; - let location = self.location_in_query.get(n_var); - - return Err(GraphAnnisError::AQLSemanticError(AQLError { - desc: format!( - "Variable \"#{}\" not bound (use linguistic operators)", - n_var - ), - location: location.cloned(), - })); - } + && first != *cid + { + // add location and description which node is not connected + let n_var = &self.nodes[*node_nr].var; + let location = self.location_in_query.get(n_var); + + return Err(GraphAnnisError::AQLSemanticError(AQLError { + desc: format!( + "Variable \"#{}\" not bound (use linguistic operators)", + n_var + ), + location: location.cloned(), + })); + } } Ok(()) diff --git a/graphannis/src/annis/db/aql/conjunction/tests.rs b/graphannis/src/annis/db/aql/conjunction/tests.rs index 72136606f..63a81b2ae 100644 --- a/graphannis/src/annis/db/aql/conjunction/tests.rs +++ b/graphannis/src/annis/db/aql/conjunction/tests.rs @@ -1,19 +1,18 @@ use core::panic; use crate::{ + AnnotationGraph, annis::{ db::{ aql::{ - self, + self, Config, operators::{DominanceSpec, NegatedOpSpec, PrecedenceSpec, RangeSpec}, - Config, }, plan::ExecutionPlan, }, errors::GraphAnnisError::AQLSemanticError, util::TimeoutCheck, }, - AnnotationGraph, }; #[test] diff --git a/graphannis/src/annis/db/aql/disjunction.rs b/graphannis/src/annis/db/aql/disjunction.rs index ce67c0267..b9613bfe3 100644 --- a/graphannis/src/annis/db/aql/disjunction.rs +++ b/graphannis/src/annis/db/aql/disjunction.rs @@ -1,5 +1,5 @@ use super::conjunction::Conjunction; -use crate::{annis::db::aql::model::AnnotationComponentType, AnnotationGraph}; +use crate::{AnnotationGraph, annis::db::aql::model::AnnotationComponentType}; use graphannis_core::types::Component; use std::collections::HashSet; diff --git a/graphannis/src/annis/db/aql/mod.rs b/graphannis/src/annis/db/aql/mod.rs index 071e2fae2..d99c40cad 100644 --- a/graphannis/src/annis/db/aql/mod.rs +++ b/graphannis/src/annis/db/aql/mod.rs @@ -13,6 +13,7 @@ lalrpop_mod!( "/annis/db/aql/parser.rs" ); +use crate::AnnotationGraph; use crate::annis::db::aql::conjunction::Conjunction; use crate::annis::db::aql::disjunction::Disjunction; use crate::annis::db::aql::operators::{ @@ -25,7 +26,6 @@ use crate::annis::errors::*; use crate::annis::operator::{BinaryOperatorSpec, UnaryOperatorSpec}; use crate::annis::types::{LineColumn, LineColumnRange}; use crate::annis::util::TimeoutCheck; -use crate::AnnotationGraph; use lalrpop_util::ParseError; use std::collections::BTreeMap; use std::collections::HashMap; @@ -202,11 +202,12 @@ fn map_conjunction( } else if node_left.optional && node_right.optional { // Not supported yet return Err(GraphAnnisError::AQLSemanticError(AQLError { - desc: format!( - "Negated binary operator needs a non-optional left or right operand, but both operands (#{}, #{}) are optional, as indicated by their \"?\" suffix.", - var_left, var_right), - location: op_pos, - })); + desc: format!( + "Negated binary operator needs a non-optional left or right operand, but both operands (#{}, #{}) are optional, as indicated by their \"?\" suffix.", + var_left, var_right + ), + location: op_pos, + })); } else { let target_left = node_left.optional; let filtered_var = if target_left { @@ -524,11 +525,12 @@ pub fn parse(query_as_aql: &str, quirks_mode: bool) -> Result { .to_string(); let location = extract_location(&e, query_as_aql); if let ParseError::UnrecognizedToken { expected, .. } = e - && !expected.is_empty() { - //TODO: map token regular expressions and IDs (like IDENT_NODE) to human readable descriptions - desc.push_str(" Expected one of: "); - desc.push_str(&expected.join(",")); - } + && !expected.is_empty() + { + //TODO: map token regular expressions and IDs (like IDENT_NODE) to human readable descriptions + desc.push_str(" Expected one of: "); + desc.push_str(&expected.join(",")); + } Err(GraphAnnisError::AQLSyntaxError(AQLError { desc, location })) } } diff --git a/graphannis/src/annis/db/aql/model.rs b/graphannis/src/annis/db/aql/model.rs index 9977b522b..a3b95b88e 100644 --- a/graphannis/src/annis/db/aql/model.rs +++ b/graphannis/src/annis/db/aql/model.rs @@ -7,9 +7,9 @@ use graphannis_core::{ annostorage::ValueSearch, dfs::CycleSafeDFS, errors::ComponentTypeError, - graph::{storage::union::UnionEdgeContainer, ANNIS_NS, NODE_TYPE_KEY}, + graph::{ANNIS_NS, NODE_TYPE_KEY, storage::union::UnionEdgeContainer}, types::ComponentType, - util::disk_collections::{DiskMap, EvictionStrategy, DEFAULT_BLOCK_CACHE_CAPACITY}, + util::disk_collections::{DEFAULT_BLOCK_CACHE_CAPACITY, DiskMap, EvictionStrategy}, }; use std::{ collections::{BTreeMap, HashMap}, @@ -22,13 +22,13 @@ use std::{str::FromStr, sync::Arc}; use strum::IntoEnumIterator; use strum_macros::{EnumIter, EnumString}; -use crate::{update::UpdateEvent, AnnotationGraph}; +use crate::{AnnotationGraph, update::UpdateEvent}; use rustc_hash::FxHashSet; use crate::{ + Graph, graph::{AnnoKey, Component}, model::AnnotationComponent, - Graph, }; pub const TOK: &str = "tok"; @@ -342,10 +342,11 @@ impl AQLUpdateGraphIndex { // if the node already has a left/right token, just return this value if let Some(alignment_gs) = graph.get_graphstorage_as_ref(&alignment_component) - && let Some(existing) = alignment_gs.get_outgoing_edges(n).next() { - let existing = existing?; - return Ok(Some(existing)); - } + && let Some(existing) = alignment_gs.get_outgoing_edges(n).next() + { + let existing = existing?; + return Ok(Some(existing)); + } // order the candidate token by their position in the order chain let mut candidates: Vec = covered_token.iter().copied().collect(); @@ -473,24 +474,25 @@ impl ComponentType for AnnotationComponentType { .. } => { if !index.graph_without_nodes - && let Ok(ctype) = AnnotationComponentType::from_str(component_type) { - if ctype == AnnotationComponentType::Coverage - || ctype == AnnotationComponentType::Dominance - || ctype == AnnotationComponentType::Ordering - || ctype == AnnotationComponentType::LeftToken - || ctype == AnnotationComponentType::RightToken - { - let source = index - .get_cached_node_id_from_name(Cow::Borrowed(source_node), graph)?; - index.calculate_invalidated_nodes_by_coverage(graph, source)?; - } - - if ctype == AnnotationComponentType::Ordering { - let target = index - .get_cached_node_id_from_name(Cow::Borrowed(target_node), graph)?; - index.calculate_invalidated_nodes_by_coverage(graph, target)?; - } + && let Ok(ctype) = AnnotationComponentType::from_str(component_type) + { + if ctype == AnnotationComponentType::Coverage + || ctype == AnnotationComponentType::Dominance + || ctype == AnnotationComponentType::Ordering + || ctype == AnnotationComponentType::LeftToken + || ctype == AnnotationComponentType::RightToken + { + let source = index + .get_cached_node_id_from_name(Cow::Borrowed(source_node), graph)?; + index.calculate_invalidated_nodes_by_coverage(graph, source)?; + } + + if ctype == AnnotationComponentType::Ordering { + let target = index + .get_cached_node_id_from_name(Cow::Borrowed(target_node), graph)?; + index.calculate_invalidated_nodes_by_coverage(graph, target)?; } + } } _ => {} } @@ -511,40 +513,38 @@ impl ComponentType for AnnotationComponentType { target_node, .. } = update - && let Ok(ctype) = AnnotationComponentType::from_str(&component_type) { - if (ctype == AnnotationComponentType::Dominance - || ctype == AnnotationComponentType::Coverage) - && component_name.is_empty() - { - // might be a new text coverage component - let c = AnnotationComponent::new( - ctype.clone(), - layer.into(), - component_name.into(), - ); - index.text_coverage_components.insert(c); - } + && let Ok(ctype) = AnnotationComponentType::from_str(&component_type) + { + if (ctype == AnnotationComponentType::Dominance + || ctype == AnnotationComponentType::Coverage) + && component_name.is_empty() + { + // might be a new text coverage component + let c = + AnnotationComponent::new(ctype.clone(), layer.into(), component_name.into()); + index.text_coverage_components.insert(c); + } - if !index.graph_without_nodes { - if ctype == AnnotationComponentType::Coverage - || ctype == AnnotationComponentType::Dominance - || ctype == AnnotationComponentType::Ordering - || ctype == AnnotationComponentType::LeftToken - || ctype == AnnotationComponentType::RightToken - { - let source = - index.get_cached_node_id_from_name(Cow::Owned(source_node), graph)?; + if !index.graph_without_nodes { + if ctype == AnnotationComponentType::Coverage + || ctype == AnnotationComponentType::Dominance + || ctype == AnnotationComponentType::Ordering + || ctype == AnnotationComponentType::LeftToken + || ctype == AnnotationComponentType::RightToken + { + let source = + index.get_cached_node_id_from_name(Cow::Owned(source_node), graph)?; - index.calculate_invalidated_nodes_by_coverage(graph, source)?; - } + index.calculate_invalidated_nodes_by_coverage(graph, source)?; + } - if ctype == AnnotationComponentType::Ordering { - let target = - index.get_cached_node_id_from_name(Cow::Owned(target_node), graph)?; - index.calculate_invalidated_nodes_by_coverage(graph, target)?; - } + if ctype == AnnotationComponentType::Ordering { + let target = + index.get_cached_node_id_from_name(Cow::Owned(target_node), graph)?; + index.calculate_invalidated_nodes_by_coverage(graph, target)?; } } + } Ok(()) } @@ -655,10 +655,9 @@ impl ComponentType for AnnotationComponentType { && let Some(gs_stats) = graph .get_graphstorage_as_ref(&ordering_component) .and_then(|gs| gs.get_statistics()) - { - token_count_by_ordering_component - .insert(ordering_component, gs_stats.nodes as u64); - } + { + token_count_by_ordering_component.insert(ordering_component, gs_stats.nodes as u64); + } } graph.global_statistics = Some(AQLGlobalStatistics { diff --git a/graphannis/src/annis/db/aql/model/tests.rs b/graphannis/src/annis/db/aql/model/tests.rs index 28feda0ac..5373757f8 100644 --- a/graphannis/src/annis/db/aql/model/tests.rs +++ b/graphannis/src/annis/db/aql/model/tests.rs @@ -1,16 +1,16 @@ use std::{fs::File, path::PathBuf}; use crate::{ + AnnotationGraph, annis::db::{aql::model::CorpusSize, example_generator}, model::AnnotationComponent, - AnnotationGraph, }; use assert_matches::assert_matches; use graphannis_core::graph::{ + NODE_NAME_KEY, serialization::graphml, storage::GraphStorage, update::{GraphUpdate, UpdateEvent}, - NODE_NAME_KEY, }; use insta::assert_snapshot; use itertools::Itertools; diff --git a/graphannis/src/annis/db/aql/operators/arity.rs b/graphannis/src/annis/db/aql/operators/arity.rs index 7f15e224f..f935712ae 100644 --- a/graphannis/src/annis/db/aql/operators/arity.rs +++ b/graphannis/src/annis/db/aql/operators/arity.rs @@ -1,13 +1,13 @@ use super::RangeSpec; use crate::annis::operator::EstimationType; use crate::{ + AnnotationGraph, annis::{ db::aql::model::AnnotationComponentType, operator::{UnaryOperator, UnaryOperatorSpec}, }, errors::Result, graph::{GraphStorage, Match}, - AnnotationGraph, }; use graphannis_core::types::{Component, NodeID}; use std::collections::HashSet; diff --git a/graphannis/src/annis/db/aql/operators/edge_op.rs b/graphannis/src/annis/db/aql/operators/edge_op.rs index 9631f8e33..3e67418ae 100644 --- a/graphannis/src/annis/db/aql/operators/edge_op.rs +++ b/graphannis/src/annis/db/aql/operators/edge_op.rs @@ -7,7 +7,7 @@ use crate::annis::operator::{ }; use crate::errors::Result; use crate::graph::{GraphStatistic, GraphStorage, Match}; -use crate::{try_as_boxed_iter, AnnotationGraph}; +use crate::{AnnotationGraph, try_as_boxed_iter}; use graphannis_core::{ graph::{ANNIS_NS, DEFAULT_ANNO_KEY, NODE_TYPE_KEY}, types::{Component, Edge, NodeID}, @@ -130,13 +130,15 @@ fn check_edge_annotation( continue; } if let Some(template_ns) = ns - && template_ns != &a.key.ns { - continue; - } + && template_ns != &a.key.ns + { + continue; + } if let Some(template_val) = val - && template_val != &*a.val { - continue; - } + && template_val != &*a.val + { + continue; + } // all checks passed, this edge has the correct annotation return Ok(true); } @@ -151,9 +153,10 @@ fn check_edge_annotation( continue; } if let Some(template_ns) = ns - && template_ns != &a.key.ns { - continue; - } + && template_ns != &a.key.ns + { + continue; + } if val.as_str() == a.val.as_str() { continue; } @@ -175,9 +178,10 @@ fn check_edge_annotation( continue; } if let Some(template_ns) = ns - && template_ns != &a.key.ns { - continue; - } + && template_ns != &a.key.ns + { + continue; + } if !re.is_match(&a.val) { continue; @@ -201,9 +205,10 @@ fn check_edge_annotation( continue; } if let Some(template_ns) = ns - && template_ns != &a.key.ns { - continue; - } + && template_ns != &a.key.ns + { + continue; + } if re.is_match(&a.val) { continue; diff --git a/graphannis/src/annis/db/aql/operators/equal_value.rs b/graphannis/src/annis/db/aql/operators/equal_value.rs index a9b876b38..77e592061 100644 --- a/graphannis/src/annis/db/aql/operators/equal_value.rs +++ b/graphannis/src/annis/db/aql/operators/equal_value.rs @@ -1,5 +1,6 @@ -use crate::annis::db::exec::nodesearch::NodeSearchSpec; use crate::annis::db::exec::CostEstimate; +use crate::annis::db::exec::nodesearch::NodeSearchSpec; +use crate::{AnnotationGraph, try_as_boxed_iter}; use crate::{ annis::{ db::aql::model::{AnnotationComponentType, TOK, TOKEN_KEY}, @@ -8,7 +9,6 @@ use crate::{ errors::Result, graph::Match, }; -use crate::{try_as_boxed_iter, AnnotationGraph}; use graphannis_core::annostorage::NodeAnnotationStorage; use graphannis_core::{annostorage::ValueSearch, graph::ANNIS_NS, types::Component}; use std::borrow::Cow; @@ -140,22 +140,23 @@ impl BinaryOperatorBase for EqualValue<'_> { if let Some((ns, name)) = EqualValue::anno_def_for_spec(&self.spec_left) && let Some(most_frequent_value_left) = self.node_annos.guess_most_frequent_value(ns, name)? - && let Some((ns, name)) = EqualValue::anno_def_for_spec(&self.spec_right) { - let guessed_count_right = self.node_annos.guess_max_count( - ns, - name, - &most_frequent_value_left, - &most_frequent_value_left, - )?; - - let total_annos = self.node_annos.number_of_annotations_by_name(ns, name)?; - let sel = guessed_count_right as f64 / total_annos as f64; - if self.negated { - return Ok(EstimationType::Selectivity(1.0 - sel)); - } else { - return Ok(EstimationType::Selectivity(sel)); - } - } + && let Some((ns, name)) = EqualValue::anno_def_for_spec(&self.spec_right) + { + let guessed_count_right = self.node_annos.guess_max_count( + ns, + name, + &most_frequent_value_left, + &most_frequent_value_left, + )?; + + let total_annos = self.node_annos.number_of_annotations_by_name(ns, name)?; + let sel = guessed_count_right as f64 / total_annos as f64; + if self.negated { + return Ok(EstimationType::Selectivity(1.0 - sel)); + } else { + return Ok(EstimationType::Selectivity(sel)); + } + } // fallback to default Ok(EstimationType::Selectivity(0.5)) } diff --git a/graphannis/src/annis/db/aql/operators/identical_cov.rs b/graphannis/src/annis/db/aql/operators/identical_cov.rs index d923b41fa..08e456b29 100644 --- a/graphannis/src/annis/db/aql/operators/identical_cov.rs +++ b/graphannis/src/annis/db/aql/operators/identical_cov.rs @@ -5,11 +5,11 @@ use crate::annis::errors::GraphAnnisError; use crate::annis::operator::{BinaryOperator, BinaryOperatorIndex, EstimationType}; use crate::try_as_boxed_iter; use crate::{ + AnnotationGraph, annis::operator::{BinaryOperatorBase, BinaryOperatorSpec}, errors::Result, graph::{GraphStorage, Match}, model::AnnotationComponentType, - AnnotationGraph, }; use graphannis_core::{ graph::{ANNIS_NS, DEFAULT_ANNO_KEY}, @@ -179,12 +179,13 @@ impl BinaryOperatorIndex for IdenticalCoverage<'_> { match self.tok_helper.right_token_for(c) { Ok(c_right) => { if let Some(c_right) = c_right - && n_right == c_right { - result.push(Ok(Match { - node: c, - anno_key: DEFAULT_ANNO_KEY.clone(), - })); - } + && n_right == c_right + { + result.push(Ok(Match { + node: c, + anno_key: DEFAULT_ANNO_KEY.clone(), + })); + } } Err(e) => result.push(Err(e)), } diff --git a/graphannis/src/annis/db/aql/operators/identical_node.rs b/graphannis/src/annis/db/aql/operators/identical_node.rs index 1d15237e6..7121c8fe2 100644 --- a/graphannis/src/annis/db/aql/operators/identical_node.rs +++ b/graphannis/src/annis/db/aql/operators/identical_node.rs @@ -1,5 +1,5 @@ -use crate::annis::db::exec::CostEstimate; use crate::AnnotationGraph; +use crate::annis::db::exec::CostEstimate; use crate::{ annis::{db::aql::model::AnnotationComponentType, operator::*}, errors::Result, diff --git a/graphannis/src/annis/db/aql/operators/inclusion.rs b/graphannis/src/annis/db/aql/operators/inclusion.rs index 31fd13d1f..fb6a2cd85 100644 --- a/graphannis/src/annis/db/aql/operators/inclusion.rs +++ b/graphannis/src/annis/db/aql/operators/inclusion.rs @@ -3,13 +3,13 @@ use crate::annis::db::token_helper; use crate::annis::db::token_helper::TokenHelper; use crate::annis::errors::GraphAnnisError; use crate::annis::operator::{BinaryOperator, BinaryOperatorIndex, EstimationType}; +use crate::{AnnotationGraph, try_as_boxed_iter}; use crate::{ annis::operator::{BinaryOperatorBase, BinaryOperatorSpec}, errors::Result, graph::{GraphStorage, Match}, model::AnnotationComponentType, }; -use crate::{try_as_boxed_iter, AnnotationGraph}; use graphannis_core::types::NodeID; use graphannis_core::{ graph::{ANNIS_NS, DEFAULT_ANNO_KEY}, diff --git a/graphannis/src/annis/db/aql/operators/leftalignment.rs b/graphannis/src/annis/db/aql/operators/leftalignment.rs index 92b2f832d..bd81303d5 100644 --- a/graphannis/src/annis/db/aql/operators/leftalignment.rs +++ b/graphannis/src/annis/db/aql/operators/leftalignment.rs @@ -4,8 +4,8 @@ use crate::annis::db::{aql::model::AnnotationComponentType, token_helper::TokenH use crate::annis::errors::GraphAnnisError; use crate::annis::operator::{BinaryOperator, BinaryOperatorSpec}; use crate::annis::operator::{BinaryOperatorBase, BinaryOperatorIndex}; +use crate::{AnnotationGraph, try_as_boxed_iter}; use crate::{annis::operator::EstimationType, errors::Result, graph::Match}; -use crate::{try_as_boxed_iter, AnnotationGraph}; use graphannis_core::{graph::DEFAULT_ANNO_KEY, types::Component}; use itertools::Itertools; use std::collections::HashSet; diff --git a/graphannis/src/annis/db/aql/operators/near.rs b/graphannis/src/annis/db/aql/operators/near.rs index 17336ef08..72ed0d7ee 100644 --- a/graphannis/src/annis/db/aql/operators/near.rs +++ b/graphannis/src/annis/db/aql/operators/near.rs @@ -4,12 +4,12 @@ use crate::annis::db::token_helper; use crate::annis::db::token_helper::TokenHelper; use crate::annis::errors::GraphAnnisError; use crate::annis::operator::{BinaryOperator, BinaryOperatorIndex, EstimationType}; +use crate::{AnnotationGraph, try_as_boxed_iter}; use crate::{ annis::operator::{BinaryOperatorBase, BinaryOperatorSpec}, errors::Result, graph::{GraphStorage, Match}, }; -use crate::{try_as_boxed_iter, AnnotationGraph}; use graphannis_core::graph::DEFAULT_NS; use graphannis_core::types::NodeID; use graphannis_core::{ diff --git a/graphannis/src/annis/db/aql/operators/negated_op.rs b/graphannis/src/annis/db/aql/operators/negated_op.rs index 23a091c41..db88c2f34 100644 --- a/graphannis/src/annis/db/aql/operators/negated_op.rs +++ b/graphannis/src/annis/db/aql/operators/negated_op.rs @@ -1,12 +1,12 @@ use std::{fmt::Display, sync::Arc}; use crate::{ + AnnotationGraph, annis::{ db::exec::CostEstimate, operator::{BinaryOperator, BinaryOperatorBase, BinaryOperatorSpec, EstimationType}, }, errors::Result, - AnnotationGraph, }; use graphannis_core::annostorage::Match; diff --git a/graphannis/src/annis/db/aql/operators/non_existing.rs b/graphannis/src/annis/db/aql/operators/non_existing.rs index 42a31dbff..5dff03a30 100644 --- a/graphannis/src/annis/db/aql/operators/non_existing.rs +++ b/graphannis/src/annis/db/aql/operators/non_existing.rs @@ -11,6 +11,7 @@ use graphannis_core::{ }; use crate::{ + AnnotationGraph, annis::{ db::{ aql::conjunction::Conjunction, @@ -23,7 +24,6 @@ use crate::{ }, util::TimeoutCheck, }, - AnnotationGraph, }; #[derive(Debug, Clone)] diff --git a/graphannis/src/annis/db/aql/operators/overlap.rs b/graphannis/src/annis/db/aql/operators/overlap.rs index 3a6064d5a..5bdf5ecd1 100644 --- a/graphannis/src/annis/db/aql/operators/overlap.rs +++ b/graphannis/src/annis/db/aql/operators/overlap.rs @@ -3,13 +3,13 @@ use crate::annis::db::token_helper; use crate::annis::db::token_helper::TokenHelper; use crate::annis::errors::GraphAnnisError; use crate::annis::operator::{BinaryOperator, BinaryOperatorIndex, EstimationType}; +use crate::{AnnotationGraph, try_as_boxed_iter}; use crate::{ annis::operator::{BinaryOperatorBase, BinaryOperatorSpec}, errors::Result, graph::{GraphStorage, Match}, model::{AnnotationComponent, AnnotationComponentType}, }; -use crate::{try_as_boxed_iter, AnnotationGraph}; use graphannis_core::{ graph::{ANNIS_NS, DEFAULT_ANNO_KEY}, types::NodeID, diff --git a/graphannis/src/annis/db/aql/operators/precedence.rs b/graphannis/src/annis/db/aql/operators/precedence.rs index b01e5384f..fb8df05de 100644 --- a/graphannis/src/annis/db/aql/operators/precedence.rs +++ b/graphannis/src/annis/db/aql/operators/precedence.rs @@ -4,13 +4,13 @@ use crate::annis::db::token_helper; use crate::annis::db::token_helper::TokenHelper; use crate::annis::errors::GraphAnnisError; use crate::annis::operator::{BinaryOperator, BinaryOperatorIndex, EstimationType}; +use crate::{AnnotationGraph, try_as_boxed_iter}; use crate::{ annis::operator::{BinaryOperatorBase, BinaryOperatorSpec}, errors::Result, graph::{GraphStorage, Match}, model::{AnnotationComponent, AnnotationComponentType}, }; -use crate::{try_as_boxed_iter, AnnotationGraph}; use graphannis_core::graph::{ANNIS_NS, DEFAULT_ANNO_KEY, DEFAULT_NS}; use itertools::Itertools; diff --git a/graphannis/src/annis/db/aql/operators/rightalignment.rs b/graphannis/src/annis/db/aql/operators/rightalignment.rs index 0425a668d..f32129b9e 100644 --- a/graphannis/src/annis/db/aql/operators/rightalignment.rs +++ b/graphannis/src/annis/db/aql/operators/rightalignment.rs @@ -1,3 +1,4 @@ +use crate::AnnotationGraph; use crate::annis::db::exec::CostEstimate; use crate::annis::db::token_helper; use crate::annis::db::token_helper::TokenHelper; @@ -7,7 +8,6 @@ use crate::annis::operator::BinaryOperatorBase; use crate::annis::operator::BinaryOperatorIndex; use crate::annis::operator::BinaryOperatorSpec; use crate::try_as_boxed_iter; -use crate::AnnotationGraph; use crate::{ annis::operator::EstimationType, errors::Result, graph::Match, model::AnnotationComponent, }; diff --git a/graphannis/src/annis/db/corpusstorage/subgraph.rs b/graphannis/src/annis/db/corpusstorage/subgraph.rs index 8070c5e01..5698c4652 100644 --- a/graphannis/src/annis/db/corpusstorage/subgraph.rs +++ b/graphannis/src/annis/db/corpusstorage/subgraph.rs @@ -17,7 +17,7 @@ use crate::annis::db::token_helper::TokenHelper; use crate::annis::errors::GraphAnnisError; use crate::annis::util::quicksort; use crate::try_as_option; -use crate::{annis::errors::Result, model::AnnotationComponentType, AnnotationGraph}; +use crate::{AnnotationGraph, annis::errors::Result, model::AnnotationComponentType}; struct TokenIterator<'a> { end_token: NodeID, @@ -499,22 +499,23 @@ where trace!("subgraph query extracted node {:?}", m.node); if let Some(token_helper) = &token_helper - && token_helper.is_token(m.node)? { - if let (Some(gs_ordering), Some(previous_node)) = - (&gs_orig_ordering, previous_token) - && let Some(distance) = - gs_ordering.distance(previous_node, m.node)? - && distance > 1 { - let gs_result_ds_ordering_ = result - .get_or_create_writable(&ds_ordering_component)?; - - gs_result_ds_ordering_.add_edge(Edge { - source: previous_node, - target: m.node, - })?; - } - previous_token = Some(m.node); + && token_helper.is_token(m.node)? + { + if let (Some(gs_ordering), Some(previous_node)) = + (&gs_orig_ordering, previous_token) + && let Some(distance) = gs_ordering.distance(previous_node, m.node)? + && distance > 1 + { + let gs_result_ds_ordering_ = + result.get_or_create_writable(&ds_ordering_component)?; + + gs_result_ds_ordering_.add_edge(Edge { + source: previous_node, + target: m.node, + })?; } + previous_token = Some(m.node); + } create_subgraph_node(m.node, &mut result, orig_graph)?; } @@ -557,33 +558,34 @@ fn create_subgraph_edge( && !c.name.is_empty()) || ctype == AnnotationComponentType::RightToken || ctype == AnnotationComponentType::LeftToken) - && let Some(orig_gs) = orig_db.get_graphstorage(c) { - for target in orig_gs.get_outgoing_edges(source_id) { - let target = target?; - if !db - .get_node_annos() - .get_all_keys_for_item(&target, None, None)? - .is_empty() - { - let e = Edge { - source: source_id, - target, - }; - if let Ok(new_gs) = db.get_or_create_writable(c) { - new_gs.add_edge(e.clone())?; - } + && let Some(orig_gs) = orig_db.get_graphstorage(c) + { + for target in orig_gs.get_outgoing_edges(source_id) { + let target = target?; + if !db + .get_node_annos() + .get_all_keys_for_item(&target, None, None)? + .is_empty() + { + let e = Edge { + source: source_id, + target, + }; + if let Ok(new_gs) = db.get_or_create_writable(c) { + new_gs.add_edge(e.clone())?; + } - for a in orig_gs.get_anno_storage().get_annotations_for_item(&Edge { - source: source_id, - target, - })? { - if let Ok(new_gs) = db.get_or_create_writable(c) { - new_gs.add_edge_annotation(e.clone(), a)?; - } + for a in orig_gs.get_anno_storage().get_annotations_for_item(&Edge { + source: source_id, + target, + })? { + if let Ok(new_gs) = db.get_or_create_writable(c) { + new_gs.add_edge_annotation(e.clone(), a)?; } } } } + } } Ok(()) diff --git a/graphannis/src/annis/db/corpusstorage/tests.rs b/graphannis/src/annis/db/corpusstorage/tests.rs index 36493dd53..c70223c3e 100644 --- a/graphannis/src/annis/db/corpusstorage/tests.rs +++ b/graphannis/src/annis/db/corpusstorage/tests.rs @@ -7,7 +7,7 @@ use serial_test::serial; use std::path::{Path, PathBuf}; use std::vec; -use crate::annis::db::corpusstorage::{get_read_or_error, CacheEntry}; +use crate::annis::db::corpusstorage::{CacheEntry, get_read_or_error}; use crate::annis::db::example_generator::create_token_node; use crate::annis::db::{aql::model::AnnotationComponentType, example_generator}; use crate::annis::errors::GraphAnnisError; @@ -891,62 +891,72 @@ fn subgraph_with_segmentation_and_gap() { let g = cs.subgraph(&corpus_name, m.clone(), 1, 2, None).unwrap(); // Check that all token and the page are included, including the token // that is not covered by a segmentation node. - assert!(g - .get_node_annos() - .get_node_id_from_name("SegmentationWithGaps/doc01#tok_11") - .unwrap() - .is_some()); - assert!(g - .get_node_annos() - .get_node_id_from_name("SegmentationWithGaps/doc01#tok_12") - .unwrap() - .is_some()); - assert!(g - .get_node_annos() - .get_node_id_from_name("SegmentationWithGaps/doc01#tok_13") - .unwrap() - .is_some()); - assert!(g - .get_node_annos() - .get_node_id_from_name("SegmentationWithGaps/doc01#tok_14") - .unwrap() - .is_some()); - assert!(g - .get_node_annos() - .get_node_id_from_name("SegmentationWithGaps/doc01#page2") - .unwrap() - .is_some()); + assert!( + g.get_node_annos() + .get_node_id_from_name("SegmentationWithGaps/doc01#tok_11") + .unwrap() + .is_some() + ); + assert!( + g.get_node_annos() + .get_node_id_from_name("SegmentationWithGaps/doc01#tok_12") + .unwrap() + .is_some() + ); + assert!( + g.get_node_annos() + .get_node_id_from_name("SegmentationWithGaps/doc01#tok_13") + .unwrap() + .is_some() + ); + assert!( + g.get_node_annos() + .get_node_id_from_name("SegmentationWithGaps/doc01#tok_14") + .unwrap() + .is_some() + ); + assert!( + g.get_node_annos() + .get_node_id_from_name("SegmentationWithGaps/doc01#page2") + .unwrap() + .is_some() + ); // Get the context for the norm node using the norm segmentation let g = cs .subgraph(&corpus_name, m, 1, 1, Some("norm".to_string())) .unwrap(); // Check that all token and the page are included - assert!(g - .get_node_annos() - .get_node_id_from_name("SegmentationWithGaps/doc01#tok_11") - .unwrap() - .is_some()); - assert!(g - .get_node_annos() - .get_node_id_from_name("SegmentationWithGaps/doc01#tok_12") - .unwrap() - .is_some()); - assert!(g - .get_node_annos() - .get_node_id_from_name("SegmentationWithGaps/doc01#tok_13") - .unwrap() - .is_some()); - assert!(g - .get_node_annos() - .get_node_id_from_name("SegmentationWithGaps/doc01#tok_14") - .unwrap() - .is_some()); - assert!(g - .get_node_annos() - .get_node_id_from_name("SegmentationWithGaps/doc01#page2") - .unwrap() - .is_some()); + assert!( + g.get_node_annos() + .get_node_id_from_name("SegmentationWithGaps/doc01#tok_11") + .unwrap() + .is_some() + ); + assert!( + g.get_node_annos() + .get_node_id_from_name("SegmentationWithGaps/doc01#tok_12") + .unwrap() + .is_some() + ); + assert!( + g.get_node_annos() + .get_node_id_from_name("SegmentationWithGaps/doc01#tok_13") + .unwrap() + .is_some() + ); + assert!( + g.get_node_annos() + .get_node_id_from_name("SegmentationWithGaps/doc01#tok_14") + .unwrap() + .is_some() + ); + assert!( + g.get_node_annos() + .get_node_id_from_name("SegmentationWithGaps/doc01#page2") + .unwrap() + .is_some() + ); // Get the context for the token using the norm segmentation let g = cs @@ -959,31 +969,36 @@ fn subgraph_with_segmentation_and_gap() { ) .unwrap(); // Check that all token and the page are included - assert!(g - .get_node_annos() - .get_node_id_from_name("SegmentationWithGaps/doc01#tok_11") - .unwrap() - .is_some()); - assert!(g - .get_node_annos() - .get_node_id_from_name("SegmentationWithGaps/doc01#tok_12") - .unwrap() - .is_some()); - assert!(g - .get_node_annos() - .get_node_id_from_name("SegmentationWithGaps/doc01#tok_13") - .unwrap() - .is_some()); - assert!(g - .get_node_annos() - .get_node_id_from_name("SegmentationWithGaps/doc01#tok_14") - .unwrap() - .is_some()); - assert!(g - .get_node_annos() - .get_node_id_from_name("SegmentationWithGaps/doc01#page2") - .unwrap() - .is_some()); + assert!( + g.get_node_annos() + .get_node_id_from_name("SegmentationWithGaps/doc01#tok_11") + .unwrap() + .is_some() + ); + assert!( + g.get_node_annos() + .get_node_id_from_name("SegmentationWithGaps/doc01#tok_12") + .unwrap() + .is_some() + ); + assert!( + g.get_node_annos() + .get_node_id_from_name("SegmentationWithGaps/doc01#tok_13") + .unwrap() + .is_some() + ); + assert!( + g.get_node_annos() + .get_node_id_from_name("SegmentationWithGaps/doc01#tok_14") + .unwrap() + .is_some() + ); + assert!( + g.get_node_annos() + .get_node_id_from_name("SegmentationWithGaps/doc01#page2") + .unwrap() + .is_some() + ); } #[test] @@ -1321,12 +1336,14 @@ fn import_relative_corpus_with_linked_file() { let mut files = files.unwrap(); let first_file = files.next().unwrap().unwrap(); assert_eq!("linked_file.txt", first_file.0); - assert!(is_same_file( - tmp.path() - .join("CorpusWithLinkedFile/files/linked_file.txt"), - &first_file.1 - ) - .unwrap()); + assert!( + is_same_file( + tmp.path() + .join("CorpusWithLinkedFile/files/linked_file.txt"), + &first_file.1 + ) + .unwrap() + ); let file_content = std::fs::read_to_string(first_file.1).unwrap(); assert_eq!("The content of this file is not important.", file_content); } diff --git a/graphannis/src/annis/db/example_generator.rs b/graphannis/src/annis/db/example_generator.rs index 7c7ce3e9b..7d106644a 100644 --- a/graphannis/src/annis/db/example_generator.rs +++ b/graphannis/src/annis/db/example_generator.rs @@ -1,6 +1,6 @@ use graphannis_core::graph::{ - update::{GraphUpdate, UpdateEvent}, ANNIS_NS, DEFAULT_NS, + update::{GraphUpdate, UpdateEvent}, }; use crate::model::AnnotationComponentType; diff --git a/graphannis/src/annis/db/exec/filter.rs b/graphannis/src/annis/db/exec/filter.rs index f828eb329..84bd55566 100644 --- a/graphannis/src/annis/db/exec/filter.rs +++ b/graphannis/src/annis/db/exec/filter.rs @@ -76,11 +76,7 @@ impl<'a> Filter<'a> { .map(move |tuple| { let tuple = tuple?; let include = op_entry.op.filter_match(&tuple[lhs_idx], &tuple[rhs_idx])?; - if include { - Ok(Some(tuple)) - } else { - Ok(None) - } + if include { Ok(Some(tuple)) } else { Ok(None) } }) .filter_map_ok(|t| t); Ok(Filter { diff --git a/graphannis/src/annis/db/exec/nestedloop.rs b/graphannis/src/annis/db/exec/nestedloop.rs index 71724e880..d4cdcffd0 100644 --- a/graphannis/src/annis/db/exec/nestedloop.rs +++ b/graphannis/src/annis/db/exec/nestedloop.rs @@ -33,9 +33,10 @@ impl<'a> NestedLoop<'a> { let mut left_is_outer = true; if let (Some(desc_lhs), Some(desc_rhs)) = (lhs.get_desc(), rhs.get_desc()) && let (Some(cost_lhs), Some(cost_rhs)) = (&desc_lhs.cost, &desc_rhs.cost) - && cost_lhs.output > cost_rhs.output { - left_is_outer = false; - } + && cost_lhs.output > cost_rhs.output + { + left_is_outer = false; + } let processed_func = |_, out_lhs: usize, out_rhs: usize| { if out_lhs <= out_rhs { diff --git a/graphannis/src/annis/db/exec/parallel/indexjoin.rs b/graphannis/src/annis/db/exec/parallel/indexjoin.rs index 23a7d1aff..afc28c3ef 100644 --- a/graphannis/src/annis/db/exec/parallel/indexjoin.rs +++ b/graphannis/src/annis/db/exec/parallel/indexjoin.rs @@ -7,8 +7,8 @@ use graphannis_core::{annostorage::MatchGroup, types::NodeID}; use rayon::prelude::*; use std::error::Error; use std::iter::Peekable; -use std::sync::mpsc::{channel, Receiver, Sender}; use std::sync::Arc; +use std::sync::mpsc::{Receiver, Sender, channel}; const MAX_BUFFER_SIZE: usize = 512; diff --git a/graphannis/src/annis/db/exec/parallel/nestedloop.rs b/graphannis/src/annis/db/exec/parallel/nestedloop.rs index f88bb9050..98d436285 100644 --- a/graphannis/src/annis/db/exec/parallel/nestedloop.rs +++ b/graphannis/src/annis/db/exec/parallel/nestedloop.rs @@ -4,8 +4,8 @@ use crate::annis::operator::BinaryOperatorBase; use crate::errors::Result; use graphannis_core::annostorage::MatchGroup; use rayon::prelude::*; -use std::sync::mpsc::{channel, Receiver, Sender}; use std::sync::Arc; +use std::sync::mpsc::{Receiver, Sender, channel}; const MAX_BUFFER_SIZE: usize = 1024; @@ -41,9 +41,10 @@ impl<'a> NestedLoop<'a> { let mut left_is_outer = true; if let (Some(desc_lhs), Some(desc_rhs)) = (lhs.get_desc(), rhs.get_desc()) && let (Some(cost_lhs), Some(cost_rhs)) = (&desc_lhs.cost, &desc_rhs.cost) - && cost_lhs.output > cost_rhs.output { - left_is_outer = false; - } + && cost_lhs.output > cost_rhs.output + { + left_is_outer = false; + } let processed_func = |_, out_lhs: usize, out_rhs: usize| { if out_lhs <= out_rhs { diff --git a/graphannis/src/annis/db/exec/tokensearch.rs b/graphannis/src/annis/db/exec/tokensearch.rs index 8e0094b29..0c93acb8c 100644 --- a/graphannis/src/annis/db/exec/tokensearch.rs +++ b/graphannis/src/annis/db/exec/tokensearch.rs @@ -5,13 +5,13 @@ use crate::annis::db::sort_matches::SortCache; use crate::annis::db::token_helper; use crate::annis::util::quicksort; use crate::{ - annis::db::aql::model::AnnotationComponentType, annis::db::token_helper::TokenHelper, - errors::Result, graph::Match, AnnotationGraph, + AnnotationGraph, annis::db::aql::model::AnnotationComponentType, + annis::db::token_helper::TokenHelper, errors::Result, graph::Match, }; use graphannis_core::errors::GraphAnnisCoreError; use graphannis_core::{ annostorage::MatchGroup, - graph::{storage::GraphStorage, ANNIS_NS, NODE_TYPE_KEY}, + graph::{ANNIS_NS, NODE_TYPE_KEY, storage::GraphStorage}, types::{AnnoKey, Component, NodeID}, }; use itertools::Itertools; @@ -67,9 +67,10 @@ impl<'a> AnyTokenSearch<'a> { fn is_root_tok(&self, n: NodeID) -> Result { // Return early if node has ingoing edges and is not a root token if let Some(order_gs) = self.order_gs - && order_gs.has_ingoing_edges(n)? { - return Ok(false); - } + && order_gs.has_ingoing_edges(n)? + { + return Ok(false); + } // Token also should also have no outgoing coverage edges if let Some(ref token_helper) = self.token_helper { diff --git a/graphannis/src/annis/db/plan.rs b/graphannis/src/annis/db/plan.rs index bda786798..00d58c979 100644 --- a/graphannis/src/annis/db/plan.rs +++ b/graphannis/src/annis/db/plan.rs @@ -67,9 +67,10 @@ impl<'a> ExecutionPlan<'a> { plans.push(p); } else if let Err(e) = p - && let GraphAnnisError::AQLSemanticError(_) = &e { - return Err(e); - } + && let GraphAnnisError::AQLSemanticError(_) = &e + { + return Err(e); + } } if plans.is_empty() { diff --git a/graphannis/src/annis/db/relannis.rs b/graphannis/src/annis/db/relannis.rs index 8442d5618..cbf942e98 100644 --- a/graphannis/src/annis/db/relannis.rs +++ b/graphannis/src/annis/db/relannis.rs @@ -5,6 +5,7 @@ use crate::annis::types::TimelineStrategy; use crate::annis::util::create_str_vec_key; use crate::update::{GraphUpdate, UpdateEvent}; use crate::{ + AnnotationGraph, annis::{ db::aql::model::TOK, types::{ @@ -13,7 +14,6 @@ use crate::{ }, }, corpusstorage::QueryLanguage, - AnnotationGraph, }; use graphannis_core::serializer::KeyVec; use graphannis_core::{ @@ -717,11 +717,12 @@ where let value = splitted[1]; if let "context-steps" = key - && let Ok(value) = value.parse::() { - config.context.sizes = (value..=config.context.max.unwrap_or(value)) - .step_by(value) - .collect(); - } + && let Ok(value) = value.parse::() + { + config.context.sizes = (value..=config.context.max.unwrap_or(value)) + .step_by(value) + .collect(); + } } } @@ -1029,29 +1030,29 @@ where // if the last token/text value is valid and we are still in the same text if let (Some(last_token), Some(last_textprop)) = (last_token, last_textprop) && last_textprop.corpus_id == current_textprop.corpus_id - && last_textprop.text_id == current_textprop.text_id - && last_textprop.segmentation == current_textprop.segmentation - { - // we are still in the same text, add ordering between token - let ordering_layer = if current_textprop.segmentation.is_empty() { - ANNIS_NS.to_owned() - } else { - DEFAULT_NS.to_owned() - }; - updates.add_event(UpdateEvent::AddEdge { - source_node: id_to_node_name - .get(&last_token)? - .ok_or(RelAnnisError::NodeNotFound(last_token))? - .to_string(), - target_node: id_to_node_name - .get(¤t_token)? - .ok_or(RelAnnisError::NodeNotFound(current_token))? - .to_string(), - layer: ordering_layer, - component_type: AnnotationComponentType::Ordering.to_string(), - component_name: current_textprop.segmentation.clone().into(), - })?; - } // end if same text + && last_textprop.text_id == current_textprop.text_id + && last_textprop.segmentation == current_textprop.segmentation + { + // we are still in the same text, add ordering between token + let ordering_layer = if current_textprop.segmentation.is_empty() { + ANNIS_NS.to_owned() + } else { + DEFAULT_NS.to_owned() + }; + updates.add_event(UpdateEvent::AddEdge { + source_node: id_to_node_name + .get(&last_token)? + .ok_or(RelAnnisError::NodeNotFound(last_token))? + .to_string(), + target_node: id_to_node_name + .get(¤t_token)? + .ok_or(RelAnnisError::NodeNotFound(current_token))? + .to_string(), + layer: ordering_layer, + component_type: AnnotationComponentType::Ordering.to_string(), + component_name: current_textprop.segmentation.clone().into(), + })?; + } // end if same text // update the iterator and other variables last_textprop = Some(current_textprop.clone()); @@ -1220,13 +1221,14 @@ where n, load_node_and_corpus_result, load_rank_result, - ) { - // output a warning but do not fail - warn!( - "Adding coverage edges (connects spans with tokens) failed: {}", - e - ) - } // end if not a token + ) + { + // output a warning but do not fail + warn!( + "Adding coverage edges (connects spans with tokens) failed: {}", + e + ) + } // end if not a token } Ok(()) @@ -1320,9 +1322,9 @@ where if let Some(Ok((_, next_token_id))) = token_iterator.peek() && let Some(next_token_left_pos) = textpos_table.node_to_left_char.get(next_token_id)? - { - whitespace_end_pos = Some(next_token_left_pos.val as usize); - } + { + whitespace_end_pos = Some(next_token_left_pos.val as usize); + } // Get the covered text which either goes until the next token or until the end of the text if there is none let mut covered_text_after = if let Some(end_pos) = whitespace_end_pos { @@ -1462,14 +1464,15 @@ where id_to_node_name.insert(node_nr, node_path.clone().into())?; if let Some(layer) = layer - && !layer.is_empty() { - updates.add_event(UpdateEvent::AddNodeLabel { - node_name: node_path.clone(), - anno_ns: ANNIS_NS.to_owned(), - anno_name: "layer".to_owned(), - anno_value: layer.to_string(), - })?; - } + && !layer.is_empty() + { + updates.add_event(UpdateEvent::AddNodeLabel { + node_name: node_path.clone(), + anno_ns: ANNIS_NS.to_owned(), + anno_name: "layer".to_owned(), + anno_value: layer.to_string(), + })?; + } // Add the raw character offsets so it is possible to extract the text later on let left_char_val = @@ -1885,11 +1888,12 @@ where } } } else if let Some(c) = component_by_id.get(&component_ref) - && c.get_type() == AnnotationComponentType::Coverage { - load_rank_result - .component_for_parentless_target_node - .insert(target, c.clone())?; - } + && c.get_type() == AnnotationComponentType::Coverage + { + load_rank_result + .component_for_parentless_target_node + .insert(target, c.clone())?; + } } info!( @@ -1936,30 +1940,31 @@ where let pre = get_field_not_null(&line, 0, "pre", &edge_anno_tab_path)?.parse::()?; if let Some(c) = rank_result.components_by_pre.get(&pre)? - && let Some(e) = rank_result.edges_by_pre.get(&pre)? { - let ns = get_field(&line, 1, "namespace", &edge_anno_tab_path)?.unwrap_or_default(); - let name = get_field_not_null(&line, 2, "name", &edge_anno_tab_path)?; - // If 'NULL', use an "invalid" string so it can't be found by its value, but only by its annotation name - let val = get_field(&line, 3, "value", &edge_anno_tab_path)? - .unwrap_or_else(|| INVALID_STRING.clone()); - - updates.add_event(UpdateEvent::AddEdgeLabel { - source_node: id_to_node_name - .get(&e.source)? - .ok_or(RelAnnisError::NodeNotFound(e.source))? - .to_string(), - target_node: id_to_node_name - .get(&e.target)? - .ok_or(RelAnnisError::NodeNotFound(e.target))? - .to_string(), - layer: c.layer.clone().into(), - component_type: c.get_type().to_string(), - component_name: c.name.to_string(), - anno_ns: ns.to_string(), - anno_name: name.to_string(), - anno_value: val.to_string(), - })?; - } + && let Some(e) = rank_result.edges_by_pre.get(&pre)? + { + let ns = get_field(&line, 1, "namespace", &edge_anno_tab_path)?.unwrap_or_default(); + let name = get_field_not_null(&line, 2, "name", &edge_anno_tab_path)?; + // If 'NULL', use an "invalid" string so it can't be found by its value, but only by its annotation name + let val = get_field(&line, 3, "value", &edge_anno_tab_path)? + .unwrap_or_else(|| INVALID_STRING.clone()); + + updates.add_event(UpdateEvent::AddEdgeLabel { + source_node: id_to_node_name + .get(&e.source)? + .ok_or(RelAnnisError::NodeNotFound(e.source))? + .to_string(), + target_node: id_to_node_name + .get(&e.target)? + .ok_or(RelAnnisError::NodeNotFound(e.target))? + .to_string(), + layer: c.layer.clone().into(), + component_type: c.get_type().to_string(), + component_name: c.name.to_string(), + anno_ns: ns.to_string(), + anno_name: name.to_string(), + anno_value: val.to_string(), + })?; + } } Ok(()) diff --git a/graphannis/src/annis/db/token_helper.rs b/graphannis/src/annis/db/token_helper.rs index 1bfd4954d..d896042b5 100644 --- a/graphannis/src/annis/db/token_helper.rs +++ b/graphannis/src/annis/db/token_helper.rs @@ -1,8 +1,8 @@ use crate::{ + AnnotationGraph, annis::db::aql::model::{AnnotationComponentType, TOKEN_KEY}, errors::Result, graph::GraphStorage, - AnnotationGraph, }; use graphannis_core::{ annostorage::NodeAnnotationStorage, diff --git a/graphannis/src/annis/util/sortablecontainer.rs b/graphannis/src/annis/util/sortablecontainer.rs index 2b77ad7c2..a180283a4 100644 --- a/graphannis/src/annis/util/sortablecontainer.rs +++ b/graphannis/src/annis/util/sortablecontainer.rs @@ -1,7 +1,7 @@ use std::borrow::Cow; use crate::annis::errors::{GraphAnnisError, Result}; -use serde::{de::DeserializeOwned, Serialize}; +use serde::{Serialize, de::DeserializeOwned}; pub trait SortableContainer: Send { /// Swaps two elements in the container. diff --git a/graphannis/src/lib.rs b/graphannis/src/lib.rs index b10706d5b..fee18146b 100644 --- a/graphannis/src/lib.rs +++ b/graphannis/src/lib.rs @@ -77,7 +77,7 @@ pub mod errors { /// Utility functions. pub mod util { + pub use crate::annis::util::SearchDef; pub use crate::annis::util::get_queries_from_csv; pub use crate::annis::util::node_names_from_match; - pub use crate::annis::util::SearchDef; } diff --git a/graphannis/tests/searchtest.rs b/graphannis/tests/searchtest.rs index 5157e254a..4c44966ee 100644 --- a/graphannis/tests/searchtest.rs +++ b/graphannis/tests/searchtest.rs @@ -2,8 +2,8 @@ extern crate graphannis; #[macro_use] extern crate lazy_static; -use graphannis::corpusstorage::{QueryLanguage, SearchQuery}; use graphannis::CorpusStorage; +use graphannis::corpusstorage::{QueryLanguage, SearchQuery}; use std::path::PathBuf; @@ -288,7 +288,12 @@ fn exclude_optional_node_in_between() { .unwrap(); // Only node #1 and #3 should be part of the output - assert_eq!(vec!["ref::entity::GUM/GUM_interview_ants#referent_291 ref::infstat::GUM/GUM_interview_ants#referent_321"], result); + assert_eq!( + vec![ + "ref::entity::GUM/GUM_interview_ants#referent_291 ref::infstat::GUM/GUM_interview_ants#referent_321" + ], + result + ); } #[ignore] @@ -312,7 +317,12 @@ fn exclude_optional_node_at_end() { .unwrap(); // Only node #1 and #2 should be part of the output - assert_eq!(vec!["ref::entity::GUM/GUM_interview_ants#referent_291 ref::infstat::GUM/GUM_interview_ants#referent_321"], result); + assert_eq!( + vec![ + "ref::entity::GUM/GUM_interview_ants#referent_291 ref::infstat::GUM/GUM_interview_ants#referent_321" + ], + result + ); } #[ignore] diff --git a/webservice/src/api/administration.rs b/webservice/src/api/administration.rs index ecbd389de..8d6b5e82b 100644 --- a/webservice/src/api/administration.rs +++ b/webservice/src/api/administration.rs @@ -1,9 +1,9 @@ use super::check_is_admin; use crate::{ - actions, errors::ServiceError, extractors::ClaimsFromAuth, settings::Settings, DbPool, + DbPool, actions, errors::ServiceError, extractors::ClaimsFromAuth, settings::Settings, }; use actix_files::NamedFile; -use actix_web::{web, HttpRequest, HttpResponse}; +use actix_web::{HttpRequest, HttpResponse, web}; use futures::prelude::*; use graphannis::CorpusStorage; use std::io::Seek; @@ -145,26 +145,29 @@ pub async fn import_corpus( info!("Job {} update: {}", &id_as_string, status); // Add status report to background job messages if let Ok(mut jobs) = background_jobs.jobs.lock() - && let Some(j) = jobs.get_mut(&id) { - j.messages.push(status.to_string()); - } + && let Some(j) = jobs.get_mut(&id) + { + j.messages.push(status.to_string()); + } }, ); match import_result { Ok(corpora) => { if let Ok(mut jobs) = background_jobs.jobs.lock() - && let Some(j) = jobs.get_mut(&id) { - j.messages.push(format!("imported corpora {:?}", corpora)); - j.status = JobStatus::Finished(None); - } + && let Some(j) = jobs.get_mut(&id) + { + j.messages.push(format!("imported corpora {:?}", corpora)); + j.status = JobStatus::Finished(None); + } } Err(err) => { if let Ok(mut jobs) = background_jobs.jobs.lock() - && let Some(j) = jobs.get_mut(&id) { - j.messages - .push(format!("importing corpora failed: {:?}", err)); - j.status = JobStatus::Failed; - } + && let Some(j) = jobs.get_mut(&id) + { + j.messages + .push(format!("importing corpora failed: {:?}", err)); + j.status = JobStatus::Failed; + } } } }); @@ -201,9 +204,10 @@ fn export_corpus_background_taks( info!("Job {} update: {}", &id_as_string, status); // Add status report to background job messages if let Ok(mut jobs) = background_jobs.jobs.lock() - && let Some(j) = jobs.get_mut(&id) { - j.messages.push(status.to_string()); - } + && let Some(j) = jobs.get_mut(&id) + { + j.messages.push(status.to_string()); + } })?; } let mut tmp_zip = zip.finish()?; @@ -237,18 +241,20 @@ pub async fn export_corpus( match export_corpus_background_taks(¶ms.corpora, &cs, id, background_jobs.clone()) { Ok(tmp_file) => { if let Ok(mut jobs) = background_jobs.jobs.lock() - && let Some(j) = jobs.get_mut(&id) { - let created_file_name = params.corpora.join("_") + ".zip"; - j.status = JobStatus::Finished(Some((tmp_file, created_file_name))); - } + && let Some(j) = jobs.get_mut(&id) + { + let created_file_name = params.corpora.join("_") + ".zip"; + j.status = JobStatus::Finished(Some((tmp_file, created_file_name))); + } } Err(err) => { if let Ok(mut jobs) = background_jobs.jobs.lock() - && let Some(j) = jobs.get_mut(&id) { - j.messages - .push(format!("exporting corpora failed: {:?}", err)); - j.status = JobStatus::Failed; - } + && let Some(j) = jobs.get_mut(&id) + { + j.messages + .push(format!("exporting corpora failed: {:?}", err)); + j.status = JobStatus::Failed; + } } } }); @@ -270,10 +276,11 @@ pub async fn jobs( let mut jobs = background_jobs.jobs.lock()?; if let Some(j) = jobs.get(&uuid) - && let JobStatus::Running = j.status { - // Job still running, do not remove it from the job list - return Ok(HttpResponse::Accepted().json(j)); - } + && let JobStatus::Running = j.status + { + // Job still running, do not remove it from the job list + return Ok(HttpResponse::Accepted().json(j)); + } // Job is finished/errored: remove it from the list and process it if let Some(j) = jobs.remove(&uuid) { match j.status { diff --git a/webservice/src/api/corpora.rs b/webservice/src/api/corpora.rs index 1637ee223..604aa1367 100644 --- a/webservice/src/api/corpora.rs +++ b/webservice/src/api/corpora.rs @@ -1,13 +1,13 @@ use super::{check_corpora_authorized_read, check_is_admin}; use crate::{ - actions, errors::ServiceError, extractors::ClaimsFromAuth, settings::Settings, DbPool, + DbPool, actions, errors::ServiceError, extractors::ClaimsFromAuth, settings::Settings, }; use actix_files::NamedFile; -use actix_web::{web, HttpResponse}; +use actix_web::{HttpResponse, web}; use graphannis::{ - corpusstorage::QueryLanguage, graph, model::AnnotationComponentType, CorpusStorage, + CorpusStorage, corpusstorage::QueryLanguage, graph, model::AnnotationComponentType, }; -use percent_encoding::{utf8_percent_encode, AsciiSet, CONTROLS}; +use percent_encoding::{AsciiSet, CONTROLS, utf8_percent_encode}; use std::{borrow::Cow, path::PathBuf}; pub const PATH_SEGMENT_ENCODE_SET: &AsciiSet = &CONTROLS diff --git a/webservice/src/api/mod.rs b/webservice/src/api/mod.rs index 7ed1c768b..02f793e52 100644 --- a/webservice/src/api/mod.rs +++ b/webservice/src/api/mod.rs @@ -1,4 +1,4 @@ -use crate::{actions, auth::Claims, errors::ServiceError, settings::Settings, DbPool}; +use crate::{DbPool, actions, auth::Claims, errors::ServiceError, settings::Settings}; use actix_web::web; pub mod administration; diff --git a/webservice/src/api/search.rs b/webservice/src/api/search.rs index 999e0093b..c283cbe91 100644 --- a/webservice/src/api/search.rs +++ b/webservice/src/api/search.rs @@ -1,15 +1,15 @@ use std::time::Duration; use super::check_corpora_authorized_read; -use crate::{errors::ServiceError, extractors::ClaimsFromAuth, settings::Settings, DbPool}; +use crate::{DbPool, errors::ServiceError, extractors::ClaimsFromAuth, settings::Settings}; use actix_web::{ - web::{self, Bytes}, HttpResponse, + web::{self, Bytes}, }; use futures::stream::iter; use graphannis::{ - corpusstorage::{FrequencyDefEntry, QueryLanguage, ResultOrder, SearchQuery}, CorpusStorage, + corpusstorage::{FrequencyDefEntry, QueryLanguage, ResultOrder, SearchQuery}, }; use serde::Deserialize; diff --git a/webservice/src/extractors.rs b/webservice/src/extractors.rs index a27f51c83..c73a73eb5 100644 --- a/webservice/src/extractors.rs +++ b/webservice/src/extractors.rs @@ -1,6 +1,6 @@ use crate::{auth::Claims, errors::ServiceError, settings::Settings}; -use actix_web::{web, FromRequest}; -use futures::future::{err, ok, ready, Ready}; +use actix_web::{FromRequest, web}; +use futures::future::{Ready, err, ok, ready}; #[derive(Debug, Clone, Serialize)] pub struct ClaimsFromAuth(pub Claims); @@ -27,20 +27,22 @@ impl FromRequest for ClaimsFromAuth { _payload: &mut actix_web::dev::Payload, ) -> Self::Future { if let Some(settings) = req.app_data::>() - && let Some(authen_header) = req.headers().get("Authorization") { - // Parse header - if let Ok(authen_str) = authen_header.to_str() - && (authen_str.starts_with("bearer") || authen_str.starts_with("Bearer")) { - // Parse and verify token - let token = authen_str[6..authen_str.len()].trim(); - return match verify_token(token, settings) { - // Use the verified claim - Ok(claim) => ok(ClaimsFromAuth(claim)), - // If a token was given but invalid, report an error - Err(e) => err(e), - }; - } + && let Some(authen_header) = req.headers().get("Authorization") + { + // Parse header + if let Ok(authen_str) = authen_header.to_str() + && (authen_str.starts_with("bearer") || authen_str.starts_with("Bearer")) + { + // Parse and verify token + let token = authen_str[6..authen_str.len()].trim(); + return match verify_token(token, settings) { + // Use the verified claim + Ok(claim) => ok(ClaimsFromAuth(claim)), + // If a token was given but invalid, report an error + Err(e) => err(e), + }; } + } // Return an anonymous default claim ready(Ok(ClaimsFromAuth(Claims { diff --git a/webservice/src/main.rs b/webservice/src/main.rs index da64ea35a..e6e7cde5f 100644 --- a/webservice/src/main.rs +++ b/webservice/src/main.rs @@ -17,14 +17,14 @@ use ::r2d2::Pool; use actix_cors::Cors; use actix_web::body::MessageBody; use actix_web::dev::{ServiceFactory, ServiceRequest, ServiceResponse}; -use actix_web::{http, middleware::Logger, web, App, HttpRequest, HttpResponse, HttpServer}; +use actix_web::{App, HttpRequest, HttpResponse, HttpServer, http, middleware::Logger, web}; use administration::BackgroundJobs; use anyhow::bail; use api::administration; use clap::Arg; use diesel::prelude::*; use diesel::r2d2::{self, ConnectionManager}; -use diesel_migrations::{embed_migrations, EmbeddedMigrations, MigrationHarness}; +use diesel_migrations::{EmbeddedMigrations, MigrationHarness, embed_migrations}; use graphannis::CorpusStorage; use log::{set_boxed_logger, set_max_level}; use settings::Settings; @@ -81,7 +81,9 @@ fn init_app_state() -> anyhow::Result<(graphannis::CorpusStorage, settings::Sett let (logger, fallback_logger) = create_logger(&settings)?; let log_level = logger.level(); if let Err(e) = set_boxed_logger(logger) { - println!("Error, can't initialize the terminal log output: {e}.\nWill degrade to a more simple logger"); + println!( + "Error, can't initialize the terminal log output: {e}.\nWill degrade to a more simple logger" + ); if let Err(e_simple) = set_boxed_logger(fallback_logger) { println!("Simple logging failed too: {e_simple}"); } diff --git a/webservice/src/tests.rs b/webservice/src/tests.rs index c4c615bcf..41f3d4ff2 100644 --- a/webservice/src/tests.rs +++ b/webservice/src/tests.rs @@ -4,16 +4,16 @@ use std::{ }; use actix_web::{ + App, body::MessageBody, dev::{ServiceFactory, ServiceRequest, ServiceResponse}, http::StatusCode, test, web::{self, Bytes}, - App, }; -use diesel::{r2d2::ConnectionManager, SqliteConnection}; +use diesel::{SqliteConnection, r2d2::ConnectionManager}; use diesel_migrations::MigrationHarness; -use graphannis::{corpusstorage::ImportFormat, CorpusStorage}; +use graphannis::{CorpusStorage, corpusstorage::ImportFormat}; use insta::assert_snapshot; use jsonwebtoken::EncodingKey; use log::{Level, Log, RecordBuilder}; From 7eab9039db18cf822be96bccfabccc9ee6ba485c Mon Sep 17 00:00:00 2001 From: Thomas Krause Date: Wed, 13 Aug 2025 16:50:59 +0200 Subject: [PATCH 3/7] Update license file --- about.toml | 27 +- third-party-licenses.html | 3399 ++++++++++++++++++++----------------- 2 files changed, 1847 insertions(+), 1579 deletions(-) diff --git a/about.toml b/about.toml index 9a349a6de..8ba055d74 100644 --- a/about.toml +++ b/about.toml @@ -1,17 +1,16 @@ accepted = [ - "Apache-2.0", - "MIT", - "BSD-3-Clause", - "BSD-2-Clause", - "BSL-1.0", - "MPL-2.0", - "CC0-1.0", - "ISC", - "Zlib", - "OpenSSL", - "Unicode-DFS-2016", + "Apache-2.0", + "MIT", + "BSD-3-Clause", + "BSD-2-Clause", + "BSL-1.0", + "MPL-2.0", + "CC0-1.0", + "ISC", + "Zlib", + "OpenSSL", + "Unicode-DFS-2016", + "Unicode-3.0", ] -workarounds = [ - "ring", -] +workarounds = ["ring"] diff --git a/third-party-licenses.html b/third-party-licenses.html index c74943989..de5e3f183 100644 --- a/third-party-licenses.html +++ b/third-party-licenses.html @@ -46,15 +46,15 @@

Third Party Licenses

Overview of licenses:

All license text:

@@ -63,11 +63,14 @@

All license text:

Apache License 2.0

Used by:

                                  Apache License
@@ -252,7 +255,7 @@ 

Used by:

Apache License 2.0

Used by:

                                  Apache License
@@ -462,7 +465,7 @@ 

Used by:

Apache License 2.0

Used by:

                                  Apache License
@@ -671,10 +674,7 @@ 

Used by:

Apache License 2.0

Used by:

                                  Apache License
@@ -865,7 +865,7 @@ 

Used by:

same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2022 Jacob Pratt et al. + Copyright 2023 Jacob Pratt Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -1094,7 +1094,7 @@

Used by:

Apache License 2.0

Used by:

                                  Apache License
@@ -1285,7 +1285,7 @@ 

Used by:

same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2024 Jacob Pratt et al. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -1297,16 +1297,15 @@

Used by:

distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and - limitations under the License.
+ limitations under the License. +
  • Apache License 2.0

    Used by:

                                      Apache License
    @@ -1509,228 +1508,18 @@ 

    Used by:

    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and - limitations under the License. -
    -
  • -
  • -

    Apache License 2.0

    -

    Used by:

    - -
    -                                 Apache License
    -                           Version 2.0, January 2004
    -                        http://www.apache.org/licenses/
    -
    -   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
    -
    -   1. Definitions.
    -
    -      "License" shall mean the terms and conditions for use, reproduction,
    -      and distribution as defined by Sections 1 through 9 of this document.
    -
    -      "Licensor" shall mean the copyright owner or entity authorized by
    -      the copyright owner that is granting the License.
    -
    -      "Legal Entity" shall mean the union of the acting entity and all
    -      other entities that control, are controlled by, or are under common
    -      control with that entity. For the purposes of this definition,
    -      "control" means (i) the power, direct or indirect, to cause the
    -      direction or management of such entity, whether by contract or
    -      otherwise, or (ii) ownership of fifty percent (50%) or more of the
    -      outstanding shares, or (iii) beneficial ownership of such entity.
    -
    -      "You" (or "Your") shall mean an individual or Legal Entity
    -      exercising permissions granted by this License.
    -
    -      "Source" form shall mean the preferred form for making modifications,
    -      including but not limited to software source code, documentation
    -      source, and configuration files.
    -
    -      "Object" form shall mean any form resulting from mechanical
    -      transformation or translation of a Source form, including but
    -      not limited to compiled object code, generated documentation,
    -      and conversions to other media types.
    -
    -      "Work" shall mean the work of authorship, whether in Source or
    -      Object form, made available under the License, as indicated by a
    -      copyright notice that is included in or attached to the work
    -      (an example is provided in the Appendix below).
    -
    -      "Derivative Works" shall mean any work, whether in Source or Object
    -      form, that is based on (or derived from) the Work and for which the
    -      editorial revisions, annotations, elaborations, or other modifications
    -      represent, as a whole, an original work of authorship. For the purposes
    -      of this License, Derivative Works shall not include works that remain
    -      separable from, or merely link (or bind by name) to the interfaces of,
    -      the Work and Derivative Works thereof.
    -
    -      "Contribution" shall mean any work of authorship, including
    -      the original version of the Work and any modifications or additions
    -      to that Work or Derivative Works thereof, that is intentionally
    -      submitted to Licensor for inclusion in the Work by the copyright owner
    -      or by an individual or Legal Entity authorized to submit on behalf of
    -      the copyright owner. For the purposes of this definition, "submitted"
    -      means any form of electronic, verbal, or written communication sent
    -      to the Licensor or its representatives, including but not limited to
    -      communication on electronic mailing lists, source code control systems,
    -      and issue tracking systems that are managed by, or on behalf of, the
    -      Licensor for the purpose of discussing and improving the Work, but
    -      excluding communication that is conspicuously marked or otherwise
    -      designated in writing by the copyright owner as "Not a Contribution."
    -
    -      "Contributor" shall mean Licensor and any individual or Legal Entity
    -      on behalf of whom a Contribution has been received by Licensor and
    -      subsequently incorporated within the Work.
    -
    -   2. Grant of Copyright License. Subject to the terms and conditions of
    -      this License, each Contributor hereby grants to You a perpetual,
    -      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
    -      copyright license to reproduce, prepare Derivative Works of,
    -      publicly display, publicly perform, sublicense, and distribute the
    -      Work and such Derivative Works in Source or Object form.
    -
    -   3. Grant of Patent License. Subject to the terms and conditions of
    -      this License, each Contributor hereby grants to You a perpetual,
    -      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
    -      (except as stated in this section) patent license to make, have made,
    -      use, offer to sell, sell, import, and otherwise transfer the Work,
    -      where such license applies only to those patent claims licensable
    -      by such Contributor that are necessarily infringed by their
    -      Contribution(s) alone or by combination of their Contribution(s)
    -      with the Work to which such Contribution(s) was submitted. If You
    -      institute patent litigation against any entity (including a
    -      cross-claim or counterclaim in a lawsuit) alleging that the Work
    -      or a Contribution incorporated within the Work constitutes direct
    -      or contributory patent infringement, then any patent licenses
    -      granted to You under this License for that Work shall terminate
    -      as of the date such litigation is filed.
    -
    -   4. Redistribution. You may reproduce and distribute copies of the
    -      Work or Derivative Works thereof in any medium, with or without
    -      modifications, and in Source or Object form, provided that You
    -      meet the following conditions:
    -
    -      (a) You must give any other recipients of the Work or
    -          Derivative Works a copy of this License; and
    -
    -      (b) You must cause any modified files to carry prominent notices
    -          stating that You changed the files; and
    -
    -      (c) You must retain, in the Source form of any Derivative Works
    -          that You distribute, all copyright, patent, trademark, and
    -          attribution notices from the Source form of the Work,
    -          excluding those notices that do not pertain to any part of
    -          the Derivative Works; and
    -
    -      (d) If the Work includes a "NOTICE" text file as part of its
    -          distribution, then any Derivative Works that You distribute must
    -          include a readable copy of the attribution notices contained
    -          within such NOTICE file, excluding those notices that do not
    -          pertain to any part of the Derivative Works, in at least one
    -          of the following places: within a NOTICE text file distributed
    -          as part of the Derivative Works; within the Source form or
    -          documentation, if provided along with the Derivative Works; or,
    -          within a display generated by the Derivative Works, if and
    -          wherever such third-party notices normally appear. The contents
    -          of the NOTICE file are for informational purposes only and
    -          do not modify the License. You may add Your own attribution
    -          notices within Derivative Works that You distribute, alongside
    -          or as an addendum to the NOTICE text from the Work, provided
    -          that such additional attribution notices cannot be construed
    -          as modifying the License.
    -
    -      You may add Your own copyright statement to Your modifications and
    -      may provide additional or different license terms and conditions
    -      for use, reproduction, or distribution of Your modifications, or
    -      for any such Derivative Works as a whole, provided Your use,
    -      reproduction, and distribution of the Work otherwise complies with
    -      the conditions stated in this License.
    -
    -   5. Submission of Contributions. Unless You explicitly state otherwise,
    -      any Contribution intentionally submitted for inclusion in the Work
    -      by You to the Licensor shall be under the terms and conditions of
    -      this License, without any additional terms or conditions.
    -      Notwithstanding the above, nothing herein shall supersede or modify
    -      the terms of any separate license agreement you may have executed
    -      with Licensor regarding such Contributions.
    -
    -   6. Trademarks. This License does not grant permission to use the trade
    -      names, trademarks, service marks, or product names of the Licensor,
    -      except as required for reasonable and customary use in describing the
    -      origin of the Work and reproducing the content of the NOTICE file.
    -
    -   7. Disclaimer of Warranty. Unless required by applicable law or
    -      agreed to in writing, Licensor provides the Work (and each
    -      Contributor provides its Contributions) on an "AS IS" BASIS,
    -      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
    -      implied, including, without limitation, any warranties or conditions
    -      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
    -      PARTICULAR PURPOSE. You are solely responsible for determining the
    -      appropriateness of using or redistributing the Work and assume any
    -      risks associated with Your exercise of permissions under this License.
    -
    -   8. Limitation of Liability. In no event and under no legal theory,
    -      whether in tort (including negligence), contract, or otherwise,
    -      unless required by applicable law (such as deliberate and grossly
    -      negligent acts) or agreed to in writing, shall any Contributor be
    -      liable to You for damages, including any direct, indirect, special,
    -      incidental, or consequential damages of any character arising as a
    -      result of this License or out of the use or inability to use the
    -      Work (including but not limited to damages for loss of goodwill,
    -      work stoppage, computer failure or malfunction, or any and all
    -      other commercial damages or losses), even if such Contributor
    -      has been advised of the possibility of such damages.
    -
    -   9. Accepting Warranty or Additional Liability. While redistributing
    -      the Work or Derivative Works thereof, You may choose to offer,
    -      and charge a fee for, acceptance of support, warranty, indemnity,
    -      or other liability obligations and/or rights consistent with this
    -      License. However, in accepting such obligations, You may act only
    -      on Your own behalf and on Your sole responsibility, not on behalf
    -      of any other Contributor, and only if You agree to indemnify,
    -      defend, and hold each Contributor harmless for any liability
    -      incurred by, or claims asserted against, such Contributor by reason
    -      of your accepting any such warranty or additional liability.
    -
    -   END OF TERMS AND CONDITIONS
    -
    -   APPENDIX: How to apply the Apache License to your work.
    -
    -      To apply the Apache License to your work, attach the following
    -      boilerplate notice, with the fields enclosed by brackets "[]"
    -      replaced with your own identifying information. (Don't include
    -      the brackets!)  The text should be enclosed in the appropriate
    -      comment syntax for the file format. We also recommend that a
    -      file or class name and description of purpose be included on the
    -      same "printed page" as the copyright notice for easier
    -      identification within third-party archives.
    -
    -   Copyright [yyyy] [name of copyright owner]
    -
    -   Licensed under the Apache License, Version 2.0 (the "License");
    -   you may not use this file except in compliance with the License.
    -   You may obtain a copy of the License at
    -
    -       http://www.apache.org/licenses/LICENSE-2.0
    -
    -   Unless required by applicable law or agreed to in writing, software
    -   distributed under the License is distributed on an "AS IS" BASIS,
    -   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    -   See the License for the specific language governing permissions and
    -   limitations under the License.
    -
    + limitations under the License.
  • Apache License 2.0

    Used by:

    -
                                     Apache License
    +                
    +                                 Apache License
                                Version 2.0, January 2004
                             http://www.apache.org/licenses/
     
    @@ -1906,15 +1695,46 @@ 

    Used by:

    of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License.
  • Apache License 2.0

    Used by:

    -
                                     Apache License
    +                
    +                                 Apache License
                                Version 2.0, January 2004
                             http://www.apache.org/licenses/
     
    @@ -2102,7 +1922,7 @@ 

    Used by:

    same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright (c) 2016 cksac + Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -2115,31 +1935,32 @@

    Used by:

    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + + +--- LLVM Exceptions to the Apache 2.0 License ---- + +As an exception, if, as a result of your compiling your source code, portions +of this Software are embedded into an Object form of such source code, you +may redistribute such embedded portions in such Object form without complying +with the conditions of Sections 4(a), 4(b) and 4(d) of the License. + +In addition, if you combine or link compiled forms of this Software with +software that is licensed under the GPLv2 ("Combined Software") and if a +court of competent jurisdiction determines that the patent provision (Section +3), the indemnity provision (Section 9) or other Section of the License +conflicts with the conditions of the GPLv2, you may retroactively and +prospectively choose to deem waived or otherwise exclude such Section(s) of +the License, but only in their entirety and only with respect to the Combined +Software. +
  • Apache License 2.0

    Used by:

                                     Apache License
                                Version 2.0, January 2004
    @@ -2317,38 +2138,13 @@ 

    Used by:

    of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright (c) Microsoft Corporation. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License.
  • Apache License 2.0

    Used by:

                                     Apache License
                                Version 2.0, January 2004
    @@ -2538,7 +2334,7 @@ 

    Used by:

    same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2019 Akhil Velagapudi + Copyright (c) 2016 cksac Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -2557,7 +2353,42 @@

    Used by:

    Apache License 2.0

    Used by:

                                     Apache License
                                Version 2.0, January 2004
    @@ -2747,7 +2578,7 @@ 

    Used by:

    same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2020 Tomasz "Soveu" Marx + Copyright (c) Microsoft Corporation. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -2760,14 +2591,13 @@

    Used by:

    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -
  • Apache License 2.0

    Used by:

                                     Apache License
                                Version 2.0, January 2004
    @@ -2957,7 +2787,7 @@ 

    Used by:

    same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2023 The Fuchsia Authors + Copyright 2019 Akhil Velagapudi Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -2970,18 +2800,13 @@

    Used by:

    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -
  • Apache License 2.0

    Used by:

                                     Apache License
                                Version 2.0, January 2004
    @@ -3171,7 +2996,7 @@ 

    Used by:

    same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2023 The Fuchsia Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -3184,26 +3009,16 @@

    Used by:

    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +
  • Apache License 2.0

    Used by:

                                     Apache License
                                Version 2.0, January 2004
    @@ -3385,7 +3200,7 @@ 

    Used by:

    APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" + boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a @@ -3393,7 +3208,7 @@

    Used by:

    same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2017-NOW Actix Team + Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -3412,7 +3227,20 @@

    Used by:

    Apache License 2.0

    Used by:

                                     Apache License
                                Version 2.0, January 2004
    @@ -3602,7 +3430,7 @@ 

    Used by:

    same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2017-NOW Actix team + Copyright 2017-NOW Actix Team Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -3621,9 +3449,7 @@

    Used by:

    Apache License 2.0

    Used by:

                                     Apache License
                                Version 2.0, January 2004
    @@ -3813,7 +3639,7 @@ 

    Used by:

    same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright {yyyy} {name of copyright owner} + Copyright 2017-NOW Actix team Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -3832,17 +3658,7 @@

    Used by:

    Apache License 2.0

    Used by:

                                     Apache License
                                Version 2.0, January 2004
    @@ -4032,7 +3848,7 @@ 

    Used by:

    same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright {yyyy} {name of copyright owner} + Copyright 2022-NOW Rob Ede Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -4045,19 +3861,17 @@

    Used by:

    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -
  • Apache License 2.0

    Used by:

                                     Apache License
                                Version 2.0, January 2004
    @@ -4236,7 +4050,18 @@ 

    Used by:

    END OF TERMS AND CONDITIONS - Copyright 2015-2021 Sean Griffin, 2018-2021 Diesel Core Team + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -4255,7 +4080,26 @@

    Used by:

    Apache License 2.0

    Used by:

                                     Apache License
                                Version 2.0, January 2004
    @@ -4434,7 +4278,18 @@ 

    Used by:

    END OF TERMS AND CONDITIONS - Copyright 2019 Yoshua Wuyts + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -4447,225 +4302,1039 @@

    Used by:

    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +
  • Apache License 2.0

    Used by:

                                     Apache License
                                Version 2.0, January 2004
                             http://www.apache.org/licenses/
     
    -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
    +   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
     
    -1.  Definitions.
    +   1. Definitions.
     
    -    "License" shall mean the terms and conditions for use, reproduction,
    -    and distribution as defined by Sections 1 through 9 of this document.
    +      "License" shall mean the terms and conditions for use, reproduction,
    +      and distribution as defined by Sections 1 through 9 of this document.
     
    -    "Licensor" shall mean the copyright owner or entity authorized by
    -    the copyright owner that is granting the License.
    +      "Licensor" shall mean the copyright owner or entity authorized by
    +      the copyright owner that is granting the License.
     
    -    "Legal Entity" shall mean the union of the acting entity and all
    -    other entities that control, are controlled by, or are under common
    -    control with that entity. For the purposes of this definition,
    -    "control" means (i) the power, direct or indirect, to cause the
    -    direction or management of such entity, whether by contract or
    -    otherwise, or (ii) ownership of fifty percent (50%) or more of the
    -    outstanding shares, or (iii) beneficial ownership of such entity.
    +      "Legal Entity" shall mean the union of the acting entity and all
    +      other entities that control, are controlled by, or are under common
    +      control with that entity. For the purposes of this definition,
    +      "control" means (i) the power, direct or indirect, to cause the
    +      direction or management of such entity, whether by contract or
    +      otherwise, or (ii) ownership of fifty percent (50%) or more of the
    +      outstanding shares, or (iii) beneficial ownership of such entity.
     
    -    "You" (or "Your") shall mean an individual or Legal Entity
    -    exercising permissions granted by this License.
    +      "You" (or "Your") shall mean an individual or Legal Entity
    +      exercising permissions granted by this License.
     
    -    "Source" form shall mean the preferred form for making modifications,
    -    including but not limited to software source code, documentation
    -    source, and configuration files.
    +      "Source" form shall mean the preferred form for making modifications,
    +      including but not limited to software source code, documentation
    +      source, and configuration files.
     
    -    "Object" form shall mean any form resulting from mechanical
    -    transformation or translation of a Source form, including but
    -    not limited to compiled object code, generated documentation,
    -    and conversions to other media types.
    +      "Object" form shall mean any form resulting from mechanical
    +      transformation or translation of a Source form, including but
    +      not limited to compiled object code, generated documentation,
    +      and conversions to other media types.
     
    -    "Work" shall mean the work of authorship, whether in Source or
    -    Object form, made available under the License, as indicated by a
    -    copyright notice that is included in or attached to the work
    -    (an example is provided in the Appendix below).
    +      "Work" shall mean the work of authorship, whether in Source or
    +      Object form, made available under the License, as indicated by a
    +      copyright notice that is included in or attached to the work
    +      (an example is provided in the Appendix below).
     
    -    "Derivative Works" shall mean any work, whether in Source or Object
    -    form, that is based on (or derived from) the Work and for which the
    +      "Derivative Works" shall mean any work, whether in Source or Object
    +      form, that is based on (or derived from) the Work and for which the
    +      editorial revisions, annotations, elaborations, or other modifications
    +      represent, as a whole, an original work of authorship. For the purposes
    +      of this License, Derivative Works shall not include works that remain
    +      separable from, or merely link (or bind by name) to the interfaces of,
    +      the Work and Derivative Works thereof.
    +
    +      "Contribution" shall mean any work of authorship, including
    +      the original version of the Work and any modifications or additions
    +      to that Work or Derivative Works thereof, that is intentionally
    +      submitted to Licensor for inclusion in the Work by the copyright owner
    +      or by an individual or Legal Entity authorized to submit on behalf of
    +      the copyright owner. For the purposes of this definition, "submitted"
    +      means any form of electronic, verbal, or written communication sent
    +      to the Licensor or its representatives, including but not limited to
    +      communication on electronic mailing lists, source code control systems,
    +      and issue tracking systems that are managed by, or on behalf of, the
    +      Licensor for the purpose of discussing and improving the Work, but
    +      excluding communication that is conspicuously marked or otherwise
    +      designated in writing by the copyright owner as "Not a Contribution."
    +
    +      "Contributor" shall mean Licensor and any individual or Legal Entity
    +      on behalf of whom a Contribution has been received by Licensor and
    +      subsequently incorporated within the Work.
    +
    +   2. Grant of Copyright License. Subject to the terms and conditions of
    +      this License, each Contributor hereby grants to You a perpetual,
    +      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
    +      copyright license to reproduce, prepare Derivative Works of,
    +      publicly display, publicly perform, sublicense, and distribute the
    +      Work and such Derivative Works in Source or Object form.
    +
    +   3. Grant of Patent License. Subject to the terms and conditions of
    +      this License, each Contributor hereby grants to You a perpetual,
    +      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
    +      (except as stated in this section) patent license to make, have made,
    +      use, offer to sell, sell, import, and otherwise transfer the Work,
    +      where such license applies only to those patent claims licensable
    +      by such Contributor that are necessarily infringed by their
    +      Contribution(s) alone or by combination of their Contribution(s)
    +      with the Work to which such Contribution(s) was submitted. If You
    +      institute patent litigation against any entity (including a
    +      cross-claim or counterclaim in a lawsuit) alleging that the Work
    +      or a Contribution incorporated within the Work constitutes direct
    +      or contributory patent infringement, then any patent licenses
    +      granted to You under this License for that Work shall terminate
    +      as of the date such litigation is filed.
    +
    +   4. Redistribution. You may reproduce and distribute copies of the
    +      Work or Derivative Works thereof in any medium, with or without
    +      modifications, and in Source or Object form, provided that You
    +      meet the following conditions:
    +
    +      (a) You must give any other recipients of the Work or
    +          Derivative Works a copy of this License; and
    +
    +      (b) You must cause any modified files to carry prominent notices
    +          stating that You changed the files; and
    +
    +      (c) You must retain, in the Source form of any Derivative Works
    +          that You distribute, all copyright, patent, trademark, and
    +          attribution notices from the Source form of the Work,
    +          excluding those notices that do not pertain to any part of
    +          the Derivative Works; and
    +
    +      (d) If the Work includes a "NOTICE" text file as part of its
    +          distribution, then any Derivative Works that You distribute must
    +          include a readable copy of the attribution notices contained
    +          within such NOTICE file, excluding those notices that do not
    +          pertain to any part of the Derivative Works, in at least one
    +          of the following places: within a NOTICE text file distributed
    +          as part of the Derivative Works; within the Source form or
    +          documentation, if provided along with the Derivative Works; or,
    +          within a display generated by the Derivative Works, if and
    +          wherever such third-party notices normally appear. The contents
    +          of the NOTICE file are for informational purposes only and
    +          do not modify the License. You may add Your own attribution
    +          notices within Derivative Works that You distribute, alongside
    +          or as an addendum to the NOTICE text from the Work, provided
    +          that such additional attribution notices cannot be construed
    +          as modifying the License.
    +
    +      You may add Your own copyright statement to Your modifications and
    +      may provide additional or different license terms and conditions
    +      for use, reproduction, or distribution of Your modifications, or
    +      for any such Derivative Works as a whole, provided Your use,
    +      reproduction, and distribution of the Work otherwise complies with
    +      the conditions stated in this License.
    +
    +   5. Submission of Contributions. Unless You explicitly state otherwise,
    +      any Contribution intentionally submitted for inclusion in the Work
    +      by You to the Licensor shall be under the terms and conditions of
    +      this License, without any additional terms or conditions.
    +      Notwithstanding the above, nothing herein shall supersede or modify
    +      the terms of any separate license agreement you may have executed
    +      with Licensor regarding such Contributions.
    +
    +   6. Trademarks. This License does not grant permission to use the trade
    +      names, trademarks, service marks, or product names of the Licensor,
    +      except as required for reasonable and customary use in describing the
    +      origin of the Work and reproducing the content of the NOTICE file.
    +
    +   7. Disclaimer of Warranty. Unless required by applicable law or
    +      agreed to in writing, Licensor provides the Work (and each
    +      Contributor provides its Contributions) on an "AS IS" BASIS,
    +      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
    +      implied, including, without limitation, any warranties or conditions
    +      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
    +      PARTICULAR PURPOSE. You are solely responsible for determining the
    +      appropriateness of using or redistributing the Work and assume any
    +      risks associated with Your exercise of permissions under this License.
    +
    +   8. Limitation of Liability. In no event and under no legal theory,
    +      whether in tort (including negligence), contract, or otherwise,
    +      unless required by applicable law (such as deliberate and grossly
    +      negligent acts) or agreed to in writing, shall any Contributor be
    +      liable to You for damages, including any direct, indirect, special,
    +      incidental, or consequential damages of any character arising as a
    +      result of this License or out of the use or inability to use the
    +      Work (including but not limited to damages for loss of goodwill,
    +      work stoppage, computer failure or malfunction, or any and all
    +      other commercial damages or losses), even if such Contributor
    +      has been advised of the possibility of such damages.
    +
    +   9. Accepting Warranty or Additional Liability. While redistributing
    +      the Work or Derivative Works thereof, You may choose to offer,
    +      and charge a fee for, acceptance of support, warranty, indemnity,
    +      or other liability obligations and/or rights consistent with this
    +      License. However, in accepting such obligations, You may act only
    +      on Your own behalf and on Your sole responsibility, not on behalf
    +      of any other Contributor, and only if You agree to indemnify,
    +      defend, and hold each Contributor harmless for any liability
    +      incurred by, or claims asserted against, such Contributor by reason
    +      of your accepting any such warranty or additional liability.
    +
    +   END OF TERMS AND CONDITIONS
    +
    +   Copyright 2015-2021 Sean Griffin, 2018-2021 Diesel Core Team
    +
    +   Licensed under the Apache License, Version 2.0 (the "License");
    +   you may not use this file except in compliance with the License.
    +   You may obtain a copy of the License at
    +
    +       http://www.apache.org/licenses/LICENSE-2.0
    +
    +   Unless required by applicable law or agreed to in writing, software
    +   distributed under the License is distributed on an "AS IS" BASIS,
    +   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +   See the License for the specific language governing permissions and
    +   limitations under the License.
    +
    +
  • +
  • +

    Apache License 2.0

    +

    Used by:

    + +
                                     Apache License
    +                           Version 2.0, January 2004
    +                        http://www.apache.org/licenses/
    +
    +   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
    +
    +   1. Definitions.
    +
    +      "License" shall mean the terms and conditions for use, reproduction,
    +      and distribution as defined by Sections 1 through 9 of this document.
    +
    +      "Licensor" shall mean the copyright owner or entity authorized by
    +      the copyright owner that is granting the License.
    +
    +      "Legal Entity" shall mean the union of the acting entity and all
    +      other entities that control, are controlled by, or are under common
    +      control with that entity. For the purposes of this definition,
    +      "control" means (i) the power, direct or indirect, to cause the
    +      direction or management of such entity, whether by contract or
    +      otherwise, or (ii) ownership of fifty percent (50%) or more of the
    +      outstanding shares, or (iii) beneficial ownership of such entity.
    +
    +      "You" (or "Your") shall mean an individual or Legal Entity
    +      exercising permissions granted by this License.
    +
    +      "Source" form shall mean the preferred form for making modifications,
    +      including but not limited to software source code, documentation
    +      source, and configuration files.
    +
    +      "Object" form shall mean any form resulting from mechanical
    +      transformation or translation of a Source form, including but
    +      not limited to compiled object code, generated documentation,
    +      and conversions to other media types.
    +
    +      "Work" shall mean the work of authorship, whether in Source or
    +      Object form, made available under the License, as indicated by a
    +      copyright notice that is included in or attached to the work
    +      (an example is provided in the Appendix below).
    +
    +      "Derivative Works" shall mean any work, whether in Source or Object
    +      form, that is based on (or derived from) the Work and for which the
    +      editorial revisions, annotations, elaborations, or other modifications
    +      represent, as a whole, an original work of authorship. For the purposes
    +      of this License, Derivative Works shall not include works that remain
    +      separable from, or merely link (or bind by name) to the interfaces of,
    +      the Work and Derivative Works thereof.
    +
    +      "Contribution" shall mean any work of authorship, including
    +      the original version of the Work and any modifications or additions
    +      to that Work or Derivative Works thereof, that is intentionally
    +      submitted to Licensor for inclusion in the Work by the copyright owner
    +      or by an individual or Legal Entity authorized to submit on behalf of
    +      the copyright owner. For the purposes of this definition, "submitted"
    +      means any form of electronic, verbal, or written communication sent
    +      to the Licensor or its representatives, including but not limited to
    +      communication on electronic mailing lists, source code control systems,
    +      and issue tracking systems that are managed by, or on behalf of, the
    +      Licensor for the purpose of discussing and improving the Work, but
    +      excluding communication that is conspicuously marked or otherwise
    +      designated in writing by the copyright owner as "Not a Contribution."
    +
    +      "Contributor" shall mean Licensor and any individual or Legal Entity
    +      on behalf of whom a Contribution has been received by Licensor and
    +      subsequently incorporated within the Work.
    +
    +   2. Grant of Copyright License. Subject to the terms and conditions of
    +      this License, each Contributor hereby grants to You a perpetual,
    +      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
    +      copyright license to reproduce, prepare Derivative Works of,
    +      publicly display, publicly perform, sublicense, and distribute the
    +      Work and such Derivative Works in Source or Object form.
    +
    +   3. Grant of Patent License. Subject to the terms and conditions of
    +      this License, each Contributor hereby grants to You a perpetual,
    +      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
    +      (except as stated in this section) patent license to make, have made,
    +      use, offer to sell, sell, import, and otherwise transfer the Work,
    +      where such license applies only to those patent claims licensable
    +      by such Contributor that are necessarily infringed by their
    +      Contribution(s) alone or by combination of their Contribution(s)
    +      with the Work to which such Contribution(s) was submitted. If You
    +      institute patent litigation against any entity (including a
    +      cross-claim or counterclaim in a lawsuit) alleging that the Work
    +      or a Contribution incorporated within the Work constitutes direct
    +      or contributory patent infringement, then any patent licenses
    +      granted to You under this License for that Work shall terminate
    +      as of the date such litigation is filed.
    +
    +   4. Redistribution. You may reproduce and distribute copies of the
    +      Work or Derivative Works thereof in any medium, with or without
    +      modifications, and in Source or Object form, provided that You
    +      meet the following conditions:
    +
    +      (a) You must give any other recipients of the Work or
    +          Derivative Works a copy of this License; and
    +
    +      (b) You must cause any modified files to carry prominent notices
    +          stating that You changed the files; and
    +
    +      (c) You must retain, in the Source form of any Derivative Works
    +          that You distribute, all copyright, patent, trademark, and
    +          attribution notices from the Source form of the Work,
    +          excluding those notices that do not pertain to any part of
    +          the Derivative Works; and
    +
    +      (d) If the Work includes a "NOTICE" text file as part of its
    +          distribution, then any Derivative Works that You distribute must
    +          include a readable copy of the attribution notices contained
    +          within such NOTICE file, excluding those notices that do not
    +          pertain to any part of the Derivative Works, in at least one
    +          of the following places: within a NOTICE text file distributed
    +          as part of the Derivative Works; within the Source form or
    +          documentation, if provided along with the Derivative Works; or,
    +          within a display generated by the Derivative Works, if and
    +          wherever such third-party notices normally appear. The contents
    +          of the NOTICE file are for informational purposes only and
    +          do not modify the License. You may add Your own attribution
    +          notices within Derivative Works that You distribute, alongside
    +          or as an addendum to the NOTICE text from the Work, provided
    +          that such additional attribution notices cannot be construed
    +          as modifying the License.
    +
    +      You may add Your own copyright statement to Your modifications and
    +      may provide additional or different license terms and conditions
    +      for use, reproduction, or distribution of Your modifications, or
    +      for any such Derivative Works as a whole, provided Your use,
    +      reproduction, and distribution of the Work otherwise complies with
    +      the conditions stated in this License.
    +
    +   5. Submission of Contributions. Unless You explicitly state otherwise,
    +      any Contribution intentionally submitted for inclusion in the Work
    +      by You to the Licensor shall be under the terms and conditions of
    +      this License, without any additional terms or conditions.
    +      Notwithstanding the above, nothing herein shall supersede or modify
    +      the terms of any separate license agreement you may have executed
    +      with Licensor regarding such Contributions.
    +
    +   6. Trademarks. This License does not grant permission to use the trade
    +      names, trademarks, service marks, or product names of the Licensor,
    +      except as required for reasonable and customary use in describing the
    +      origin of the Work and reproducing the content of the NOTICE file.
    +
    +   7. Disclaimer of Warranty. Unless required by applicable law or
    +      agreed to in writing, Licensor provides the Work (and each
    +      Contributor provides its Contributions) on an "AS IS" BASIS,
    +      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
    +      implied, including, without limitation, any warranties or conditions
    +      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
    +      PARTICULAR PURPOSE. You are solely responsible for determining the
    +      appropriateness of using or redistributing the Work and assume any
    +      risks associated with Your exercise of permissions under this License.
    +
    +   8. Limitation of Liability. In no event and under no legal theory,
    +      whether in tort (including negligence), contract, or otherwise,
    +      unless required by applicable law (such as deliberate and grossly
    +      negligent acts) or agreed to in writing, shall any Contributor be
    +      liable to You for damages, including any direct, indirect, special,
    +      incidental, or consequential damages of any character arising as a
    +      result of this License or out of the use or inability to use the
    +      Work (including but not limited to damages for loss of goodwill,
    +      work stoppage, computer failure or malfunction, or any and all
    +      other commercial damages or losses), even if such Contributor
    +      has been advised of the possibility of such damages.
    +
    +   9. Accepting Warranty or Additional Liability. While redistributing
    +      the Work or Derivative Works thereof, You may choose to offer,
    +      and charge a fee for, acceptance of support, warranty, indemnity,
    +      or other liability obligations and/or rights consistent with this
    +      License. However, in accepting such obligations, You may act only
    +      on Your own behalf and on Your sole responsibility, not on behalf
    +      of any other Contributor, and only if You agree to indemnify,
    +      defend, and hold each Contributor harmless for any liability
    +      incurred by, or claims asserted against, such Contributor by reason
    +      of your accepting any such warranty or additional liability.
    +
    +   END OF TERMS AND CONDITIONS
    +
    +   Copyright 2019 Yoshua Wuyts
    +
    +   Licensed under the Apache License, Version 2.0 (the "License");
    +   you may not use this file except in compliance with the License.
    +   You may obtain a copy of the License at
    +
    +       http://www.apache.org/licenses/LICENSE-2.0
    +
    +   Unless required by applicable law or agreed to in writing, software
    +   distributed under the License is distributed on an "AS IS" BASIS,
    +   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +   See the License for the specific language governing permissions and
    +   limitations under the License.
    +
    +
  • +
  • +

    Apache License 2.0

    +

    Used by:

    + +
                                     Apache License
    +                           Version 2.0, January 2004
    +                        http://www.apache.org/licenses/
    +
    +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
    +
    +1.  Definitions.
    +
    +    "License" shall mean the terms and conditions for use, reproduction,
    +    and distribution as defined by Sections 1 through 9 of this document.
    +
    +    "Licensor" shall mean the copyright owner or entity authorized by
    +    the copyright owner that is granting the License.
    +
    +    "Legal Entity" shall mean the union of the acting entity and all
    +    other entities that control, are controlled by, or are under common
    +    control with that entity. For the purposes of this definition,
    +    "control" means (i) the power, direct or indirect, to cause the
    +    direction or management of such entity, whether by contract or
    +    otherwise, or (ii) ownership of fifty percent (50%) or more of the
    +    outstanding shares, or (iii) beneficial ownership of such entity.
    +
    +    "You" (or "Your") shall mean an individual or Legal Entity
    +    exercising permissions granted by this License.
    +
    +    "Source" form shall mean the preferred form for making modifications,
    +    including but not limited to software source code, documentation
    +    source, and configuration files.
    +
    +    "Object" form shall mean any form resulting from mechanical
    +    transformation or translation of a Source form, including but
    +    not limited to compiled object code, generated documentation,
    +    and conversions to other media types.
    +
    +    "Work" shall mean the work of authorship, whether in Source or
    +    Object form, made available under the License, as indicated by a
    +    copyright notice that is included in or attached to the work
    +    (an example is provided in the Appendix below).
    +
    +    "Derivative Works" shall mean any work, whether in Source or Object
    +    form, that is based on (or derived from) the Work and for which the
         editorial revisions, annotations, elaborations, or other modifications
         represent, as a whole, an original work of authorship. For the purposes
         of this License, Derivative Works shall not include works that remain
         separable from, or merely link (or bind by name) to the interfaces of,
         the Work and Derivative Works thereof.
     
    -    "Contribution" shall mean any work of authorship, including
    -    the original version of the Work and any modifications or additions
    -    to that Work or Derivative Works thereof, that is intentionally
    -    submitted to Licensor for inclusion in the Work by the copyright owner
    -    or by an individual or Legal Entity authorized to submit on behalf of
    -    the copyright owner. For the purposes of this definition, "submitted"
    -    means any form of electronic, verbal, or written communication sent
    -    to the Licensor or its representatives, including but not limited to
    -    communication on electronic mailing lists, source code control systems,
    -    and issue tracking systems that are managed by, or on behalf of, the
    -    Licensor for the purpose of discussing and improving the Work, but
    -    excluding communication that is conspicuously marked or otherwise
    -    designated in writing by the copyright owner as "Not a Contribution."
    +    "Contribution" shall mean any work of authorship, including
    +    the original version of the Work and any modifications or additions
    +    to that Work or Derivative Works thereof, that is intentionally
    +    submitted to Licensor for inclusion in the Work by the copyright owner
    +    or by an individual or Legal Entity authorized to submit on behalf of
    +    the copyright owner. For the purposes of this definition, "submitted"
    +    means any form of electronic, verbal, or written communication sent
    +    to the Licensor or its representatives, including but not limited to
    +    communication on electronic mailing lists, source code control systems,
    +    and issue tracking systems that are managed by, or on behalf of, the
    +    Licensor for the purpose of discussing and improving the Work, but
    +    excluding communication that is conspicuously marked or otherwise
    +    designated in writing by the copyright owner as "Not a Contribution."
    +
    +    "Contributor" shall mean Licensor and any individual or Legal Entity
    +    on behalf of whom a Contribution has been received by Licensor and
    +    subsequently incorporated within the Work.
    +
    +2.  Grant of Copyright License. Subject to the terms and conditions of
    +    this License, each Contributor hereby grants to You a perpetual,
    +    worldwide, non-exclusive, no-charge, royalty-free, irrevocable
    +    copyright license to reproduce, prepare Derivative Works of,
    +    publicly display, publicly perform, sublicense, and distribute the
    +    Work and such Derivative Works in Source or Object form.
    +
    +3.  Grant of Patent License. Subject to the terms and conditions of
    +    this License, each Contributor hereby grants to You a perpetual,
    +    worldwide, non-exclusive, no-charge, royalty-free, irrevocable
    +    (except as stated in this section) patent license to make, have made,
    +    use, offer to sell, sell, import, and otherwise transfer the Work,
    +    where such license applies only to those patent claims licensable
    +    by such Contributor that are necessarily infringed by their
    +    Contribution(s) alone or by combination of their Contribution(s)
    +    with the Work to which such Contribution(s) was submitted. If You
    +    institute patent litigation against any entity (including a
    +    cross-claim or counterclaim in a lawsuit) alleging that the Work
    +    or a Contribution incorporated within the Work constitutes direct
    +    or contributory patent infringement, then any patent licenses
    +    granted to You under this License for that Work shall terminate
    +    as of the date such litigation is filed.
    +
    +4.  Redistribution. You may reproduce and distribute copies of the
    +    Work or Derivative Works thereof in any medium, with or without
    +    modifications, and in Source or Object form, provided that You
    +    meet the following conditions:
    +
    +    (a) You must give any other recipients of the Work or
    +    Derivative Works a copy of this License; and
    +
    +    (b) You must cause any modified files to carry prominent notices
    +    stating that You changed the files; and
    +
    +    (c) You must retain, in the Source form of any Derivative Works
    +    that You distribute, all copyright, patent, trademark, and
    +    attribution notices from the Source form of the Work,
    +    excluding those notices that do not pertain to any part of
    +    the Derivative Works; and
    +
    +    (d) If the Work includes a "NOTICE" text file as part of its
    +    distribution, then any Derivative Works that You distribute must
    +    include a readable copy of the attribution notices contained
    +    within such NOTICE file, excluding those notices that do not
    +    pertain to any part of the Derivative Works, in at least one
    +    of the following places: within a NOTICE text file distributed
    +    as part of the Derivative Works; within the Source form or
    +    documentation, if provided along with the Derivative Works; or,
    +    within a display generated by the Derivative Works, if and
    +    wherever such third-party notices normally appear. The contents
    +    of the NOTICE file are for informational purposes only and
    +    do not modify the License. You may add Your own attribution
    +    notices within Derivative Works that You distribute, alongside
    +    or as an addendum to the NOTICE text from the Work, provided
    +    that such additional attribution notices cannot be construed
    +    as modifying the License.
    +
    +    You may add Your own copyright statement to Your modifications and
    +    may provide additional or different license terms and conditions
    +    for use, reproduction, or distribution of Your modifications, or
    +    for any such Derivative Works as a whole, provided Your use,
    +    reproduction, and distribution of the Work otherwise complies with
    +    the conditions stated in this License.
    +
    +5.  Submission of Contributions. Unless You explicitly state otherwise,
    +    any Contribution intentionally submitted for inclusion in the Work
    +    by You to the Licensor shall be under the terms and conditions of
    +    this License, without any additional terms or conditions.
    +    Notwithstanding the above, nothing herein shall supersede or modify
    +    the terms of any separate license agreement you may have executed
    +    with Licensor regarding such Contributions.
    +
    +6.  Trademarks. This License does not grant permission to use the trade
    +    names, trademarks, service marks, or product names of the Licensor,
    +    except as required for reasonable and customary use in describing the
    +    origin of the Work and reproducing the content of the NOTICE file.
    +
    +7.  Disclaimer of Warranty. Unless required by applicable law or
    +    agreed to in writing, Licensor provides the Work (and each
    +    Contributor provides its Contributions) on an "AS IS" BASIS,
    +    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
    +    implied, including, without limitation, any warranties or conditions
    +    of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
    +    PARTICULAR PURPOSE. You are solely responsible for determining the
    +    appropriateness of using or redistributing the Work and assume any
    +    risks associated with Your exercise of permissions under this License.
    +
    +8.  Limitation of Liability. In no event and under no legal theory,
    +    whether in tort (including negligence), contract, or otherwise,
    +    unless required by applicable law (such as deliberate and grossly
    +    negligent acts) or agreed to in writing, shall any Contributor be
    +    liable to You for damages, including any direct, indirect, special,
    +    incidental, or consequential damages of any character arising as a
    +    result of this License or out of the use or inability to use the
    +    Work (including but not limited to damages for loss of goodwill,
    +    work stoppage, computer failure or malfunction, or any and all
    +    other commercial damages or losses), even if such Contributor
    +    has been advised of the possibility of such damages.
    +
    +9.  Accepting Warranty or Additional Liability. While redistributing
    +    the Work or Derivative Works thereof, You may choose to offer,
    +    and charge a fee for, acceptance of support, warranty, indemnity,
    +    or other liability obligations and/or rights consistent with this
    +    License. However, in accepting such obligations, You may act only
    +    on Your own behalf and on Your sole responsibility, not on behalf
    +    of any other Contributor, and only if You agree to indemnify,
    +    defend, and hold each Contributor harmless for any liability
    +    incurred by, or claims asserted against, such Contributor by reason
    +    of your accepting any such warranty or additional liability.
    +
    +END OF TERMS AND CONDITIONS
    +
    +APPENDIX: How to apply the Apache License to your work.
    +
    +      To apply the Apache License to your work, attach the following
    +      boilerplate notice, with the fields enclosed by brackets "[]"
    +      replaced with your own identifying information. (Don't include
    +      the brackets!)  The text should be enclosed in the appropriate
    +      comment syntax for the file format. We also recommend that a
    +      file or class name and description of purpose be included on the
    +      same "printed page" as the copyright notice for easier
    +      identification within third-party archives.
    +
    +Copyright [yyyy] [name of copyright owner]
    +
    +Licensed under the Apache License, Version 2.0 (the "License");
    +you may not use this file except in compliance with the License.
    +You may obtain a copy of the License at
    +
    +       http://www.apache.org/licenses/LICENSE-2.0
    +
    +Unless required by applicable law or agreed to in writing, software
    +distributed under the License is distributed on an "AS IS" BASIS,
    +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +See the License for the specific language governing permissions and
    +limitations under the License.
    +
    +
  • +
  • +

    Apache License 2.0

    +

    Used by:

    + +
                                  Apache License
    +                        Version 2.0 January 2004
    +                     http://www.apache.org/licenses/
    +
    +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
    +
    +1. Definitions.
    +
    +   "License" shall mean the terms and conditions for use, reproduction,
    +   and distribution as defined by Sections 1 through 9 of this document.
    +
    +   "Licensor" shall mean the copyright owner or entity authorized by
    +   the copyright owner that is granting the License.
    +
    +   "Legal Entity" shall mean the union of the acting entity and all
    +   other entities that control, are controlled by, or are under common
    +   control with that entity. For the purposes of this definition,
    +   "control" means (i) the power, direct or indirect, to cause the
    +   direction or management of such entity, whether by contract or
    +   otherwise, or (ii) ownership of fifty percent (50%) or more of the
    +   outstanding shares, or (iii) beneficial ownership of such entity.
    +
    +   "You" (or "Your") shall mean an individual or Legal Entity
    +   exercising permissions granted by this License.
    +
    +   "Source" form shall mean the preferred form for making modifications,
    +   including but not limited to software source code, documentation
    +   source, and configuration files.
    +
    +   "Object" form shall mean any form resulting from mechanical
    +   transformation or translation of a Source form, including but
    +   not limited to compiled object code, generated documentation,
    +   and conversions to other media types.
    +
    +   "Work" shall mean the work of authorship, whether in Source or
    +   Object form, made available under the License, as indicated by a
    +   copyright notice that is included in or attached to the work
    +   (an example is provided in the Appendix below).
    +
    +   "Derivative Works" shall mean any work, whether in Source or Object
    +   form, that is based on (or derived from) the Work and for which the
    +   editorial revisions, annotations, elaborations, or other modifications
    +   represent, as a whole, an original work of authorship. For the purposes
    +   of this License, Derivative Works shall not include works that remain
    +   separable from, or merely link (or bind by name) to the interfaces of,
    +   the Work and Derivative Works thereof.
    +
    +   "Contribution" shall mean any work of authorship, including
    +   the original version of the Work and any modifications or additions
    +   to that Work or Derivative Works thereof, that is intentionally
    +   submitted to Licensor for inclusion in the Work by the copyright owner
    +   or by an individual or Legal Entity authorized to submit on behalf of
    +   the copyright owner. For the purposes of this definition, "submitted"
    +   means any form of electronic, verbal, or written communication sent
    +   to the Licensor or its representatives, including but not limited to
    +   communication on electronic mailing lists, source code control systems,
    +   and issue tracking systems that are managed by, or on behalf of, the
    +   Licensor for the purpose of discussing and improving the Work, but
    +   excluding communication that is conspicuously marked or otherwise
    +   designated in writing by the copyright owner as "Not a Contribution."
    +
    +   "Contributor" shall mean Licensor and any individual or Legal Entity
    +   on behalf of whom a Contribution has been received by Licensor and
    +   subsequently incorporated within the Work.
    +
    +2. Grant of Copyright License. Subject to the terms and conditions of
    +   this License, each Contributor hereby grants to You a perpetual,
    +   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
    +   copyright license to reproduce, prepare Derivative Works of,
    +   publicly display, publicly perform, sublicense, and distribute the
    +   Work and such Derivative Works in Source or Object form.
    +
    +3. Grant of Patent License. Subject to the terms and conditions of
    +   this License, each Contributor hereby grants to You a perpetual,
    +   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
    +   (except as stated in this section) patent license to make, have made,
    +   use, offer to sell, sell, import, and otherwise transfer the Work,
    +   where such license applies only to those patent claims licensable
    +   by such Contributor that are necessarily infringed by their
    +   Contribution(s) alone or by combination of their Contribution(s)
    +   with the Work to which such Contribution(s) was submitted. If You
    +   institute patent litigation against any entity (including a
    +   cross-claim or counterclaim in a lawsuit) alleging that the Work
    +   or a Contribution incorporated within the Work constitutes direct
    +   or contributory patent infringement, then any patent licenses
    +   granted to You under this License for that Work shall terminate
    +   as of the date such litigation is filed.
    +
    +4. Redistribution. You may reproduce and distribute copies of the
    +   Work or Derivative Works thereof in any medium, with or without
    +   modifications, and in Source or Object form, provided that You
    +   meet the following conditions:
    +
    +   (a) You must give any other recipients of the Work or
    +       Derivative Works a copy of this License; and
     
    -    "Contributor" shall mean Licensor and any individual or Legal Entity
    -    on behalf of whom a Contribution has been received by Licensor and
    -    subsequently incorporated within the Work.
    +   (b) You must cause any modified files to carry prominent notices
    +       stating that You changed the files; and
     
    -2.  Grant of Copyright License. Subject to the terms and conditions of
    -    this License, each Contributor hereby grants to You a perpetual,
    -    worldwide, non-exclusive, no-charge, royalty-free, irrevocable
    -    copyright license to reproduce, prepare Derivative Works of,
    -    publicly display, publicly perform, sublicense, and distribute the
    -    Work and such Derivative Works in Source or Object form.
    +   (c) You must retain, in the Source form of any Derivative Works
    +       that You distribute, all copyright, patent, trademark, and
    +       attribution notices from the Source form of the Work,
    +       excluding those notices that do not pertain to any part of
    +       the Derivative Works; and
     
    -3.  Grant of Patent License. Subject to the terms and conditions of
    -    this License, each Contributor hereby grants to You a perpetual,
    -    worldwide, non-exclusive, no-charge, royalty-free, irrevocable
    -    (except as stated in this section) patent license to make, have made,
    -    use, offer to sell, sell, import, and otherwise transfer the Work,
    -    where such license applies only to those patent claims licensable
    -    by such Contributor that are necessarily infringed by their
    -    Contribution(s) alone or by combination of their Contribution(s)
    -    with the Work to which such Contribution(s) was submitted. If You
    -    institute patent litigation against any entity (including a
    -    cross-claim or counterclaim in a lawsuit) alleging that the Work
    -    or a Contribution incorporated within the Work constitutes direct
    -    or contributory patent infringement, then any patent licenses
    -    granted to You under this License for that Work shall terminate
    -    as of the date such litigation is filed.
    +   (d) If the Work includes a "NOTICE" text file as part of its
    +       distribution, then any Derivative Works that You distribute must
    +       include a readable copy of the attribution notices contained
    +       within such NOTICE file, excluding those notices that do not
    +       pertain to any part of the Derivative Works, in at least one
    +       of the following places: within a NOTICE text file distributed
    +       as part of the Derivative Works; within the Source form or
    +       documentation, if provided along with the Derivative Works; or,
    +       within a display generated by the Derivative Works, if and
    +       wherever such third-party notices normally appear. The contents
    +       of the NOTICE file are for informational purposes only and
    +       do not modify the License. You may add Your own attribution
    +       notices within Derivative Works that You distribute, alongside
    +       or as an addendum to the NOTICE text from the Work, provided
    +       that such additional attribution notices cannot be construed
    +       as modifying the License.
     
    -4.  Redistribution. You may reproduce and distribute copies of the
    -    Work or Derivative Works thereof in any medium, with or without
    -    modifications, and in Source or Object form, provided that You
    -    meet the following conditions:
    +   You may add Your own copyright statement to Your modifications and
    +   may provide additional or different license terms and conditions
    +   for use, reproduction, or distribution of Your modifications, or
    +   for any such Derivative Works as a whole, provided Your use,
    +   reproduction, and distribution of the Work otherwise complies with
    +   the conditions stated in this License.
     
    -    (a) You must give any other recipients of the Work or
    -    Derivative Works a copy of this License; and
    +5. Submission of Contributions. Unless You explicitly state otherwise,
    +   any Contribution intentionally submitted for inclusion in the Work
    +   by You to the Licensor shall be under the terms and conditions of
    +   this License, without any additional terms or conditions.
    +   Notwithstanding the above, nothing herein shall supersede or modify
    +   the terms of any separate license agreement you may have executed
    +   with Licensor regarding such Contributions.
     
    -    (b) You must cause any modified files to carry prominent notices
    -    stating that You changed the files; and
    +6. Trademarks. This License does not grant permission to use the trade
    +   names, trademarks, service marks, or product names of the Licensor,
    +   except as required for reasonable and customary use in describing the
    +   origin of the Work and reproducing the content of the NOTICE file.
     
    -    (c) You must retain, in the Source form of any Derivative Works
    -    that You distribute, all copyright, patent, trademark, and
    -    attribution notices from the Source form of the Work,
    -    excluding those notices that do not pertain to any part of
    -    the Derivative Works; and
    +7. Disclaimer of Warranty. Unless required by applicable law or
    +   agreed to in writing, Licensor provides the Work (and each
    +   Contributor provides its Contributions) on an "AS IS" BASIS,
    +   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
    +   implied, including, without limitation, any warranties or conditions
    +   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
    +   PARTICULAR PURPOSE. You are solely responsible for determining the
    +   appropriateness of using or redistributing the Work and assume any
    +   risks associated with Your exercise of permissions under this License.
     
    -    (d) If the Work includes a "NOTICE" text file as part of its
    -    distribution, then any Derivative Works that You distribute must
    -    include a readable copy of the attribution notices contained
    -    within such NOTICE file, excluding those notices that do not
    -    pertain to any part of the Derivative Works, in at least one
    -    of the following places: within a NOTICE text file distributed
    -    as part of the Derivative Works; within the Source form or
    -    documentation, if provided along with the Derivative Works; or,
    -    within a display generated by the Derivative Works, if and
    -    wherever such third-party notices normally appear. The contents
    -    of the NOTICE file are for informational purposes only and
    -    do not modify the License. You may add Your own attribution
    -    notices within Derivative Works that You distribute, alongside
    -    or as an addendum to the NOTICE text from the Work, provided
    -    that such additional attribution notices cannot be construed
    -    as modifying the License.
    +8. Limitation of Liability. In no event and under no legal theory,
    +   whether in tort (including negligence), contract, or otherwise,
    +   unless required by applicable law (such as deliberate and grossly
    +   negligent acts) or agreed to in writing, shall any Contributor be
    +   liable to You for damages, including any direct, indirect, special,
    +   incidental, or consequential damages of any character arising as a
    +   result of this License or out of the use or inability to use the
    +   Work (including but not limited to damages for loss of goodwill,
    +   work stoppage, computer failure or malfunction, or any and all
    +   other commercial damages or losses), even if such Contributor
    +   has been advised of the possibility of such damages.
     
    -    You may add Your own copyright statement to Your modifications and
    -    may provide additional or different license terms and conditions
    -    for use, reproduction, or distribution of Your modifications, or
    -    for any such Derivative Works as a whole, provided Your use,
    -    reproduction, and distribution of the Work otherwise complies with
    -    the conditions stated in this License.
    +9. Accepting Warranty or Additional Liability. While redistributing
    +   the Work or Derivative Works thereof, You may choose to offer,
    +   and charge a fee for, acceptance of support, warranty, indemnity,
    +   or other liability obligations and/or rights consistent with this
    +   License. However, in accepting such obligations, You may act only
    +   on Your own behalf and on Your sole responsibility, not on behalf
    +   of any other Contributor, and only if You agree to indemnify,
    +   defend, and hold each Contributor harmless for any liability
    +   incurred by, or claims asserted against, such Contributor by reason
    +   of your accepting any such warranty or additional liability.
     
    -5.  Submission of Contributions. Unless You explicitly state otherwise,
    -    any Contribution intentionally submitted for inclusion in the Work
    -    by You to the Licensor shall be under the terms and conditions of
    -    this License, without any additional terms or conditions.
    -    Notwithstanding the above, nothing herein shall supersede or modify
    -    the terms of any separate license agreement you may have executed
    -    with Licensor regarding such Contributions.
    +END OF TERMS AND CONDITIONS
    +
    +APPENDIX: How to apply the Apache License to your work.
    +
    +   To apply the Apache License to your work, attach the following
    +   boilerplate notice, with the fields enclosed by brackets "[]"
    +   replaced with your own identifying information. (Don't include
    +   the brackets!)  The text should be enclosed in the appropriate
    +   comment syntax for the file format. We also recommend that a
    +   file or class name and description of purpose be included on the
    +   same "printed page" as the copyright notice for easier
    +   identification within third-party archives.
    +
    +Copyright [yyyy] [name of copyright owner]
    +
    +Licensed under the Apache License, Version 2.0 (the "License");
    +you may not use this file except in compliance with the License.
    +You may obtain a copy of the License at
    +
    +	http://www.apache.org/licenses/LICENSE-2.0
    +
    +Unless required by applicable law or agreed to in writing, software
    +distributed under the License is distributed on an "AS IS" BASIS,
    +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +See the License for the specific language governing permissions and
    +limitations under the License.
    +
    +
  • +
  • +

    Apache License 2.0

    +

    Used by:

    + +
                                  Apache License
    +                        Version 2.0, January 2004
    +                     http://www.apache.org/licenses/
    +
    +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
    +
    +1. Definitions.
    +
    +   "License" shall mean the terms and conditions for use, reproduction,
    +   and distribution as defined by Sections 1 through 9 of this document.
    +
    +   "Licensor" shall mean the copyright owner or entity authorized by
    +   the copyright owner that is granting the License.
    +
    +   "Legal Entity" shall mean the union of the acting entity and all
    +   other entities that control, are controlled by, or are under common
    +   control with that entity. For the purposes of this definition,
    +   "control" means (i) the power, direct or indirect, to cause the
    +   direction or management of such entity, whether by contract or
    +   otherwise, or (ii) ownership of fifty percent (50%) or more of the
    +   outstanding shares, or (iii) beneficial ownership of such entity.
    +
    +   "You" (or "Your") shall mean an individual or Legal Entity
    +   exercising permissions granted by this License.
    +
    +   "Source" form shall mean the preferred form for making modifications,
    +   including but not limited to software source code, documentation
    +   source, and configuration files.
    +
    +   "Object" form shall mean any form resulting from mechanical
    +   transformation or translation of a Source form, including but
    +   not limited to compiled object code, generated documentation,
    +   and conversions to other media types.
    +
    +   "Work" shall mean the work of authorship, whether in Source or
    +   Object form, made available under the License, as indicated by a
    +   copyright notice that is included in or attached to the work
    +   (an example is provided in the Appendix below).
    +
    +   "Derivative Works" shall mean any work, whether in Source or Object
    +   form, that is based on (or derived from) the Work and for which the
    +   editorial revisions, annotations, elaborations, or other modifications
    +   represent, as a whole, an original work of authorship. For the purposes
    +   of this License, Derivative Works shall not include works that remain
    +   separable from, or merely link (or bind by name) to the interfaces of,
    +   the Work and Derivative Works thereof.
    +
    +   "Contribution" shall mean any work of authorship, including
    +   the original version of the Work and any modifications or additions
    +   to that Work or Derivative Works thereof, that is intentionally
    +   submitted to Licensor for inclusion in the Work by the copyright owner
    +   or by an individual or Legal Entity authorized to submit on behalf of
    +   the copyright owner. For the purposes of this definition, "submitted"
    +   means any form of electronic, verbal, or written communication sent
    +   to the Licensor or its representatives, including but not limited to
    +   communication on electronic mailing lists, source code control systems,
    +   and issue tracking systems that are managed by, or on behalf of, the
    +   Licensor for the purpose of discussing and improving the Work, but
    +   excluding communication that is conspicuously marked or otherwise
    +   designated in writing by the copyright owner as "Not a Contribution."
    +
    +   "Contributor" shall mean Licensor and any individual or Legal Entity
    +   on behalf of whom a Contribution has been received by Licensor and
    +   subsequently incorporated within the Work.
    +
    +2. Grant of Copyright License. Subject to the terms and conditions of
    +   this License, each Contributor hereby grants to You a perpetual,
    +   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
    +   copyright license to reproduce, prepare Derivative Works of,
    +   publicly display, publicly perform, sublicense, and distribute the
    +   Work and such Derivative Works in Source or Object form.
     
    -6.  Trademarks. This License does not grant permission to use the trade
    -    names, trademarks, service marks, or product names of the Licensor,
    -    except as required for reasonable and customary use in describing the
    -    origin of the Work and reproducing the content of the NOTICE file.
    +3. Grant of Patent License. Subject to the terms and conditions of
    +   this License, each Contributor hereby grants to You a perpetual,
    +   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
    +   (except as stated in this section) patent license to make, have made,
    +   use, offer to sell, sell, import, and otherwise transfer the Work,
    +   where such license applies only to those patent claims licensable
    +   by such Contributor that are necessarily infringed by their
    +   Contribution(s) alone or by combination of their Contribution(s)
    +   with the Work to which such Contribution(s) was submitted. If You
    +   institute patent litigation against any entity (including a
    +   cross-claim or counterclaim in a lawsuit) alleging that the Work
    +   or a Contribution incorporated within the Work constitutes direct
    +   or contributory patent infringement, then any patent licenses
    +   granted to You under this License for that Work shall terminate
    +   as of the date such litigation is filed.
     
    -7.  Disclaimer of Warranty. Unless required by applicable law or
    -    agreed to in writing, Licensor provides the Work (and each
    -    Contributor provides its Contributions) on an "AS IS" BASIS,
    -    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
    -    implied, including, without limitation, any warranties or conditions
    -    of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
    -    PARTICULAR PURPOSE. You are solely responsible for determining the
    -    appropriateness of using or redistributing the Work and assume any
    -    risks associated with Your exercise of permissions under this License.
    +4. Redistribution. You may reproduce and distribute copies of the
    +   Work or Derivative Works thereof in any medium, with or without
    +   modifications, and in Source or Object form, provided that You
    +   meet the following conditions:
     
    -8.  Limitation of Liability. In no event and under no legal theory,
    -    whether in tort (including negligence), contract, or otherwise,
    -    unless required by applicable law (such as deliberate and grossly
    -    negligent acts) or agreed to in writing, shall any Contributor be
    -    liable to You for damages, including any direct, indirect, special,
    -    incidental, or consequential damages of any character arising as a
    -    result of this License or out of the use or inability to use the
    -    Work (including but not limited to damages for loss of goodwill,
    -    work stoppage, computer failure or malfunction, or any and all
    -    other commercial damages or losses), even if such Contributor
    -    has been advised of the possibility of such damages.
    +   (a) You must give any other recipients of the Work or
    +       Derivative Works a copy of this License; and
     
    -9.  Accepting Warranty or Additional Liability. While redistributing
    -    the Work or Derivative Works thereof, You may choose to offer,
    -    and charge a fee for, acceptance of support, warranty, indemnity,
    -    or other liability obligations and/or rights consistent with this
    -    License. However, in accepting such obligations, You may act only
    -    on Your own behalf and on Your sole responsibility, not on behalf
    -    of any other Contributor, and only if You agree to indemnify,
    -    defend, and hold each Contributor harmless for any liability
    -    incurred by, or claims asserted against, such Contributor by reason
    -    of your accepting any such warranty or additional liability.
    +   (b) You must cause any modified files to carry prominent notices
    +       stating that You changed the files; and
     
    -END OF TERMS AND CONDITIONS
    +   (c) You must retain, in the Source form of any Derivative Works
    +       that You distribute, all copyright, patent, trademark, and
    +       attribution notices from the Source form of the Work,
    +       excluding those notices that do not pertain to any part of
    +       the Derivative Works; and
     
    -APPENDIX: How to apply the Apache License to your work.
    +   (d) If the Work includes a "NOTICE" text file as part of its
    +       distribution, then any Derivative Works that You distribute must
    +       include a readable copy of the attribution notices contained
    +       within such NOTICE file, excluding those notices that do not
    +       pertain to any part of the Derivative Works, in at least one
    +       of the following places: within a NOTICE text file distributed
    +       as part of the Derivative Works; within the Source form or
    +       documentation, if provided along with the Derivative Works; or,
    +       within a display generated by the Derivative Works, if and
    +       wherever such third-party notices normally appear. The contents
    +       of the NOTICE file are for informational purposes only and
    +       do not modify the License. You may add Your own attribution
    +       notices within Derivative Works that You distribute, alongside
    +       or as an addendum to the NOTICE text from the Work, provided
    +       that such additional attribution notices cannot be construed
    +       as modifying the License.
     
    -      To apply the Apache License to your work, attach the following
    -      boilerplate notice, with the fields enclosed by brackets "[]"
    -      replaced with your own identifying information. (Don't include
    -      the brackets!)  The text should be enclosed in the appropriate
    -      comment syntax for the file format. We also recommend that a
    -      file or class name and description of purpose be included on the
    -      same "printed page" as the copyright notice for easier
    -      identification within third-party archives.
    +   You may add Your own copyright statement to Your modifications and
    +   may provide additional or different license terms and conditions
    +   for use, reproduction, or distribution of Your modifications, or
    +   for any such Derivative Works as a whole, provided Your use,
    +   reproduction, and distribution of the Work otherwise complies with
    +   the conditions stated in this License.
     
    -Copyright [yyyy] [name of copyright owner]
    +5. Submission of Contributions. Unless You explicitly state otherwise,
    +   any Contribution intentionally submitted for inclusion in the Work
    +   by You to the Licensor shall be under the terms and conditions of
    +   this License, without any additional terms or conditions.
    +   Notwithstanding the above, nothing herein shall supersede or modify
    +   the terms of any separate license agreement you may have executed
    +   with Licensor regarding such Contributions.
     
    -Licensed under the Apache License, Version 2.0 (the "License");
    -you may not use this file except in compliance with the License.
    -You may obtain a copy of the License at
    +6. Trademarks. This License does not grant permission to use the trade
    +   names, trademarks, service marks, or product names of the Licensor,
    +   except as required for reasonable and customary use in describing the
    +   origin of the Work and reproducing the content of the NOTICE file.
     
    -       http://www.apache.org/licenses/LICENSE-2.0
    +7. Disclaimer of Warranty. Unless required by applicable law or
    +   agreed to in writing, Licensor provides the Work (and each
    +   Contributor provides its Contributions) on an "AS IS" BASIS,
    +   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
    +   implied, including, without limitation, any warranties or conditions
    +   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
    +   PARTICULAR PURPOSE. You are solely responsible for determining the
    +   appropriateness of using or redistributing the Work and assume any
    +   risks associated with Your exercise of permissions under this License.
     
    -Unless required by applicable law or agreed to in writing, software
    -distributed under the License is distributed on an "AS IS" BASIS,
    -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    -See the License for the specific language governing permissions and
    -limitations under the License.
    +8. Limitation of Liability. In no event and under no legal theory,
    +   whether in tort (including negligence), contract, or otherwise,
    +   unless required by applicable law (such as deliberate and grossly
    +   negligent acts) or agreed to in writing, shall any Contributor be
    +   liable to You for damages, including any direct, indirect, special,
    +   incidental, or consequential damages of any character arising as a
    +   result of this License or out of the use or inability to use the
    +   Work (including but not limited to damages for loss of goodwill,
    +   work stoppage, computer failure or malfunction, or any and all
    +   other commercial damages or losses), even if such Contributor
    +   has been advised of the possibility of such damages.
    +
    +9. Accepting Warranty or Additional Liability. While redistributing
    +   the Work or Derivative Works thereof, You may choose to offer,
    +   and charge a fee for, acceptance of support, warranty, indemnity,
    +   or other liability obligations and/or rights consistent with this
    +   License. However, in accepting such obligations, You may act only
    +   on Your own behalf and on Your sole responsibility, not on behalf
    +   of any other Contributor, and only if You agree to indemnify,
    +   defend, and hold each Contributor harmless for any liability
    +   incurred by, or claims asserted against, such Contributor by reason
    +   of your accepting any such warranty or additional liability.
     
  • Apache License 2.0

    Used by:

                                  Apache License
    -                        Version 2.0 January 2004
    +                        Version 2.0, January 2004
                          http://www.apache.org/licenses/
     
     TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
    @@ -4840,39 +5509,21 @@ 

    Used by:

    of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License.
  • Apache License 2.0

    Used by:

                                  Apache License
                             Version 2.0, January 2004
    @@ -5048,33 +5699,41 @@ 

    Used by:

    defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright (c) 2016 Alex Crichton +Copyright (c) 2017 The Tokio Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License.
  • Apache License 2.0

    Used by:

                                  Apache License
                             Version 2.0, January 2004
    @@ -5252,21 +5911,37 @@ 

    Used by:

    of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS -
    + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright 2014 Paho Lurie-Gregg + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License.
  • Apache License 2.0

    Used by:

                                  Apache License
                             Version 2.0, January 2004
    @@ -5456,8 +6131,7 @@ 

    Used by:

    same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright (c) 2016 Alex Crichton -Copyright (c) 2017 The Tokio Authors +Copyright 2017 Ryan Leckey Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -5469,14 +6143,13 @@

    Used by:

    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and -limitations under the License. -
    +limitations under the License.
  • Apache License 2.0

    Used by:

                                  Apache License
                             Version 2.0, January 2004
    @@ -5666,7 +6339,7 @@ 

    Used by:

    same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2014 Paho Lurie-Gregg +Copyright 2017 Sergio Benitez Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -5678,13 +6351,14 @@

    Used by:

    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and -limitations under the License.
    +limitations under the License. +
  • Apache License 2.0

    Used by:

                                  Apache License
                             Version 2.0, January 2004
    @@ -5874,7 +6548,8 @@ 

    Used by:

    same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2017 Ryan Leckey +Copyright 2017 Sergio Benitez +Copyright 2014 Alex Chricton Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -5886,13 +6561,14 @@

    Used by:

    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and -limitations under the License.
    +limitations under the License. +
  • Apache License 2.0

    Used by:

                                  Apache License
                             Version 2.0, January 2004
    @@ -6082,9 +6758,8 @@ 

    Used by:

    same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2017 Sergio Benitez -Copyright 2014 Alex Chricton - +Copyright 2017 The Rust Project Developers + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -6102,7 +6777,7 @@

    Used by:

    Apache License 2.0

    Used by:

                                  Apache License
                             Version 2.0, January 2004
    @@ -6292,7 +6967,7 @@ 

    Used by:

    same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2017 The Rust Project Developers +Copyright 2017 http-rs authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -6311,7 +6986,7 @@

    Used by:

    Apache License 2.0

    Used by:

                                  Apache License
                             Version 2.0, January 2004
    @@ -6501,7 +7176,7 @@ 

    Used by:

    same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2017 http-rs authors +Copyright 2018 The pin-utils authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -6520,7 +7195,7 @@

    Used by:

    Apache License 2.0

    Used by:

                                  Apache License
                             Version 2.0, January 2004
    @@ -6710,7 +7385,7 @@ 

    Used by:

    same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2018 The pin-utils authors +Copyright 2019 Rust-iendo Barcelona Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -6729,7 +7404,7 @@

    Used by:

    Apache License 2.0

    Used by:

                                  Apache License
                             Version 2.0, January 2004
    @@ -6919,13 +7594,13 @@ 

    Used by:

    same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2019 Rust-iendo Barcelona +Copyright 2019 The CryptoCorrosion Contributors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -6938,7 +7613,7 @@

    Used by:

    Apache License 2.0

    Used by:

                                  Apache License
                             Version 2.0, January 2004
    @@ -7128,13 +7803,13 @@ 

    Used by:

    same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2019 The CryptoCorrosion Contributors +Copyright 2019 quininer kel Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -7147,8 +7822,8 @@

    Used by:

    Apache License 2.0

    Used by:

                                  Apache License
                             Version 2.0, January 2004
    @@ -7358,6 +8033,7 @@ 

    Apache License 2.0

    Used by:

                                  Apache License
                             Version 2.0, January 2004
    @@ -7774,115 +8450,123 @@ 

    Used by:

    Apache License 2.0

    Used by:

                                  Apache License
                             Version 2.0, January 2004
    @@ -8303,22 +8987,22 @@ 

    Used by:

    Apache License 2.0

    Used by:

                                  Apache License
                             Version 2.0, January 2004
    @@ -8528,6 +9212,8 @@ 

    Apache License 2.0

    Used by:

                                  Apache License
                             Version 2.0, January 2004
    @@ -8712,6 +9398,7 @@ 

    Apache License 2.0

    Used by:

                                  Apache License
                             Version 2.0, January 2004
    @@ -8906,7 +9593,8 @@ 

    Used by:

    Apache License 2.0

    Used by:

                                  Apache License
    @@ -9116,7 +9804,7 @@ 

    Used by:

    Apache License 2.0

    Used by:

                                  Apache License
                             Version 2.0, January 2004
    @@ -9325,7 +10013,6 @@ 

    Used by:

    Apache License 2.0

    Used by:

                                  Apache License
    @@ -10176,7 +10863,7 @@ 

    Used by:

    Apache License 2.0

    Used by:

    Apache License
     Version 2.0, January 2004
    @@ -10385,19 +11072,21 @@ 

    Used by:

    Apache License 2.0

    Used by:

    Apache License
     Version 2.0, January 2004
    @@ -10423,399 +11112,41 @@ 

    Used by:

    "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. -"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: - - (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. - - You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - -To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -
    -
  • -
  • -

    Apache License 2.0

    -

    Used by:

    - -
    Copyright 2016 Nicolas Silva
    -
    -Licensed under the Apache License, Version 2.0 (the "License");
    -you may not use this file except in compliance with the License.
    -You may obtain a copy of the License at
    -
    -    http://www.apache.org/licenses/LICENSE-2.0
    -
    -Unless required by applicable law or agreed to in writing, software
    -distributed under the License is distributed on an "AS IS" BASIS,
    -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    -See the License for the specific language governing permissions and
    -limitations under the License.
    -
    -
  • -
  • -

    Apache License 2.0

    -

    Used by:

    - -
    Licensed under the Apache License, Version 2.0
    -<LICENSE-APACHE or
    -http://www.apache.org/licenses/LICENSE-2.0> or the MIT
    -license <LICENSE-MIT or http://opensource.org/licenses/MIT>,
    -at your option. All files in the project carrying such
    -notice may not be copied, modified, or distributed except
    -according to those terms.
    -
    -
  • -
  • -

    Apache License 2.0

    -

    Used by:

    - -
    MIT OR Apache-2.0
    -
  • -
  • -

    Apache License 2.0

    -

    Used by:

    - -
    MIT OR Apache-2.0
    -
    -
  • -
  • -

    Apache License 2.0

    -

    Used by:

    - -
    MIT or Apache-2.0
    -
    -
  • -
  • -

    Apache License 2.0

    -

    Used by:

    - -
    Minimal-lexical is dual licensed under the Apache 2.0 license as well as the MIT
    -license. See the LICENCE-MIT and the LICENCE-APACHE files for the licenses.
    -
    ----
    -
    -`src/bellerophon.rs` is loosely based off the Golang implementation,
    -found [here](https://github.com/golang/go/blob/b10849fbb97a2244c086991b4623ae9f32c212d0/src/strconv/extfloat.go).
    -That code (used if the `compact` feature is enabled) is subject to a
    -[3-clause BSD license](https://github.com/golang/go/blob/b10849fbb97a2244c086991b4623ae9f32c212d0/LICENSE):
    -
    -Copyright (c) 2009 The Go Authors. All rights reserved.
    -
    -Redistribution and use in source and binary forms, with or without
    -modification, are permitted provided that the following conditions are
    -met:
    -
    -   * Redistributions of source code must retain the above copyright
    -notice, this list of conditions and the following disclaimer.
    -   * Redistributions in binary form must reproduce the above
    -copyright notice, this list of conditions and the following disclaimer
    -in the documentation and/or other materials provided with the
    -distribution.
    -   * Neither the name of Google Inc. nor the names of its
    -contributors may be used to endorse or promote products derived from
    -this software without specific prior written permission.
    -
    -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    -
    -
  • -
  • -

    Apache License 2.0

    -

    Used by:

    - -
    Rust-chrono is dual-licensed under The MIT License [1] and
    -Apache 2.0 License [2]. Copyright (c) 2014--2017, Kang Seonghoon and
    -contributors.
    -
    -Nota Bene: This is same as the Rust Project's own license.
    -
    -
    -[1]: <http://opensource.org/licenses/MIT>, which is reproduced below:
    -
    -~~~~
    -The MIT License (MIT)
    -
    -Copyright (c) 2014, Kang Seonghoon.
    -
    -Permission is hereby granted, free of charge, to any person obtaining a copy
    -of this software and associated documentation files (the "Software"), to deal
    -in the Software without restriction, including without limitation the rights
    -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    -copies of the Software, and to permit persons to whom the Software is
    -furnished to do so, subject to the following conditions:
    -
    -The above copyright notice and this permission notice shall be included in
    -all copies or substantial portions of the Software.
    -
    -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    -THE SOFTWARE.
    -~~~~
    -
    -
    -[2]: <http://www.apache.org/licenses/LICENSE-2.0>, which is reproduced below:
    -
    -~~~~
    -                              Apache License
    -                        Version 2.0, January 2004
    -                     http://www.apache.org/licenses/
    -
    -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
    -
    -1. Definitions.
    -
    -   "License" shall mean the terms and conditions for use, reproduction,
    -   and distribution as defined by Sections 1 through 9 of this document.
    -
    -   "Licensor" shall mean the copyright owner or entity authorized by
    -   the copyright owner that is granting the License.
    -
    -   "Legal Entity" shall mean the union of the acting entity and all
    -   other entities that control, are controlled by, or are under common
    -   control with that entity. For the purposes of this definition,
    -   "control" means (i) the power, direct or indirect, to cause the
    -   direction or management of such entity, whether by contract or
    -   otherwise, or (ii) ownership of fifty percent (50%) or more of the
    -   outstanding shares, or (iii) beneficial ownership of such entity.
    -
    -   "You" (or "Your") shall mean an individual or Legal Entity
    -   exercising permissions granted by this License.
    -
    -   "Source" form shall mean the preferred form for making modifications,
    -   including but not limited to software source code, documentation
    -   source, and configuration files.
    -
    -   "Object" form shall mean any form resulting from mechanical
    -   transformation or translation of a Source form, including but
    -   not limited to compiled object code, generated documentation,
    -   and conversions to other media types.
    -
    -   "Work" shall mean the work of authorship, whether in Source or
    -   Object form, made available under the License, as indicated by a
    -   copyright notice that is included in or attached to the work
    -   (an example is provided in the Appendix below).
    -
    -   "Derivative Works" shall mean any work, whether in Source or Object
    -   form, that is based on (or derived from) the Work and for which the
    -   editorial revisions, annotations, elaborations, or other modifications
    -   represent, as a whole, an original work of authorship. For the purposes
    -   of this License, Derivative Works shall not include works that remain
    -   separable from, or merely link (or bind by name) to the interfaces of,
    -   the Work and Derivative Works thereof.
    -
    -   "Contribution" shall mean any work of authorship, including
    -   the original version of the Work and any modifications or additions
    -   to that Work or Derivative Works thereof, that is intentionally
    -   submitted to Licensor for inclusion in the Work by the copyright owner
    -   or by an individual or Legal Entity authorized to submit on behalf of
    -   the copyright owner. For the purposes of this definition, "submitted"
    -   means any form of electronic, verbal, or written communication sent
    -   to the Licensor or its representatives, including but not limited to
    -   communication on electronic mailing lists, source code control systems,
    -   and issue tracking systems that are managed by, or on behalf of, the
    -   Licensor for the purpose of discussing and improving the Work, but
    -   excluding communication that is conspicuously marked or otherwise
    -   designated in writing by the copyright owner as "Not a Contribution."
    -
    -   "Contributor" shall mean Licensor and any individual or Legal Entity
    -   on behalf of whom a Contribution has been received by Licensor and
    -   subsequently incorporated within the Work.
    +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
     
    -2. Grant of Copyright License. Subject to the terms and conditions of
    -   this License, each Contributor hereby grants to You a perpetual,
    -   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
    -   copyright license to reproduce, prepare Derivative Works of,
    -   publicly display, publicly perform, sublicense, and distribute the
    -   Work and such Derivative Works in Source or Object form.
    +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
     
    -3. Grant of Patent License. Subject to the terms and conditions of
    -   this License, each Contributor hereby grants to You a perpetual,
    -   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
    -   (except as stated in this section) patent license to make, have made,
    -   use, offer to sell, sell, import, and otherwise transfer the Work,
    -   where such license applies only to those patent claims licensable
    -   by such Contributor that are necessarily infringed by their
    -   Contribution(s) alone or by combination of their Contribution(s)
    -   with the Work to which such Contribution(s) was submitted. If You
    -   institute patent litigation against any entity (including a
    -   cross-claim or counterclaim in a lawsuit) alleging that the Work
    -   or a Contribution incorporated within the Work constitutes direct
    -   or contributory patent infringement, then any patent licenses
    -   granted to You under this License for that Work shall terminate
    -   as of the date such litigation is filed.
    +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
     
    -4. Redistribution. You may reproduce and distribute copies of the
    -   Work or Derivative Works thereof in any medium, with or without
    -   modifications, and in Source or Object form, provided that You
    -   meet the following conditions:
    +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
     
    -   (a) You must give any other recipients of the Work or
    -       Derivative Works a copy of this License; and
    +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
     
    -   (b) You must cause any modified files to carry prominent notices
    -       stating that You changed the files; and
    +     (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
     
    -   (c) You must retain, in the Source form of any Derivative Works
    -       that You distribute, all copyright, patent, trademark, and
    -       attribution notices from the Source form of the Work,
    -       excluding those notices that do not pertain to any part of
    -       the Derivative Works; and
    +     (b) You must cause any modified files to carry prominent notices stating that You changed the files; and
     
    -   (d) If the Work includes a "NOTICE" text file as part of its
    -       distribution, then any Derivative Works that You distribute must
    -       include a readable copy of the attribution notices contained
    -       within such NOTICE file, excluding those notices that do not
    -       pertain to any part of the Derivative Works, in at least one
    -       of the following places: within a NOTICE text file distributed
    -       as part of the Derivative Works; within the Source form or
    -       documentation, if provided along with the Derivative Works; or,
    -       within a display generated by the Derivative Works, if and
    -       wherever such third-party notices normally appear. The contents
    -       of the NOTICE file are for informational purposes only and
    -       do not modify the License. You may add Your own attribution
    -       notices within Derivative Works that You distribute, alongside
    -       or as an addendum to the NOTICE text from the Work, provided
    -       that such additional attribution notices cannot be construed
    -       as modifying the License.
    +     (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
     
    -   You may add Your own copyright statement to Your modifications and
    -   may provide additional or different license terms and conditions
    -   for use, reproduction, or distribution of Your modifications, or
    -   for any such Derivative Works as a whole, provided Your use,
    -   reproduction, and distribution of the Work otherwise complies with
    -   the conditions stated in this License.
    +     (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
     
    -5. Submission of Contributions. Unless You explicitly state otherwise,
    -   any Contribution intentionally submitted for inclusion in the Work
    -   by You to the Licensor shall be under the terms and conditions of
    -   this License, without any additional terms or conditions.
    -   Notwithstanding the above, nothing herein shall supersede or modify
    -   the terms of any separate license agreement you may have executed
    -   with Licensor regarding such Contributions.
    +     You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
     
    -6. Trademarks. This License does not grant permission to use the trade
    -   names, trademarks, service marks, or product names of the Licensor,
    -   except as required for reasonable and customary use in describing the
    -   origin of the Work and reproducing the content of the NOTICE file.
    +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
     
    -7. Disclaimer of Warranty. Unless required by applicable law or
    -   agreed to in writing, Licensor provides the Work (and each
    -   Contributor provides its Contributions) on an "AS IS" BASIS,
    -   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
    -   implied, including, without limitation, any warranties or conditions
    -   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
    -   PARTICULAR PURPOSE. You are solely responsible for determining the
    -   appropriateness of using or redistributing the Work and assume any
    -   risks associated with Your exercise of permissions under this License.
    +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
     
    -8. Limitation of Liability. In no event and under no legal theory,
    -   whether in tort (including negligence), contract, or otherwise,
    -   unless required by applicable law (such as deliberate and grossly
    -   negligent acts) or agreed to in writing, shall any Contributor be
    -   liable to You for damages, including any direct, indirect, special,
    -   incidental, or consequential damages of any character arising as a
    -   result of this License or out of the use or inability to use the
    -   Work (including but not limited to damages for loss of goodwill,
    -   work stoppage, computer failure or malfunction, or any and all
    -   other commercial damages or losses), even if such Contributor
    -   has been advised of the possibility of such damages.
    +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
     
    -9. Accepting Warranty or Additional Liability. While redistributing
    -   the Work or Derivative Works thereof, You may choose to offer,
    -   and charge a fee for, acceptance of support, warranty, indemnity,
    -   or other liability obligations and/or rights consistent with this
    -   License. However, in accepting such obligations, You may act only
    -   on Your own behalf and on Your sole responsibility, not on behalf
    -   of any other Contributor, and only if You agree to indemnify,
    -   defend, and hold each Contributor harmless for any liability
    -   incurred by, or claims asserted against, such Contributor by reason
    -   of your accepting any such warranty or additional liability.
    +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
    +
    +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
     
     END OF TERMS AND CONDITIONS
     
     APPENDIX: How to apply the Apache License to your work.
     
    -   To apply the Apache License to your work, attach the following
    -   boilerplate notice, with the fields enclosed by brackets "[]"
    -   replaced with your own identifying information. (Don't include
    -   the brackets!)  The text should be enclosed in the appropriate
    -   comment syntax for the file format. We also recommend that a
    -   file or class name and description of purpose be included on the
    -   same "printed page" as the copyright notice for easier
    -   identification within third-party archives.
    +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!)  The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
     
     Copyright [yyyy] [name of copyright owner]
     
    @@ -10823,15 +11154,100 @@ 

    Used by:

    you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +
    +
  • +
  • +

    Apache License 2.0

    +

    Used by:

    + +
    Copyright 2015 Nicholas Allegra (comex).
    +
    +Licensed under the Apache License, Version 2.0 (the "License");
    +you may not use this file except in compliance with the License.
    +You may obtain a copy of the License at
    +
    +    http://www.apache.org/licenses/LICENSE-2.0
     
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
    -~~~~
    +
    +
  • +
  • +

    Apache License 2.0

    +

    Used by:

    + +
    Copyright 2016 Nicolas Silva
    +
    +Licensed under the Apache License, Version 2.0 (the "License");
    +you may not use this file except in compliance with the License.
    +You may obtain a copy of the License at
    +
    +    http://www.apache.org/licenses/LICENSE-2.0
     
    +Unless required by applicable law or agreed to in writing, software
    +distributed under the License is distributed on an "AS IS" BASIS,
    +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +See the License for the specific language governing permissions and
    +limitations under the License.
    +
    +
  • +
  • +

    Apache License 2.0

    +

    Used by:

    + +
    Licensed under the Apache License, Version 2.0
    +<LICENSE-APACHE or
    +http://www.apache.org/licenses/LICENSE-2.0> or the MIT
    +license <LICENSE-MIT or http://opensource.org/licenses/MIT>,
    +at your option. All files in the project carrying such
    +notice may not be copied, modified, or distributed except
    +according to those terms.
    +
    +
  • +
  • +

    Apache License 2.0

    +

    Used by:

    + +
    MIT OR Apache-2.0
    +
  • +
  • +

    Apache License 2.0

    +

    Used by:

    + +
    MIT OR Apache-2.0
    +
    +
  • +
  • +

    Apache License 2.0

    +

    Used by:

    + +
    MIT or Apache-2.0
     
  • @@ -10875,7 +11291,7 @@

    Used by:

    BSD 3-Clause "New" or "Revised" License

    Used by:

    Copyright (c) 2015, Amit Chowdhury
     Copyright (c) 2018-2021, Kornel Lesinski
    @@ -10929,9 +11345,10 @@ 

    Used by:

    BSD 3-Clause "New" or "Revised" License

    Used by:

    Copyright (c) 2016-2017 Isis Agora Lovecruft, Henry de Valence. All rights reserved.
    +Copyright (c) 2016-2024 Isis Agora Lovecruft. All rights reserved.
     
     Redistribution and use in source and binary forms, with or without
     modification, are permitted provided that the following conditions are
    @@ -11000,6 +11417,7 @@ 

    BSD 3-Clause "New" or "Revised" Licens

    Used by:

    Copyright (c) <year> <owner>. 
    @@ -11054,7 +11472,7 @@ 

    Used by:

    BSD 3-Clause "New" or "Revised" License

    Used by:

    Copyright © WHATWG (Apple, Google, Mozilla, Microsoft).
     
    @@ -11318,7 +11736,34 @@ 

    Used by:

    MIT License

    Used by:

    +
    Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors.
    +
    +Permission is hereby granted, free of charge, to any person obtaining a copy
    +of this software and associated documentation files (the "Software"), to deal
    +in the Software without restriction, including without limitation the rights
    +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    +copies of the Software, and to permit persons to whom the Software is
    +furnished to do so, subject to the following conditions:
    +
    +The above copyright notice and this permission notice shall be included in
    +all copies or substantial portions of the Software.
    +
    +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
    +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    +THE SOFTWARE.
    +
    +
  • +
  • +

    MIT License

    +

    Used by:

    +
    Copyright (c) 2014 Carl Lerche and other MIO contributors
     
    @@ -11400,7 +11845,7 @@ 

    Used by:

    MIT License

    Used by:

    Copyright (c) 2015 Jonathan Reem
     
    @@ -11510,36 +11955,8 @@ 

    Used by:

    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -
    -
  • -
  • -

    MIT License

    -

    Used by:

    - -
    Copyright (c) 2017 Doug Tangren
    -
    -Permission is hereby granted, free of charge, to any person obtaining
    -a copy of this software and associated documentation files (the
    -"Software"), to deal in the Software without restriction, including
    -without limitation the rights to use, copy, modify, merge, publish,
    -distribute, sublicense, and/or sell copies of the Software, and to
    -permit persons to whom the Software is furnished to do so, subject to
    -the following conditions:
    -
    -The above copyright notice and this permission notice shall be
    -included in all copies or substantial portions of the Software.
    -
    -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
    -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
    -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
    -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
    -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    +SOFTWARE.
     
  • @@ -11572,7 +11989,7 @@

    Used by:

    MIT License

    Used by:

    Copyright (c) 2017 Redox OS Developers
     
    @@ -11602,7 +12019,7 @@ 

    Used by:

    MIT License

    Used by:

    Copyright (c) 2017 h2 authors
     
    @@ -11635,7 +12052,7 @@ 

    Used by:

    MIT License

    Used by:

    Copyright (c) 2018 Carl Lerche
     
    @@ -11695,7 +12112,7 @@ 

    Used by:

    MIT License

    Used by:

    Copyright (c) 2019 Carl Lerche
     
    @@ -11728,8 +12145,9 @@ 

    Used by:

    MIT License

    Used by:

    Copyright (c) 2019 Tokio Contributors
     
    @@ -11762,34 +12180,69 @@ 

    Used by:

    MIT License

    Used by:

    -
    Copyright (c) 2023 Tokio Contributors
    +                
    Copyright (c) 2020 Élie ROUDNINSKI (marmeladema) <xademax@gmail.com>
     
    -Permission is hereby granted, free of charge, to any
    -person obtaining a copy of this software and associated
    -documentation files (the "Software"), to deal in the
    -Software without restriction, including without
    -limitation the rights to use, copy, modify, merge,
    -publish, distribute, sublicense, and/or sell copies of
    -the Software, and to permit persons to whom the Software
    -is furnished to do so, subject to the following
    -conditions:
    +Permission is hereby granted, free of charge, to any person obtaining a copy
    +of this software and associated documentation files (the "Software"), to deal
    +in the Software without restriction, including without limitation the rights
    +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    +copies of the Software, and to permit persons to whom the Software is
    +furnished to do so, subject to the following conditions:
     
    -The above copyright notice and this permission notice
    -shall be included in all copies or substantial portions
    -of the Software.
    +The above copyright notice and this permission notice shall be included in all
    +copies or substantial portions of the Software.
     
    -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
    -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
    -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
    -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
    -SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
    -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
    -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
    -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    -DEALINGS IN THE SOFTWARE.
    +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    +SOFTWARE.
    +
    +
  • +
  • +

    MIT License

    +

    Used by:

    + +
    Copyright (c) Individual contributors
    +
    +Permission is hereby granted, free of charge, to any person obtaining a copy
    +of this software and associated documentation files (the "Software"), to deal
    +in the Software without restriction, including without limitation the rights
    +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    +copies of the Software, and to permit persons to whom the Software is
    +furnished to do so, subject to the following conditions:
    +
    +The above copyright notice and this permission notice shall be included in all
    +copies or substantial portions of the Software.
    +
    +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    +SOFTWARE.
    +
    +
  • +
  • +

    MIT License

    +

    Used by:

    + +
    Copyright 2016 Nika Layzell
    +
    +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
    +
    +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
    +
    +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     
  • @@ -11854,7 +12307,6 @@

    MIT License

    Used by:

    MIT License
     
    @@ -11912,11 +12364,13 @@ 

    Used by:

    MIT License

    Used by:

    MIT License
     
    -Copyright (c) 2018 Guillaume Gomez
    +Copyright (c) 2017 Ted Driggs
     
     Permission is hereby granted, free of charge, to any person obtaining a copy
     of this software and associated documentation files (the "Software"), to deal
    @@ -11941,11 +12395,11 @@ 

    Used by:

    MIT License

    Used by:

    MIT License
     
    -Copyright (c) 2019 Acrimon
    +Copyright (c) 2018 Guillaume Gomez
     
     Permission is hereby granted, free of charge, to any person obtaining a copy
     of this software and associated documentation files (the "Software"), to deal
    @@ -11970,12 +12424,11 @@ 

    Used by:

    MIT License

    Used by:

    MIT License
     
    -Copyright (c) 2019 Peter Glotfelty
    +Copyright (c) 2019 Acrimon
     
     Permission is hereby granted, free of charge, to any person obtaining a copy
     of this software and associated documentation files (the "Software"), to deal
    @@ -12000,11 +12453,12 @@ 

    Used by:

    MIT License

    Used by:

    MIT License
     
    -Copyright (c) 2020 Élie ROUDNINSKI (marmeladema) <xademax@gmail.com>
    +Copyright (c) 2019 Peter Glotfelty
     
     Permission is hereby granted, free of charge, to any person obtaining a copy
     of this software and associated documentation files (the "Software"), to deal
    @@ -12029,7 +12483,7 @@ 

    Used by:

    MIT License

    Used by:

    MIT License
     
    @@ -12058,15 +12512,12 @@ 

    Used by:

    MIT License

    Used by:

    MIT License
    @@ -12084,7 +12535,37 @@ 

    Used by:

    MIT License

    Used by:

    +
    MIT License
    +
    +Copyright (c) Tokio Contributors
    +
    +Permission is hereby granted, free of charge, to any person obtaining a copy
    +of this software and associated documentation files (the "Software"), to deal
    +in the Software without restriction, including without limitation the rights
    +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    +copies of the Software, and to permit persons to whom the Software is
    +furnished to do so, subject to the following conditions:
    +
    +The above copyright notice and this permission notice shall be included in all
    +copies or substantial portions of the Software.
    +
    +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    +SOFTWARE.
    +
    +
  • +
  • +

    MIT License

    +

    Used by:

    +
    Permission is hereby granted, free of charge, to any
     person obtaining a copy of this software and associated
    @@ -12115,7 +12596,7 @@ 

    Used by:

    MIT License

    Used by:

    Permission is hereby granted, free of charge, to any person obtaining
     a copy of this software and associated documentation files (the
    @@ -12170,7 +12651,7 @@ 

    Used by:

    MIT License

    Used by:

    The MIT License (MIT)
     
    @@ -12193,6 +12674,34 @@ 

    Used by:

    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +
    +
  • +
  • +

    MIT License

    +

    Used by:

    + +
    The MIT License (MIT)
    +
    +Copyright (c) 2014-2022 Steven Fackler, Yuki Okushi
    +
    +Permission is hereby granted, free of charge, to any person obtaining a copy of
    +this software and associated documentation files (the "Software"), to deal in
    +the Software without restriction, including without limitation the rights to
    +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
    +the Software, and to permit persons to whom the Software is furnished to do so,
    +subject to the following conditions:
    +
    +The above copyright notice and this permission notice shall be included in all
    +copies or substantial portions of the Software.
    +
    +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
    +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
    +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
    +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
    +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     
  • @@ -12229,13 +12738,13 @@

    Used by:

    MIT License

    Used by:

    The MIT License (MIT)
     
    @@ -12264,11 +12773,11 @@ 

    Used by:

    MIT License

    Used by:

    The MIT License (MIT)
     
    -Copyright (c) 2015 Austin Bonander
    +Copyright (c) 2015 Carl Lerche + nix-rust Authors
     
     Permission is hereby granted, free of charge, to any person obtaining a copy
     of this software and associated documentation files (the "Software"), to deal
    @@ -12277,28 +12786,29 @@ 

    Used by:

    copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE.
  • MIT License

    Used by:

    The MIT License (MIT)
     
    -Copyright (c) 2015 Carl Lerche + nix-rust Authors
    +Copyright (c) 2015 Danny Guo
    +Copyright (c) 2016 Titus Wormer <tituswormer@gmail.com>
    +Copyright (c) 2018 Akash Kurdekar
     
     Permission is hereby granted, free of charge, to any person obtaining a copy
     of this software and associated documentation files (the "Software"), to deal
    @@ -12307,16 +12817,16 @@ 

    Used by:

    copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.
  • @@ -12531,7 +13041,9 @@

    Used by:

    MIT License

    Used by:

    The MIT License (MIT)
     
    @@ -12590,7 +13102,7 @@ 

    MIT License

    Used by:

    The MIT License (MIT)
     
    @@ -12619,7 +13131,7 @@ 

    Used by:

    MIT License

    Used by:

    The MIT License (MIT)
     
    @@ -12649,7 +13161,7 @@ 

    Used by:

    MIT License

    Used by:

    The MIT License (MIT)
     
    @@ -12679,7 +13191,7 @@ 

    Used by:

    MIT License

    Used by:

    The MIT License (MIT)
     
    @@ -12723,6 +13235,35 @@ 

    Used by:

    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +
    +
  • +
  • +

    MIT License

    +

    Used by:

    + +
    The MIT License (MIT)
    +
    +Copyright 2017-2023 Eira Fransham.
    +
    +Permission is hereby granted, free of charge, to any person obtaining a copy
    +of this software and associated documentation files (the "Software"), to deal
    +in the Software without restriction, including without limitation the rights
    +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    +copies of the Software, and to permit persons to whom the Software is
    +furnished to do so, subject to the following conditions:
    +
    +The above copyright notice and this permission notice shall be included in all
    +copies or substantial portions of the Software.
    +
     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    @@ -12737,7 +13278,7 @@ 

    MIT License

    Used by:

    The MIT License (MIT)
     Copyright (c) 2016 Alexandre Bury
    @@ -12776,6 +13317,36 @@ 

    Used by:

    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +
    +
  • +
  • +

    MIT License

    +

    Used by:

    + +
    The MIT License (MIT)
    +
    +Copyright (c) 2015 Austin Bonander
    +
    +Permission is hereby granted, free of charge, to any person obtaining a copy
    +of this software and associated documentation files (the "Software"), to deal
    +in the Software without restriction, including without limitation the rights
    +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    +copies of the Software, and to permit persons to whom the Software is
    +furnished to do so, subject to the following conditions:
    +
    +The above copyright notice and this permission notice shall be included in all
    +copies or substantial portions of the Software.
    +
    +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    +SOFTWARE.
    +
     
  • @@ -12841,382 +13412,19 @@

    Used by:

    MIT License

    Used by:

    This project is dual-licensed under the Unlicense and MIT licenses.
     
     You may use this code under the terms of either license.
    -
    -
  • -
  • -

    Mozilla Public License 2.0

    -

    Used by:

    - -
    Mozilla Public License Version 2.0
    -==================================
    -
    -### 1. Definitions
    -
    -**1.1. “Contributor”**
    -    means each individual or legal entity that creates, contributes to
    -    the creation of, or owns Covered Software.
    -
    -**1.2. “Contributor Version”**
    -    means the combination of the Contributions of others (if any) used
    -    by a Contributor and that particular Contributor's Contribution.
    -
    -**1.3. “Contribution”**
    -    means Covered Software of a particular Contributor.
    -
    -**1.4. “Covered Software”**
    -    means Source Code Form to which the initial Contributor has attached
    -    the notice in Exhibit A, the Executable Form of such Source Code
    -    Form, and Modifications of such Source Code Form, in each case
    -    including portions thereof.
    -
    -**1.5. “Incompatible With Secondary Licenses”**
    -    means
    -
    -* **(a)** that the initial Contributor has attached the notice described
    -    in Exhibit B to the Covered Software; or
    -* **(b)** that the Covered Software was made available under the terms of
    -    version 1.1 or earlier of the License, but not also under the
    -    terms of a Secondary License.
    -
    -**1.6. “Executable Form”**
    -    means any form of the work other than Source Code Form.
    -
    -**1.7. “Larger Work”**
    -    means a work that combines Covered Software with other material, in
    -    a separate file or files, that is not Covered Software.
    -
    -**1.8. “License”**
    -    means this document.
    -
    -**1.9. “Licensable”**
    -    means having the right to grant, to the maximum extent possible,
    -    whether at the time of the initial grant or subsequently, any and
    -    all of the rights conveyed by this License.
    -
    -**1.10. “Modifications”**
    -    means any of the following:
    -
    -* **(a)** any file in Source Code Form that results from an addition to,
    -    deletion from, or modification of the contents of Covered
    -    Software; or
    -* **(b)** any new file in Source Code Form that contains any Covered
    -    Software.
    -
    -**1.11. “Patent Claims” of a Contributor**
    -    means any patent claim(s), including without limitation, method,
    -    process, and apparatus claims, in any patent Licensable by such
    -    Contributor that would be infringed, but for the grant of the
    -    License, by the making, using, selling, offering for sale, having
    -    made, import, or transfer of either its Contributions or its
    -    Contributor Version.
    -
    -**1.12. “Secondary License”**
    -    means either the GNU General Public License, Version 2.0, the GNU
    -    Lesser General Public License, Version 2.1, the GNU Affero General
    -    Public License, Version 3.0, or any later versions of those
    -    licenses.
    -
    -**1.13. “Source Code Form”**
    -    means the form of the work preferred for making modifications.
    -
    -**1.14. “You” (or “Your”)**
    -    means an individual or a legal entity exercising rights under this
    -    License. For legal entities, “You” includes any entity that
    -    controls, is controlled by, or is under common control with You. For
    -    purposes of this definition, “control” means **(a)** the power, direct
    -    or indirect, to cause the direction or management of such entity,
    -    whether by contract or otherwise, or **(b)** ownership of more than
    -    fifty percent (50%) of the outstanding shares or beneficial
    -    ownership of such entity.
    -
    -
    -### 2. License Grants and Conditions
    -
    -#### 2.1. Grants
    -
    -Each Contributor hereby grants You a world-wide, royalty-free,
    -non-exclusive license:
    -
    -* **(a)** under intellectual property rights (other than patent or trademark)
    -    Licensable by such Contributor to use, reproduce, make available,
    -    modify, display, perform, distribute, and otherwise exploit its
    -    Contributions, either on an unmodified basis, with Modifications, or
    -    as part of a Larger Work; and
    -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer
    -    for sale, have made, import, and otherwise transfer either its
    -    Contributions or its Contributor Version.
    -
    -#### 2.2. Effective Date
    -
    -The licenses granted in Section 2.1 with respect to any Contribution
    -become effective for each Contribution on the date the Contributor first
    -distributes such Contribution.
    -
    -#### 2.3. Limitations on Grant Scope
    -
    -The licenses granted in this Section 2 are the only rights granted under
    -this License. No additional rights or licenses will be implied from the
    -distribution or licensing of Covered Software under this License.
    -Notwithstanding Section 2.1(b) above, no patent license is granted by a
    -Contributor:
    -
    -* **(a)** for any code that a Contributor has removed from Covered Software;
    -    or
    -* **(b)** for infringements caused by: **(i)** Your and any other third party's
    -    modifications of Covered Software, or **(ii)** the combination of its
    -    Contributions with other software (except as part of its Contributor
    -    Version); or
    -* **(c)** under Patent Claims infringed by Covered Software in the absence of
    -    its Contributions.
    -
    -This License does not grant any rights in the trademarks, service marks,
    -or logos of any Contributor (except as may be necessary to comply with
    -the notice requirements in Section 3.4).
    -
    -#### 2.4. Subsequent Licenses
    -
    -No Contributor makes additional grants as a result of Your choice to
    -distribute the Covered Software under a subsequent version of this
    -License (see Section 10.2) or under the terms of a Secondary License (if
    -permitted under the terms of Section 3.3).
    -
    -#### 2.5. Representation
    -
    -Each Contributor represents that the Contributor believes its
    -Contributions are its original creation(s) or it has sufficient rights
    -to grant the rights to its Contributions conveyed by this License.
    -
    -#### 2.6. Fair Use
    -
    -This License is not intended to limit any rights You have under
    -applicable copyright doctrines of fair use, fair dealing, or other
    -equivalents.
    -
    -#### 2.7. Conditions
    -
    -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
    -in Section 2.1.
    -
    -
    -### 3. Responsibilities
    -
    -#### 3.1. Distribution of Source Form
    -
    -All distribution of Covered Software in Source Code Form, including any
    -Modifications that You create or to which You contribute, must be under
    -the terms of this License. You must inform recipients that the Source
    -Code Form of the Covered Software is governed by the terms of this
    -License, and how they can obtain a copy of this License. You may not
    -attempt to alter or restrict the recipients' rights in the Source Code
    -Form.
    -
    -#### 3.2. Distribution of Executable Form
    -
    -If You distribute Covered Software in Executable Form then:
    -
    -* **(a)** such Covered Software must also be made available in Source Code
    -    Form, as described in Section 3.1, and You must inform recipients of
    -    the Executable Form how they can obtain a copy of such Source Code
    -    Form by reasonable means in a timely manner, at a charge no more
    -    than the cost of distribution to the recipient; and
    -
    -* **(b)** You may distribute such Executable Form under the terms of this
    -    License, or sublicense it under different terms, provided that the
    -    license for the Executable Form does not attempt to limit or alter
    -    the recipients' rights in the Source Code Form under this License.
    -
    -#### 3.3. Distribution of a Larger Work
    -
    -You may create and distribute a Larger Work under terms of Your choice,
    -provided that You also comply with the requirements of this License for
    -the Covered Software. If the Larger Work is a combination of Covered
    -Software with a work governed by one or more Secondary Licenses, and the
    -Covered Software is not Incompatible With Secondary Licenses, this
    -License permits You to additionally distribute such Covered Software
    -under the terms of such Secondary License(s), so that the recipient of
    -the Larger Work may, at their option, further distribute the Covered
    -Software under the terms of either this License or such Secondary
    -License(s).
    -
    -#### 3.4. Notices
    -
    -You may not remove or alter the substance of any license notices
    -(including copyright notices, patent notices, disclaimers of warranty,
    -or limitations of liability) contained within the Source Code Form of
    -the Covered Software, except that You may alter any license notices to
    -the extent required to remedy known factual inaccuracies.
    -
    -#### 3.5. Application of Additional Terms
    -
    -You may choose to offer, and to charge a fee for, warranty, support,
    -indemnity or liability obligations to one or more recipients of Covered
    -Software. However, You may do so only on Your own behalf, and not on
    -behalf of any Contributor. You must make it absolutely clear that any
    -such warranty, support, indemnity, or liability obligation is offered by
    -You alone, and You hereby agree to indemnify every Contributor for any
    -liability incurred by such Contributor as a result of warranty, support,
    -indemnity or liability terms You offer. You may include additional
    -disclaimers of warranty and limitations of liability specific to any
    -jurisdiction.
    -
    -
    -### 4. Inability to Comply Due to Statute or Regulation
    -
    -If it is impossible for You to comply with any of the terms of this
    -License with respect to some or all of the Covered Software due to
    -statute, judicial order, or regulation then You must: **(a)** comply with
    -the terms of this License to the maximum extent possible; and **(b)**
    -describe the limitations and the code they affect. Such description must
    -be placed in a text file included with all distributions of the Covered
    -Software under this License. Except to the extent prohibited by statute
    -or regulation, such description must be sufficiently detailed for a
    -recipient of ordinary skill to be able to understand it.
    -
    -
    -### 5. Termination
    -
    -**5.1.** The rights granted under this License will terminate automatically
    -if You fail to comply with any of its terms. However, if You become
    -compliant, then the rights granted under this License from a particular
    -Contributor are reinstated **(a)** provisionally, unless and until such
    -Contributor explicitly and finally terminates Your grants, and **(b)** on an
    -ongoing basis, if such Contributor fails to notify You of the
    -non-compliance by some reasonable means prior to 60 days after You have
    -come back into compliance. Moreover, Your grants from a particular
    -Contributor are reinstated on an ongoing basis if such Contributor
    -notifies You of the non-compliance by some reasonable means, this is the
    -first time You have received notice of non-compliance with this License
    -from such Contributor, and You become compliant prior to 30 days after
    -Your receipt of the notice.
    -
    -**5.2.** If You initiate litigation against any entity by asserting a patent
    -infringement claim (excluding declaratory judgment actions,
    -counter-claims, and cross-claims) alleging that a Contributor Version
    -directly or indirectly infringes any patent, then the rights granted to
    -You by any and all Contributors for the Covered Software under Section
    -2.1 of this License shall terminate.
    -
    -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all
    -end user license agreements (excluding distributors and resellers) which
    -have been validly granted by You or Your distributors under this License
    -prior to termination shall survive termination.
    -
    -
    -### 6. Disclaimer of Warranty
    -
    -> Covered Software is provided under this License on an “as is”
    -> basis, without warranty of any kind, either expressed, implied, or
    -> statutory, including, without limitation, warranties that the
    -> Covered Software is free of defects, merchantable, fit for a
    -> particular purpose or non-infringing. The entire risk as to the
    -> quality and performance of the Covered Software is with You.
    -> Should any Covered Software prove defective in any respect, You
    -> (not any Contributor) assume the cost of any necessary servicing,
    -> repair, or correction. This disclaimer of warranty constitutes an
    -> essential part of this License. No use of any Covered Software is
    -> authorized under this License except under this disclaimer.
    -
    -### 7. Limitation of Liability
    -
    -> Under no circumstances and under no legal theory, whether tort
    -> (including negligence), contract, or otherwise, shall any
    -> Contributor, or anyone who distributes Covered Software as
    -> permitted above, be liable to You for any direct, indirect,
    -> special, incidental, or consequential damages of any character
    -> including, without limitation, damages for lost profits, loss of
    -> goodwill, work stoppage, computer failure or malfunction, or any
    -> and all other commercial damages or losses, even if such party
    -> shall have been informed of the possibility of such damages. This
    -> limitation of liability shall not apply to liability for death or
    -> personal injury resulting from such party's negligence to the
    -> extent applicable law prohibits such limitation. Some
    -> jurisdictions do not allow the exclusion or limitation of
    -> incidental or consequential damages, so this exclusion and
    -> limitation may not apply to You.
    -
    -
    -### 8. Litigation
    -
    -Any litigation relating to this License may be brought only in the
    -courts of a jurisdiction where the defendant maintains its principal
    -place of business and such litigation shall be governed by laws of that
    -jurisdiction, without reference to its conflict-of-law provisions.
    -Nothing in this Section shall prevent a party's ability to bring
    -cross-claims or counter-claims.
    -
    -
    -### 9. Miscellaneous
    -
    -This License represents the complete agreement concerning the subject
    -matter hereof. If any provision of this License is held to be
    -unenforceable, such provision shall be reformed only to the extent
    -necessary to make it enforceable. Any law or regulation which provides
    -that the language of a contract shall be construed against the drafter
    -shall not be used to construe this License against a Contributor.
    -
    -
    -### 10. Versions of the License
    -
    -#### 10.1. New Versions
    -
    -Mozilla Foundation is the license steward. Except as provided in Section
    -10.3, no one other than the license steward has the right to modify or
    -publish new versions of this License. Each version will be given a
    -distinguishing version number.
    -
    -#### 10.2. Effect of New Versions
    -
    -You may distribute the Covered Software under the terms of the version
    -of the License under which You originally received the Covered Software,
    -or under the terms of any subsequent version published by the license
    -steward.
    -
    -#### 10.3. Modified Versions
    -
    -If you create software not governed by this License, and you want to
    -create a new license for such software, you may create and use a
    -modified version of this License if you rename the license and remove
    -any references to the name of the license steward (except to note that
    -such modified license differs from this License).
    -
    -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses
    -
    -If You choose to distribute Source Code Form that is Incompatible With
    -Secondary Licenses under the terms of this version of the License, the
    -notice described in Exhibit B of this License must be attached.
    -
    -## Exhibit A - Source Code Form License Notice
    -
    -    This Source Code Form is subject to the terms of the Mozilla Public
    -    License, v. 2.0. If a copy of the MPL was not distributed with this
    -    file, You can obtain one at http://mozilla.org/MPL/2.0/.
    -
    -If it is not possible or desirable to put the notice in a particular
    -file, then You may include the notice in a location (such as a LICENSE
    -file in a relevant directory) where a recipient would be likely to look
    -for such a notice.
    -
    -You may add additional accurate notices of copyright ownership.
    -
    -## Exhibit B - “Incompatible With Secondary Licenses” Notice
    -
    -    This Source Code Form is "Incompatible With Secondary Licenses", as
    -    defined by the Mozilla Public License, v. 2.0.
     
  • @@ -13280,34 +13488,95 @@

    Used by:

    */
  • -

    Unicode License Agreement - Data Files and Software (2016)

    +

    Unicode License v3

    Used by:

    -
    UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE
    -
    -Unicode Data Files include all data files under the directories http://www.unicode.org/Public/, http://www.unicode.org/reports/, http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and http://www.unicode.org/utility/trac/browser/.
    -
    -Unicode Data Files do not include PDF online code charts under the directory http://www.unicode.org/Public/.
    -
    -Software includes any source code published in the Unicode Standard or under the directories http://www.unicode.org/Public/, http://www.unicode.org/reports/, http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and http://www.unicode.org/utility/trac/browser/.
    -
    -NOTICE TO USER: Carefully read the following legal agreement. BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.
    +                
    UNICODE LICENSE V3
     
     COPYRIGHT AND PERMISSION NOTICE
     
    -Copyright © 1991-2016 Unicode, Inc. All rights reserved. Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
    +Copyright © 1991-2023 Unicode, Inc.
    +
    +NOTICE TO USER: Carefully read the following legal agreement. BY
    +DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR
    +SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
    +TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT
    +DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.
    +
    +Permission is hereby granted, free of charge, to any person obtaining a
    +copy of data files and any associated documentation (the "Data Files") or
    +software and any associated documentation (the "Software") to deal in the
    +Data Files or Software without restriction, including without limitation
    +the rights to use, copy, modify, merge, publish, distribute, and/or sell
    +copies of the Data Files or Software, and to permit persons to whom the
    +Data Files or Software are furnished to do so, provided that either (a)
    +this copyright and permission notice appear with all copies of the Data
    +Files or Software, or (b) this copyright and permission notice appear in
    +associated Documentation.
    +
    +THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
    +KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
    +THIRD PARTY RIGHTS.
    +
    +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE
    +BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,
    +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
    +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
    +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA
    +FILES OR SOFTWARE.
    +
    +Except as contained in this notice, the name of a copyright holder shall
    +not be used in advertising or otherwise to promote the sale, use or other
    +dealings in these Data Files or Software without prior written
    +authorization of the copyright holder.
    +
    +
  • +
  • +

    zlib License

    +

    Used by:

    + +
    Copyright (c) 2024 Orson Peters
     
    -Permission is hereby granted, free of charge, to any person obtaining a copy of the Unicode data files and any associated documentation (the "Data Files") or Unicode software and any associated documentation (the "Software") to deal in the Data Files or Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Data Files or Software, and to permit persons to whom the Data Files or Software are furnished to do so, provided that either
    +This software is provided 'as-is', without any express or implied warranty. In
    +no event will the authors be held liable for any damages arising from the use of
    +this software.
     
    -     (a) this copyright and permission notice appear with all copies of the Data Files or Software, or
    -     (b) this copyright and permission notice appear in associated Documentation.
    +Permission is granted to anyone to use this software for any purpose, including
    +commercial applications, and to alter it and redistribute it freely, subject to
    +the following restrictions:
     
    -THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR SOFTWARE.
    +1. The origin of this software must not be misrepresented; you must not claim
    +    that you wrote the original software. If you use this software in a product,
    +    an acknowledgment in the product documentation would be appreciated but is
    +    not required.
     
    -Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in these Data Files or Software without prior written authorization of the copyright holder.
    -
    +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + +3. This notice may not be removed or altered from any source distribution.
  • From 409b1bb22b81e85a7757c98b0beab182e7c4aa87 Mon Sep 17 00:00:00 2001 From: Thomas Krause Date: Wed, 13 Aug 2025 17:00:02 +0200 Subject: [PATCH 4/7] Updated changelog with breaking change message --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cbd1cdc11..7c57253c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- :boom: Removed usage of the `smartstring` crate. This changes the interface of the + `AnnoKey` and `Component`/`AnnotationComponent` structs and is a **breaking + change**, but the new interface is actually easier to call because the + conversion to smart strings is not necessary any longer. The change also + increases performance for several queries in the test set by up to 30%. + ## [3.8.3] - 2025-08-12 ### Fixed From f8afc4c67cabf6609732a67e5e8a2c5704ae1afc Mon Sep 17 00:00:00 2001 From: Thomas Krause Date: Wed, 13 Aug 2025 17:01:45 +0200 Subject: [PATCH 5/7] The Annotation struct has also changed --- CHANGELOG.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c57253c9..65bffd72e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,11 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- :boom: Removed usage of the `smartstring` crate. This changes the interface of the - `AnnoKey` and `Component`/`AnnotationComponent` structs and is a **breaking - change**, but the new interface is actually easier to call because the - conversion to smart strings is not necessary any longer. The change also - increases performance for several queries in the test set by up to 30%. +- :boom: Removed usage of the `smartstring` crate. This changes the interface of + the `AnnoKey`, `Annotation`, and `Component`/`AnnotationComponent` structs and + is a **breaking change**, but the new interface is actually easier to call + because the conversion to smart strings is not necessary any longer. The + change also increases performance for several queries in the test set by up to + 30%. ## [3.8.3] - 2025-08-12 From 926ff956da9deb5c4496ffee6c944a60dff5f5d1 Mon Sep 17 00:00:00 2001 From: Thomas Krause Date: Wed, 13 Aug 2025 17:17:18 +0200 Subject: [PATCH 6/7] Update cargo-dist and use windows-2025 runner for release --- .github/workflows/release.yml | 65 +++++++++++++++++++++-------------- Cargo.toml | 21 ----------- dist-workspace.toml | 19 ++++++++++ 3 files changed, 58 insertions(+), 47 deletions(-) create mode 100644 dist-workspace.toml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 071214f8d..beed20837 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -# This file was autogenerated by cargo-dist: https://opensource.axo.dev/cargo-dist/ +# This file was autogenerated by dist: https://axodotdev.github.io/cargo-dist # # Copyright 2022-2024, axodotdev # SPDX-License-Identifier: MIT or Apache-2.0 @@ -6,7 +6,7 @@ # CI that: # # * checks for a Git Tag that looks like a release -# * builds artifacts with cargo-dist (archives, installers, hashes) +# * builds artifacts with dist (archives, installers, hashes) # * uploads those artifacts to temporary workflow zip # * on success, uploads the artifacts to a GitHub Release # @@ -24,10 +24,10 @@ permissions: # must be a Cargo-style SemVer Version (must have at least major.minor.patch). # # If PACKAGE_NAME is specified, then the announcement will be for that -# package (erroring out if it doesn't have the given version or isn't cargo-dist-able). +# package (erroring out if it doesn't have the given version or isn't dist-able). # # If PACKAGE_NAME isn't specified, then the announcement will be for all -# (cargo-dist-able) packages in the workspace with that version (this mode is +# (dist-able) packages in the workspace with that version (this mode is # intended for workspaces with only one dist-able package, or with all dist-able # packages versioned/released in lockstep). # @@ -45,7 +45,7 @@ on: - '**[0-9]+.[0-9]+.[0-9]+*' jobs: - # Run 'cargo dist plan' (or host) to determine what tasks we need to do + # Run 'dist plan' (or host) to determine what tasks we need to do plan: runs-on: "ubuntu-22.04" outputs: @@ -58,17 +58,18 @@ jobs: steps: - uses: actions/checkout@v4 with: + persist-credentials: false submodules: recursive - - name: Install cargo-dist + - name: Install dist # we specify bash to get pipefail; it guards against the `curl` command # failing. otherwise `sh` won't catch that `curl` returned non-0 shell: bash - run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.22.1/cargo-dist-installer.sh | sh" - - name: Cache cargo-dist + run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.29.0/cargo-dist-installer.sh | sh" + - name: Cache dist uses: actions/upload-artifact@v4 with: name: cargo-dist-cache - path: ~/.cargo/bin/cargo-dist + path: ~/.cargo/bin/dist # sure would be cool if github gave us proper conditionals... # so here's a doubly-nested ternary-via-truthiness to try to provide the best possible # functionality based on whether this is a pull_request, and whether it's from a fork. @@ -76,8 +77,8 @@ jobs: # but also really annoying to build CI around when it needs secrets to work right.) - id: plan run: | - cargo dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json - echo "cargo dist ran successfully" + dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json + echo "dist ran successfully" cat plan-dist-manifest.json echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT" - name: "Upload dist-manifest.json" @@ -95,18 +96,19 @@ jobs: if: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix.include != null && (needs.plan.outputs.publishing == 'true' || fromJson(needs.plan.outputs.val).ci.github.pr_run_mode == 'upload') }} strategy: fail-fast: false - # Target platforms/runners are computed by cargo-dist in create-release. + # Target platforms/runners are computed by dist in create-release. # Each member of the matrix has the following arguments: # # - runner: the github runner - # - dist-args: cli flags to pass to cargo dist - # - install-dist: expression to run to install cargo-dist on the runner + # - dist-args: cli flags to pass to dist + # - install-dist: expression to run to install dist on the runner # # Typically there will be: # - 1 "global" task that builds universal installers # - N "local" tasks that build each platform's binaries and platform-specific installers matrix: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix }} runs-on: ${{ matrix.runner }} + container: ${{ matrix.container && matrix.container.image || null }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} BUILD_MANIFEST_NAME: target/distrib/${{ join(matrix.targets, '-') }}-dist-manifest.json @@ -116,9 +118,17 @@ jobs: git config --global core.longpaths true - uses: actions/checkout@v4 with: + persist-credentials: false submodules: recursive - - name: Install cargo-dist - run: ${{ matrix.install_dist }} + - name: Install Rust non-interactively if not already installed + if: ${{ matrix.container }} + run: | + if ! command -v cargo > /dev/null 2>&1; then + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + echo "$HOME/.cargo/bin" >> $GITHUB_PATH + fi + - name: Install dist + run: ${{ matrix.install_dist.run }} # Get the dist-manifest - name: Fetch local artifacts uses: actions/download-artifact@v4 @@ -132,8 +142,8 @@ jobs: - name: Build artifacts run: | # Actually do builds and make zips and whatnot - cargo dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json - echo "cargo dist ran successfully" + dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json + echo "dist ran successfully" - id: cargo-dist name: Post-build # We force bash here just because github makes it really hard to get values up @@ -143,7 +153,7 @@ jobs: run: | # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" + dist print-upload-files-from-manifest --manifest dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" @@ -167,13 +177,14 @@ jobs: steps: - uses: actions/checkout@v4 with: + persist-credentials: false submodules: recursive - - name: Install cached cargo-dist + - name: Install cached dist uses: actions/download-artifact@v4 with: name: cargo-dist-cache path: ~/.cargo/bin/ - - run: chmod +x ~/.cargo/bin/cargo-dist + - run: chmod +x ~/.cargo/bin/dist # Get all the local artifacts for the global tasks to use (for e.g. checksums) - name: Fetch local artifacts uses: actions/download-artifact@v4 @@ -184,8 +195,8 @@ jobs: - id: cargo-dist shell: bash run: | - cargo dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json - echo "cargo dist ran successfully" + dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json + echo "dist ran successfully" # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" @@ -216,13 +227,14 @@ jobs: steps: - uses: actions/checkout@v4 with: + persist-credentials: false submodules: recursive - - name: Install cached cargo-dist + - name: Install cached dist uses: actions/download-artifact@v4 with: name: cargo-dist-cache path: ~/.cargo/bin/ - - run: chmod +x ~/.cargo/bin/cargo-dist + - run: chmod +x ~/.cargo/bin/dist # Fetch artifacts from scratch-storage - name: Fetch artifacts uses: actions/download-artifact@v4 @@ -233,7 +245,7 @@ jobs: - id: host shell: bash run: | - cargo dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json + dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json echo "artifacts uploaded and released successfully" cat dist-manifest.json echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT" @@ -280,4 +292,5 @@ jobs: steps: - uses: actions/checkout@v4 with: + persist-credentials: false submodules: recursive diff --git a/Cargo.toml b/Cargo.toml index 0b90b681b..65a610f8a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,27 +9,6 @@ members = [ ] resolver = "3" -# Config for 'cargo dist' -[workspace.metadata.dist] -# The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax) -cargo-dist-version = "0.22.1" -# CI backends to support -ci = "github" -# The installers to generate for each app -installers = [] -# Which actions to run on pull requests -pr-run-mode = "plan" -# Target platforms to build apps for (Rust target-triple syntax) -targets = [ - "aarch64-apple-darwin", - "x86_64-apple-darwin", - "x86_64-unknown-linux-gnu", - "x86_64-pc-windows-msvc", -] -[workspace.metadata.dist.github-custom-runners] -global = "ubuntu-22.04" -x86_64-unknown-linux-gnu = "ubuntu-22.04" - # Use release optimization of some of the performance sensitive crates even for debug builds. # This allows faster builds and debugging of our own code, while balancing performance. [profile.dev.package.bincode] diff --git a/dist-workspace.toml b/dist-workspace.toml new file mode 100644 index 000000000..5147b5e69 --- /dev/null +++ b/dist-workspace.toml @@ -0,0 +1,19 @@ +[workspace] +members = ["cargo:."] + +# Config for 'dist' +[dist] +# The preferred dist version to use in CI (Cargo.toml SemVer syntax) +cargo-dist-version = "0.29.0" +# CI backends to support +ci = "github" +# The installers to generate for each app +installers = [] +# Which actions to run on pull requests +pr-run-mode = "plan" +# Target platforms to build apps for (Rust target-triple syntax) +targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-pc-windows-msvc"] +[dist.github-custom-runners] +global = "ubuntu-22.04" +x86_64-unknown-linux-gnu = "ubuntu-22.04" +x86_64-pc-windows-msvc = "windows-2025" From d0b18310c219f9e0953b0caae025e4bb5482314f Mon Sep 17 00:00:00 2001 From: Thomas Krause Date: Wed, 13 Aug 2025 17:38:37 +0200 Subject: [PATCH 7/7] Fix clippy issues, especially now needless conversions with .into() --- core/src/annostorage/inmemory.rs | 4 +-- core/src/annostorage/ondisk.rs | 12 +++---- core/src/graph/serialization/graphml.rs | 16 +++++----- graphannis/src/annis/db/aql/model.rs | 5 ++- graphannis/src/annis/db/aql/operators/near.rs | 6 ++-- .../src/annis/db/aql/operators/precedence.rs | 8 ++--- graphannis/src/annis/db/corpusstorage.rs | 8 ++--- graphannis/src/annis/db/exec/nodesearch.rs | 25 ++++++--------- graphannis/src/annis/db/relannis.rs | 32 +++++++++---------- webservice/src/api/corpora.rs | 4 +-- 10 files changed, 56 insertions(+), 64 deletions(-) diff --git a/core/src/annostorage/inmemory.rs b/core/src/annostorage/inmemory.rs index c5f14e25c..b8d63d454 100644 --- a/core/src/annostorage/inmemory.rs +++ b/core/src/annostorage/inmemory.rs @@ -297,7 +297,7 @@ where result = self .anno_values .get_value_ref(old_value) - .map(|v| Cow::Owned(v.clone().into())); + .map(|v| Cow::Owned(v.clone())); self.check_and_remove_value_symbol(old_value); self.total_number_of_annos -= 1; @@ -505,7 +505,7 @@ where ns: String::default(), }..AnnoKey { name: name.into(), - ns: std::char::MAX.to_string().into(), + ns: std::char::MAX.to_string(), }, ), }; diff --git a/core/src/annostorage/ondisk.rs b/core/src/annostorage/ondisk.rs index 539590660..1bf3ed920 100644 --- a/core/src/annostorage/ondisk.rs +++ b/core/src/annostorage/ondisk.rs @@ -366,7 +366,7 @@ where let already_existed = item_smaller_than_largest && self.by_container.contains_key(&by_container_key)?; self.by_container - .insert(by_container_key, anno.val.clone().into())?; + .insert(by_container_key, anno.val.clone())?; // To save some space, insert an boolean value as a marker value // (all information is part of the key already) @@ -401,7 +401,7 @@ where let parsed_key = self.parse_by_container_key(key)?; let anno = Annotation { key: parsed_key.1.as_ref().clone(), - val: val.into(), + val, }; result.push(anno); } @@ -429,7 +429,7 @@ where // remove annotation from by_anno_qname let anno = Annotation { key: key.as_ref().clone(), - val: val.into(), + val, }; self.by_anno_qname.remove(&create_by_anno_qname_key( @@ -472,7 +472,7 @@ where // remove annotation from by_anno_qname let anno = Annotation { key: key.clone(), - val: val.into(), + val, }; self.by_anno_qname.remove(&create_by_anno_qname_key( @@ -496,7 +496,7 @@ where } } - return Ok(Some(Cow::Owned(anno.val.into()))); + return Ok(Some(Cow::Owned(anno.val))); } } Ok(None) @@ -662,7 +662,7 @@ where ns: String::default(), }..AnnoKey { name: name.into(), - ns: std::char::MAX.to_string().into(), + ns: std::char::MAX.to_string(), }, ), }; diff --git a/core/src/graph/serialization/graphml.rs b/core/src/graph/serialization/graphml.rs index e225dadea..92f4e3504 100644 --- a/core/src/graph/serialization/graphml.rs +++ b/core/src/graph/serialization/graphml.rs @@ -456,8 +456,8 @@ fn add_node( for (key, value) in data.drain() { node_updates.add_event(UpdateEvent::AddNodeLabel { node_name: node_name.clone(), - anno_ns: key.ns.into(), - anno_name: key.name.into(), + anno_ns: key.ns, + anno_name: key.name, anno_value: value, })?; } @@ -480,9 +480,9 @@ fn add_edge( edge_updates.add_event(UpdateEvent::AddEdge { source_node: source.clone(), target_node: target.clone(), - layer: component.layer.clone().into(), + layer: component.layer.clone(), component_type: component.get_type().to_string(), - component_name: component.name.clone().into(), + component_name: component.name.clone(), })?; // Add all remaining data entries as annotations @@ -490,11 +490,11 @@ fn add_edge( edge_updates.add_event(UpdateEvent::AddEdgeLabel { source_node: source.clone(), target_node: target.clone(), - layer: component.layer.clone().into(), + layer: component.layer.clone(), component_type: component.get_type().to_string(), - component_name: component.name.clone().into(), - anno_ns: key.ns.into(), - anno_name: key.name.into(), + component_name: component.name.clone(), + anno_ns: key.ns, + anno_name: key.name, anno_value: value, })?; } diff --git a/graphannis/src/annis/db/aql/model.rs b/graphannis/src/annis/db/aql/model.rs index a3b95b88e..8e41be989 100644 --- a/graphannis/src/annis/db/aql/model.rs +++ b/graphannis/src/annis/db/aql/model.rs @@ -520,8 +520,7 @@ impl ComponentType for AnnotationComponentType { && component_name.is_empty() { // might be a new text coverage component - let c = - AnnotationComponent::new(ctype.clone(), layer.into(), component_name.into()); + let c = AnnotationComponent::new(ctype.clone(), layer, component_name); index.text_coverage_components.insert(c); } @@ -666,7 +665,7 @@ impl ComponentType for AnnotationComponentType { base_token_count, segmentation_count: token_count_by_ordering_component .into_iter() - .map(|(k, v)| (k.name.into(), v)) + .map(|(k, v)| (k.name, v)) .collect(), }, }); diff --git a/graphannis/src/annis/db/aql/operators/near.rs b/graphannis/src/annis/db/aql/operators/near.rs index 72ed0d7ee..1a80652c6 100644 --- a/graphannis/src/annis/db/aql/operators/near.rs +++ b/graphannis/src/annis/db/aql/operators/near.rs @@ -47,7 +47,7 @@ impl BinaryOperatorSpec for NearSpec { }; let component_order = Component::new( AnnotationComponentType::Ordering, - ordering_layer.into(), + ordering_layer, self.segmentation .as_ref() .map_or_else(String::default, |s| s.into()), @@ -98,8 +98,8 @@ impl<'a> Near<'a> { }; let component_order = Component::new( AnnotationComponentType::Ordering, - ordering_layer.into(), - spec.segmentation.clone().unwrap_or_default().into(), + ordering_layer, + spec.segmentation.clone().unwrap_or_default(), ); let gs_order = graph.get_graphstorage(&component_order).ok_or_else(|| { diff --git a/graphannis/src/annis/db/aql/operators/precedence.rs b/graphannis/src/annis/db/aql/operators/precedence.rs index fb8df05de..4e35b8534 100644 --- a/graphannis/src/annis/db/aql/operators/precedence.rs +++ b/graphannis/src/annis/db/aql/operators/precedence.rs @@ -57,8 +57,8 @@ impl BinaryOperatorSpec for PrecedenceSpec { }; let component_order = AnnotationComponent::new( AnnotationComponentType::Ordering, - ordering_layer.into(), - self.segmentation.clone().unwrap_or_default().into(), + ordering_layer, + self.segmentation.clone().unwrap_or_default(), ); let mut v = HashSet::default(); @@ -108,8 +108,8 @@ impl<'a> Precedence<'a> { }; let component_order = AnnotationComponent::new( AnnotationComponentType::Ordering, - ordering_layer.into(), - spec.segmentation.clone().unwrap_or_default().into(), + ordering_layer, + spec.segmentation.clone().unwrap_or_default(), ); let gs_order = graph.get_graphstorage(&component_order).ok_or_else(|| { diff --git a/graphannis/src/annis/db/corpusstorage.rs b/graphannis/src/annis/db/corpusstorage.rs index b5bfabce0..9f45e6cc4 100644 --- a/graphannis/src/annis/db/corpusstorage.rs +++ b/graphannis/src/annis/db/corpusstorage.rs @@ -965,7 +965,7 @@ impl CorpusStorage { CorpusConfiguration::default() }; - (orig_corpus_name.into(), g, config) + (orig_corpus_name, g, config) } }; @@ -979,7 +979,7 @@ impl CorpusStorage { self.update_corpus_size_info(&mut config, &graph); - let corpus_name = corpus_name.unwrap_or_else(|| orig_name.into()); + let corpus_name = corpus_name.unwrap_or(orig_name); let db_path = self.corpus_directory_on_disk(&corpus_name); let mut cache_lock = self.corpus_cache.write()?; @@ -2294,8 +2294,8 @@ impl CorpusStorage { annokeys.push(( node_ref, vec![AnnoKey { - ns: ns.clone().into(), - name: def.name.clone().into(), + ns: ns.clone(), + name: def.name.clone(), }], )); } else { diff --git a/graphannis/src/annis/db/exec/nodesearch.rs b/graphannis/src/annis/db/exec/nodesearch.rs index 6a0ccc08d..1cc9e99db 100644 --- a/graphannis/src/annis/db/exec/nodesearch.rs +++ b/graphannis/src/annis/db/exec/nodesearch.rs @@ -122,13 +122,12 @@ impl NodeSearchSpec { | NodeSearchSpec::NotExactTokenValue { .. } | NodeSearchSpec::RegexTokenValue { .. } | NodeSearchSpec::NotRegexTokenValue { .. } - | NodeSearchSpec::AnyToken => ( - Some(TOKEN_KEY.ns.clone().into()), - Some(TOKEN_KEY.name.clone().into()), - ), + | NodeSearchSpec::AnyToken => { + (Some(TOKEN_KEY.ns.clone()), Some(TOKEN_KEY.name.clone())) + } NodeSearchSpec::AnyNode => ( - Some(NODE_TYPE_KEY.ns.clone().into()), - Some(NODE_TYPE_KEY.name.clone().into()), + Some(NODE_TYPE_KEY.ns.clone()), + Some(NODE_TYPE_KEY.name.clone()), ), } } @@ -550,8 +549,8 @@ impl<'a> NodeSearch<'a> { )), node_search_desc: Arc::new(NodeSearchDesc { qname: ( - Some(NODE_TYPE_KEY.ns.clone().into()), - Some(NODE_TYPE_KEY.name.clone().into()), + Some(NODE_TYPE_KEY.ns.clone()), + Some(NODE_TYPE_KEY.name.clone()), ), cond: vec![filter_func], const_output: Some(NODE_TYPE_KEY.clone()), @@ -923,10 +922,7 @@ impl<'a> NodeSearch<'a> { est_output, )), node_search_desc: Arc::new(NodeSearchDesc { - qname: ( - Some(TOKEN_KEY.ns.clone().into()), - Some(TOKEN_KEY.name.clone().into()), - ), + qname: (Some(TOKEN_KEY.ns.clone()), Some(TOKEN_KEY.name.clone())), cond: filters, const_output: Some(NODE_TYPE_KEY.clone()), }), @@ -981,10 +977,7 @@ impl<'a> NodeSearch<'a> { est_output, )), node_search_desc: Arc::new(NodeSearchDesc { - qname: ( - Some(TOKEN_KEY.ns.clone().into()), - Some(TOKEN_KEY.name.clone().into()), - ), + qname: (Some(TOKEN_KEY.ns.clone()), Some(TOKEN_KEY.name.clone())), cond: filters, const_output: Some(NODE_TYPE_KEY.clone()), }), diff --git a/graphannis/src/annis/db/relannis.rs b/graphannis/src/annis/db/relannis.rs index cbf942e98..7e946ee92 100644 --- a/graphannis/src/annis/db/relannis.rs +++ b/graphannis/src/annis/db/relannis.rs @@ -910,7 +910,7 @@ where .or_insert(1); if *existing_count > 1 { let old_name = name.clone(); - name = format!("{}_duplicated_document_name_{}", name, existing_count).into(); + name = format!("{}_duplicated_document_name_{}", name, existing_count); warn!( "duplicated document name \"{}\" detected: will be renamed to \"{}\"", old_name, name @@ -928,7 +928,7 @@ where CorpusTableEntry { pre: pre_order, post: post_order, - normalized_name: String::from(normalized_name.to_string()), + normalized_name: normalized_name.to_string(), name, }, ); @@ -1050,7 +1050,7 @@ where .to_string(), layer: ordering_layer, component_type: AnnotationComponentType::Ordering.to_string(), - component_name: current_textprop.segmentation.clone().into(), + component_name: current_textprop.segmentation.clone(), })?; } // end if same text @@ -1181,9 +1181,9 @@ fn add_automatic_cov_edge_for_node( .get(&tok_id)? .ok_or(RelAnnisError::NodeNotFound(*tok_id))? .to_string(), - layer: component_layer.into(), + layer: component_layer, component_type: AnnotationComponentType::Coverage.to_string(), - component_name: component_name.into(), + component_name, })?; } } @@ -1461,7 +1461,7 @@ where node_name: node_path.clone(), node_type: "node".to_owned(), })?; - id_to_node_name.insert(node_nr, node_path.clone().into())?; + id_to_node_name.insert(node_nr, node_path.clone())?; if let Some(layer) = layer && !layer.is_empty() @@ -1866,9 +1866,9 @@ where .get(&target)? .ok_or(RelAnnisError::NodeNotFound(target))? .to_string(), - layer: c.layer.clone().into(), + layer: c.layer.clone(), component_type: c.get_type().to_string(), - component_name: c.name.clone().into(), + component_name: c.name.clone(), })?; let pre: u32 = get_field_not_null(&line, 0, "pre", &rank_tab_path)?.parse()?; @@ -1957,7 +1957,7 @@ where .get(&e.target)? .ok_or(RelAnnisError::NodeNotFound(e.target))? .to_string(), - layer: c.layer.clone().into(), + layer: c.layer.clone(), component_type: c.get_type().to_string(), component_name: c.name.to_string(), anno_ns: ns.to_string(), @@ -2030,12 +2030,12 @@ fn get_parent_path(cid: u32, corpus_table: &ParsedCorpusTable) -> Result Result { - let mut result: String = get_parent_path(cid, corpus_table)?.into(); + let mut result: String = get_parent_path(cid, corpus_table)?; let corpus = corpus_table .corpus_by_id .get(&cid) .ok_or(RelAnnisError::CorpusNotFound(cid))?; - result.push_str("/"); + result.push('/'); result.push_str(&corpus.normalized_name); Ok(result) } @@ -2080,9 +2080,9 @@ fn add_subcorpora( for ((entry_cid, anno_key), val) in corpus_id_to_annos.range(start_key..) { if entry_cid == cid { updates.add_event(UpdateEvent::AddNodeLabel { - node_name: corpus_table.toplevel_corpus_name.as_str().into(), - anno_ns: anno_key.ns.clone().into(), - anno_name: anno_key.name.clone().into(), + node_name: corpus_table.toplevel_corpus_name.clone(), + anno_ns: anno_key.ns.clone(), + anno_name: anno_key.name.clone(), anno_value: val.into(), })?; } else { @@ -2132,8 +2132,8 @@ fn add_subcorpora( if entry_cid == corpus_id { updates.add_event(UpdateEvent::AddNodeLabel { node_name: subcorpus_full_name.to_string(), - anno_ns: anno_key.ns.clone().into(), - anno_name: anno_key.name.clone().into(), + anno_ns: anno_key.ns.clone(), + anno_name: anno_key.name.clone(), anno_value: val.clone(), })?; } else { diff --git a/webservice/src/api/corpora.rs b/webservice/src/api/corpora.rs index 604aa1367..2011742ee 100644 --- a/webservice/src/api/corpora.rs +++ b/webservice/src/api/corpora.rs @@ -176,8 +176,8 @@ pub async fn list_components( .into_iter() .map(|c| Component { ctype: c.get_type(), - name: c.name.into(), - layer: c.layer.into(), + name: c.name, + layer: c.layer, }) .collect();