Skip to content

Commit 2c6ae10

Browse files
committed
save
1 parent 575db61 commit 2c6ae10

File tree

20 files changed

+81
-249
lines changed

20 files changed

+81
-249
lines changed

Cargo.lock

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use anyhow::{bail, Context};
44
use clap::Parser;
55
use graphfusion::io::{RdfFormat, RdfParser, RdfSerializer};
66
use graphfusion::model::{GraphName, NamedNode};
7-
use graphfusion::store::Store;
7+
use graphfusion_engine::store::Store;
88
use graphfusion_web::ServerConfig;
99
use std::ffi::OsStr;
1010
use std::fs::File;

lib/graphfusion-engine/engine.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pub struct GraphFusionEngine {
2+
3+
}

lib/graphfusion-engine/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ extern crate core;
33
pub mod error;
44
pub mod results;
55
pub mod sparql;
6-
mod triple_store;
6+
mod quad_storage;
7+
mod planner;
78

8-
pub use triple_store::QuadStorage;
9+
pub use quad_storage::QuadStorage;
10+
pub use planner::GraphFusionPlanner;
911

1012
type DFResult<T> = datafusion::error::Result<T>;

lib/graphfusion-physical/src/planner.rs renamed to lib/graphfusion-engine/src/planner.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use datafusion::execution::SessionState;
55
use datafusion::logical_expr::LogicalPlan;
66
use datafusion::physical_plan::ExecutionPlan;
77
use datafusion::physical_planner::{DefaultPhysicalPlanner, PhysicalPlanner};
8+
use graphfusion_physical::paths::KleenePlusPathPlanner;
89
use std::sync::Arc;
910

1011
#[derive(Debug, Default)]
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
use std::sync::Arc;
2+
use async_trait::async_trait;
3+
use datafusion::common::DataFusionError;
4+
use datafusion::datasource::TableProvider;
5+
use model::{Quad, QuadRef};
6+
7+
#[async_trait]
8+
#[allow(clippy::len_without_is_empty)]
9+
pub trait QuadStorage {
10+
/// Returns the table name of this [QuadStorage]. This name is used to register a table in the
11+
/// DataFusion engine.
12+
async fn table_name(&self) -> &str;
13+
14+
/// Returns the [TableProvider] for this [QuadStorage]. This provider is registered in the
15+
/// DataFusion session and used for planning the execution of queries.
16+
async fn table_provider(&self) -> Arc<dyn TableProvider>;
17+
18+
/// Loads the given quads into the storage.
19+
async fn load_quads(&self, quads: Vec<Quad>) -> Result<usize, DataFusionError>;
20+
21+
/// Removes the given quad from the storage.
22+
async fn remove<'a>(&self, quad: QuadRef<'_>) -> Result<bool, DataFusionError>;
23+
}

lib/graphfusion-engine/src/sparql/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! [SPARQL](https://www.w3.org/TR/sparql11-overview/) implementation.
22
//!
3-
//! Stores execute SPARQL. See [`Store`](crate::store::Store::query()) for an example.
3+
//! Stores execute SPARQL. See [`Store`](graphfusion::store::Store::query()) for an example.
44
55
mod algebra;
66
pub mod error;

lib/graphfusion-engine/src/triple_store.rs

Lines changed: 0 additions & 44 deletions
This file was deleted.

lib/graphfusion-physical/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
extern crate core;
22

33
pub mod paths;
4-
mod planner;
5-
6-
pub use planner::*;
74

85
type DFResult<T> = datafusion::error::Result<T>;

lib/graphfusion-physical/src/paths/kleene_plus/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ mod physical;
22
mod planner;
33

44
pub use physical::KleenePlusClosureExec;
5-
pub(crate) use planner::KleenePlusPathPlanner;
5+
pub use planner::KleenePlusPathPlanner;

0 commit comments

Comments
 (0)