Skip to content

Commit

Permalink
Some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
magbak committed Jan 27, 2024
1 parent 1e5f81e commit 6c155f7
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 23 deletions.
2 changes: 1 addition & 1 deletion triplestore/src/sparql/lazy_aggregate.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::Triplestore;
use crate::sparql::errors::SparqlError;
use oxrdf::Variable;
use polars_core::frame::DataFrame;

use query_processing::aggregates::{
avg, count_with_expression, count_without_expression, group_concat, max, min, sample, sum,
AggregateReturn,
Expand Down
2 changes: 1 addition & 1 deletion triplestore/src/sparql/lazy_expressions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::collections::HashMap;
use crate::sparql::errors::SparqlError;
use oxrdf::vocab::xsd;
use polars::prelude::{col, Expr, LiteralValue, Operator};
use polars_core::frame::DataFrame;

use query_processing::exists_helper::rewrite_exists_graph_pattern;
use query_processing::expressions::{
binary_expression, bound, coalesce_expression, exists, func_expression, if_expression,
Expand Down
2 changes: 1 addition & 1 deletion triplestore/src/sparql/lazy_graph_patterns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ mod values;
use super::Triplestore;
use crate::sparql::errors::SparqlError;
use log::{debug, info};
use polars_core::frame::DataFrame;

use representation::query_context::{Context, PathEntry};
use representation::solution_mapping::{EagerSolutionMappings, SolutionMappings};
use spargebra::algebra::GraphPattern;
Expand Down
2 changes: 1 addition & 1 deletion triplestore/src/sparql/lazy_graph_patterns/extend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use super::Triplestore;
use crate::sparql::errors::SparqlError;
use log::debug;
use oxrdf::Variable;
use polars_core::frame::DataFrame;

use query_processing::graph_patterns::extend;
use representation::query_context::{Context, PathEntry};
use representation::solution_mapping::{EagerSolutionMappings, SolutionMappings};
Expand Down
2 changes: 1 addition & 1 deletion triplestore/src/sparql/lazy_graph_patterns/filter.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::Triplestore;
use crate::sparql::errors::SparqlError;
use log::debug;
use polars_core::frame::DataFrame;

use query_processing::graph_patterns::filter;
use representation::query_context::{Context, PathEntry};
use representation::solution_mapping::{EagerSolutionMappings, SolutionMappings};
Expand Down
2 changes: 1 addition & 1 deletion triplestore/src/sparql/lazy_graph_patterns/group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use super::Triplestore;
use crate::sparql::errors::SparqlError;
use log::debug;
use oxrdf::Variable;
use polars_core::frame::DataFrame;

use query_processing::aggregates::AggregateReturn;
use query_processing::graph_patterns::{group_by, prepare_group_by};
use representation::query_context::{Context, PathEntry};
Expand Down
2 changes: 1 addition & 1 deletion triplestore/src/sparql/lazy_graph_patterns/join.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::Triplestore;
use crate::sparql::errors::SparqlError;
use log::debug;
use polars_core::frame::DataFrame;

use representation::query_context::{Context, PathEntry};
use representation::solution_mapping::{EagerSolutionMappings, SolutionMappings};
use std::collections::HashMap;
Expand Down
2 changes: 1 addition & 1 deletion triplestore/src/sparql/lazy_graph_patterns/left_join.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::Triplestore;
use crate::sparql::errors::SparqlError;
use log::debug;
use polars_core::frame::DataFrame;

use query_processing::graph_patterns::{filter, left_join};
use representation::query_context::{Context, PathEntry};
use representation::solution_mapping::{EagerSolutionMappings, SolutionMappings};
Expand Down
2 changes: 1 addition & 1 deletion triplestore/src/sparql/lazy_graph_patterns/minus.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::Triplestore;
use crate::sparql::errors::SparqlError;
use log::debug;
use polars_core::frame::DataFrame;

use query_processing::graph_patterns::minus;
use representation::query_context::{Context, PathEntry};
use representation::solution_mapping::{EagerSolutionMappings, SolutionMappings};
Expand Down
2 changes: 1 addition & 1 deletion triplestore/src/sparql/lazy_graph_patterns/order_by.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::Triplestore;
use crate::sparql::errors::SparqlError;
use log::debug;
use polars_core::frame::DataFrame;

use query_processing::graph_patterns::order_by;
use representation::query_context::{Context, PathEntry};
use representation::solution_mapping::{EagerSolutionMappings, SolutionMappings};
Expand Down
2 changes: 1 addition & 1 deletion triplestore/src/sparql/lazy_graph_patterns/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use super::Triplestore;
use crate::sparql::errors::SparqlError;
use log::debug;
use oxrdf::Variable;
use polars_core::frame::DataFrame;

use query_processing::graph_patterns::project;
use representation::query_context::{Context, PathEntry};
use representation::solution_mapping::{EagerSolutionMappings, SolutionMappings};
Expand Down
20 changes: 11 additions & 9 deletions triplestore/src/sparql/lazy_graph_patterns/pvalues.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@ use super::Triplestore;
use crate::sparql::errors::SparqlError;
use oxrdf::Variable;
use polars::prelude::IntoLazy;
use polars_core::frame::DataFrame;

use query_processing::graph_patterns::join;
use representation::query_context::Context;
use representation::solution_mapping::{EagerSolutionMappings, SolutionMappings};
use representation::sparql_to_polars::{
polars_literal_values_to_series, sparql_literal_to_polars_literal_value,
sparql_named_node_to_polars_literal_value,
};
use representation::RDFNodeType;
use spargebra::term::GroundTerm;
use std::collections::HashMap;



use std::collections::{HashMap, HashSet};

impl Triplestore {
pub(crate) fn lazy_pvalues(
Expand All @@ -29,7 +26,12 @@ impl Triplestore {
rdf_node_types,
}) = parameters.get(bindings_name)
{
//Todo! Check that variables are in df..
let mapping_vars:HashSet<_> = mappings.get_column_names().into_iter().collect();
let expected_vars: HashSet<_> = variables.iter().map(|x|x.as_str()).collect();
if mapping_vars != expected_vars {
todo!("Handle mismatching variables in PValues")
}

SolutionMappings {
mappings: mappings.clone().lazy(),
rdf_node_types: rdf_node_types.clone(),
Expand Down
2 changes: 1 addition & 1 deletion triplestore/src/sparql/lazy_graph_patterns/union.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::Triplestore;
use crate::sparql::errors::SparqlError;
use log::debug;
use polars_core::frame::DataFrame;

use query_processing::graph_patterns::union;
use representation::query_context::{Context, PathEntry};
use representation::solution_mapping::{EagerSolutionMappings, SolutionMappings};
Expand Down
2 changes: 1 addition & 1 deletion triplestore/src/sparql/lazy_graph_patterns/values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use polars::prelude::IntoLazy;
use polars_core::frame::DataFrame;
use query_processing::graph_patterns::join;
use representation::query_context::Context;
use representation::solution_mapping::{EagerSolutionMappings, SolutionMappings};
use representation::solution_mapping::{SolutionMappings};
use representation::sparql_to_polars::{
polars_literal_values_to_series, sparql_literal_to_polars_literal_value,
sparql_named_node_to_polars_literal_value,
Expand Down
2 changes: 1 addition & 1 deletion triplestore/src/sparql/lazy_order.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::Triplestore;
use crate::sparql::errors::SparqlError;
use polars_core::frame::DataFrame;

use representation::query_context::{Context, PathEntry};
use representation::solution_mapping::{EagerSolutionMappings, SolutionMappings};
use spargebra::algebra::OrderExpression;
Expand Down

0 comments on commit 6c155f7

Please sign in to comment.