Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ md-5 = "0.11.0"
sha1 = "0.11.0"
hex = "0.4.3"
memchr = "2.8.0"
quick-xml = "0.39.2"

tracing = { version = "0.1", features = [ "log" ] }
tracing-subscriber = { version = "0.3.19", features = [ "env-filter" ] }
Expand Down
24 changes: 19 additions & 5 deletions lib/cimxml_import/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
use oxrdf::{GraphName, NamedOrBlankNode, Quad, Term};
use oxrdf::{GraphName, NamedNode, NamedOrBlankNode, Quad, Term};
use std::collections::HashMap;
use representation::BaseRDFNodeTypeRef;

type MapType = HashMap<String, HashMap<String, (Vec<NamedOrBlankNode>, Vec<Term>)>>;

pub fn remap_predicate_datatype(
_predicate_map: HashMap<GraphName, HashMap<String, MapType>>,
) -> HashMap<GraphName, HashMap<String, MapType>> {
unimplemented!("Contact Data Treehouse to try!")
pub struct Remapper {
}

impl Remapper {
pub fn new() -> Self {
Remapper {
}
}

pub fn remap_predicate_datatype<'a>(
&'a self,
_predicate: &NamedNode,
_data_type: &BaseRDFNodeTypeRef<'a>,
) -> BaseRDFNodeTypeRef<'a> {
unimplemented!("Contact Data Treehouse to try!")
}
}

pub fn fix_cim_quad(_quad: Quad, _base_iri: Option<&String>) -> Quad {
Expand Down
1 change: 0 additions & 1 deletion lib/in_memory/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![feature(pattern)]
#![feature(str_as_str)]

use arrow::array::{Array, RecordBatch, StringArray, UInt32Array};
use arrow::datatypes::{Field, Schema};
Expand Down
29 changes: 29 additions & 0 deletions lib/maplib/src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,35 @@ impl Model {
.map_err(MaplibError::TriplestoreError)
}

#[instrument(skip_all)]
pub fn map_xml_path(
&mut self,
path: &Path,
graph: &NamedGraph,
transient: bool,
) -> Result<(), MaplibError> {
self.add_json_prefixes();
let mut u8s = fs::read(path).map_err(|x| TriplestoreError::XMLError(x.to_string()))?;
self.triplestore
.map_xml(&mut u8s, graph, transient)
.map_err(MaplibError::TriplestoreError)
}

#[instrument(skip_all)]
pub fn map_xml_string(
&mut self,
mut p: String,
graph: &NamedGraph,
transient: bool,
) -> Result<(), MaplibError> {
self.add_json_prefixes();
//Safety: we are never reading this vec back to a string
let u8s = unsafe { p.as_mut_vec() };
self.triplestore
.map_xml(u8s, graph, transient)
.map_err(MaplibError::TriplestoreError)
}

#[allow(clippy::too_many_arguments)]
#[instrument(skip_all)]
pub fn read_triples(
Expand Down
2 changes: 1 addition & 1 deletion lib/query_processing/src/expressions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use oxrdf::vocab::{rdf, xsd};
use oxrdf::{BlankNode, Literal, NamedNode, Variable};
use polars::frame::UniqueKeepStrategy;
use polars::prelude::{
as_struct, by_name, coalesce, col, lit, DataType, Expr, IntoLazy, JoinArgs, JoinType,
as_struct, by_name, coalesce, col, lit, DataType, Expr, JoinArgs, JoinType,
LazyFrame, LiteralValue, Operator, Scalar,
};
use representation::cats::{maybe_decode_expr, Cats, LockedCats};
Expand Down
1 change: 1 addition & 0 deletions lib/representation/src/cats/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ impl CatEncs {
let mut uch: Vec<_> = ser.u32()?.iter().collect();
let mut need_global = true;
//Just a trick for the unlocked local to live long enough
#[allow(unused_assignments)]
let mut unlocked_local = None;
let decoded_local_vec = if let Some(local_cats) = &local_cats {
unlocked_local = Some(local_cats.read().unwrap());
Expand Down
2 changes: 2 additions & 0 deletions lib/representation/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ pub enum RepresentationError {
DatatypeError(String),
#[error("Invalid literal `{0}`")]
InvalidLiteralError(String),
#[error("Literal parse error `{0}`")]
LiteralParseError(String),
}
2 changes: 2 additions & 0 deletions lib/representation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ pub mod rdf_to_polars;
mod rdf_type;
pub mod solution_mapping;
pub mod subtypes;
pub mod series_builder;
pub use series_builder::SeriesBuilder;

pub use base_rdf_type::*;
pub use rdf_state::*;
Expand Down
Loading
Loading