Skip to content

Commit

Permalink
Feature/366 body arithmetic (#371)
Browse files Browse the repository at this point in the history
* Rework data structures for arithmetic operations


* Add more general data structure for conditions

* Reworking the rule and chase model (WIP)

* Change rule model to allow for complex terms in more places

* Improve chase rule model

* Update code to reflect the new rule model

* Fix bugs and documentation

* Split Term and Condition Enum into sub structures

* Fix doc string

* Add support for predefined unary arithmetic functions

* Add test cases aissignment, complex body arithmetic

* Remove assignment operator

* Implement suggestions

* Restrict the use of derived variables in conditions

---------

Co-authored-by: Alex Ivliev <alex.ivliev@tu-dresden.de>
  • Loading branch information
Alex Ivliev and aannleax authored Oct 16, 2023
1 parent cd8078e commit 88f52ad
Show file tree
Hide file tree
Showing 66 changed files with 4,525 additions and 2,882 deletions.
7 changes: 4 additions & 3 deletions nemo-benches/benches/input.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use criterion::{criterion_group, criterion_main, BatchSize, Criterion};
use nemo::{
builder_proxy::{LogicalAnyColumnBuilderProxy, LogicalStringColumnBuilderProxy},
model::Term,
model::{Constant, Identifier},
};
use nemo_physical::{
builder_proxy::{
Expand All @@ -26,7 +26,7 @@ pub fn benchmark_input(c: &mut Criterion) {
.collect::<Vec<_>>();
let terms = strings
.iter()
.map(|s| Term::Constant(format!("http://example.org/{s}").into()))
.map(|s| Constant::Abstract(Identifier::new(format!("http://example.org/{s}"))))
.collect::<Vec<_>>();
let iris = terms.iter().map(|t| t.to_string()).collect::<Vec<_>>();

Expand Down Expand Up @@ -77,7 +77,8 @@ pub fn benchmark_input(c: &mut Criterion) {
|(input, dict)| {
let mut pcbp =
PhysicalBuilderProxyEnum::String(PhysicalStringColumnBuilderProxy::new(&dict));
let mut lcbp = LogicalAnyColumnBuilderProxy::new(&mut pcbp).into_parser::<Term>();
let mut lcbp =
LogicalAnyColumnBuilderProxy::new(&mut pcbp).into_parser::<Constant>();
for iri in input {
lcbp.add(iri).unwrap();
}
Expand Down
6 changes: 6 additions & 0 deletions nemo-physical/src/columnar/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,9 @@ pub use columnscan_cast::ColumnScanCastEnum;
/// Module for defining [`ColumnScanArithmetic`].
pub mod columnscan_arithmetic;
pub use columnscan_arithmetic::ColumnScanArithmetic;

/// Module defining data structures for working with numeric expressions
pub mod arithmetic;

/// Module defining data structures for working with conditions
pub mod condition;
2 changes: 2 additions & 0 deletions nemo-physical/src/columnar/operations/arithmetic.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pub mod expression;
pub mod traits;
Loading

0 comments on commit 88f52ad

Please sign in to comment.