Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deprecated rio with oxrdfio #626

Merged
merged 11 commits into from
Mar 6, 2025
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
401 changes: 207 additions & 194 deletions Cargo.lock

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions flake.lock

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

14 changes: 4 additions & 10 deletions nemo-wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,7 @@ pub struct NemoEngine {

#[cfg(feature = "web_sys_unstable_apis")]
fn std_io_error_from_js_value(js_value: JsValue, prefix: &str) -> std::io::Error {
std::io::Error::new(
std::io::ErrorKind::Other,
format!("{prefix}: {js_value:#?}"),
)
std::io::Error::other(format!("{prefix}: {js_value:#?}"))
}

#[cfg(feature = "web_sys_unstable_apis")]
Expand All @@ -240,12 +237,9 @@ impl std::io::Write for SyncAccessHandleWriter {
// Convert to usize safely
let converted_bytes_written = bytes_written as usize;
if converted_bytes_written as f64 != bytes_written {
return Err(std::io::Error::new(
std::io::ErrorKind::Other,
format!(
"Error while converting number of bytes written to usize: {bytes_written:#?}"
),
));
return Err(std::io::Error::other(format!(
"Error while converting number of bytes written to usize: {bytes_written:#?}"
)));
}

Ok(converted_bytes_written)
Expand Down
5 changes: 2 additions & 3 deletions nemo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ flate2 = "1"
sanitise-file-name = "1.0.0"
getrandom = { version = "0.2.9", default-features = false }
path-slash = "0.2.1"
rio_api = "0.8.4"
rio_turtle = "0.8.4"
rio_xml = "0.8.4"
oxiri = "0.2.2"
tokio = { version = "1.40.0", features = ["rt"] }
reqwest = { version = "0.12.2", features = ["gzip", "brotli", "zstd", "deflate"] }
Expand All @@ -49,6 +46,8 @@ strum_macros = "0.26.4"
similar-string = "1.4.3"
bytecount = "0.6.8"
colored = "2"
oxrdfio = "0.1.6"
oxrdf = "0.2.4"

[dev-dependencies]
env_logger = "*"
Expand Down
8 changes: 5 additions & 3 deletions nemo/src/chase_model/analysis/variable_order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,11 @@ impl VariableOrderBuilder<'_> {
let (idb_count_b, edb_count_b) =
self.get_already_present_idb_edb_count_for_rule_in_tries(rule_b);

(idb_count_a != idb_count_b)
.then(|| idb_count_a.cmp(&idb_count_b))
.unwrap_or_else(|| edb_count_a.cmp(&edb_count_b))
if idb_count_a != idb_count_b {
idb_count_a.cmp(&idb_count_b)
} else {
edb_count_a.cmp(&edb_count_b)
}
})
.expect("the remaining rules are never empty here");

Expand Down
2 changes: 1 addition & 1 deletion nemo/src/io/formats/rdf.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Handler for resources of type RDF (Rsource Description Format).
//! Handler for resources of type RDF (Resource Description Format).

#![allow(missing_docs)]

Expand Down
7 changes: 0 additions & 7 deletions nemo/src/io/formats/rdf/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@ pub enum RdfFormatError {
/// Error of encountering RDF* features in data
#[error("RDF* terms are not supported")]
RdfStarUnsupported,
/// Error in Rio's Turtle parser
#[error(transparent)]
RioTurtle(#[from] rio_turtle::TurtleError),
/// Error in Rio's RDF/XML parser
#[error(transparent)]
RioXml(#[from] rio_xml::RdfXmlError),
/// Unable to determine RDF format.
#[error("could not determine which RDF parser to use for resource {0}")]
UnknownRdfFormat(Resource),
}
Loading