Skip to content

Commit 305ce67

Browse files
Merge pull request #129 from casework/dependabot/cargo/rust/case2geojson/oxigraph-0.5.2
Bump oxigraph from 0.4.9 to 0.5.2 in /rust/case2geojson
2 parents d656260 + 9d4cdb0 commit 305ce67

3 files changed

Lines changed: 99 additions & 36 deletions

File tree

rust/case2geojson/Cargo.lock

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

rust/case2geojson/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ edition = "2021"
77
geojson = "0.24.1"
88
iref = "3.2.2"
99
json-ld = { git = "https://github.com/miterst/json-ld.git", rev = "6b48152595b661ae5ada46747e15f373e698d151" }
10-
oxigraph = { version = "0.4.1", default-features = false}
10+
oxigraph = { version = "0.5.2", default-features = false}
1111
serde_json = "1.0.145"
1212
static-iref = "3.0.0"
1313
tokio = { version = "1.48.0", features = ["macros", "rt-multi-thread", "test-util"] }

rust/case2geojson/src/main.rs

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use json_ld::{
2626
JsonLdProcessor, RemoteDocument,
2727
};
2828
use oxigraph::model::{GraphNameRef, LiteralRef, NamedNodeRef, QuadRef};
29-
use oxigraph::sparql::QueryResults;
29+
use oxigraph::sparql::{QueryResults, SparqlEvaluator};
3030
use oxigraph::store::Store;
3131
use static_iref::iri;
3232
use std::{env, fs};
@@ -153,7 +153,13 @@ WHERE
153153
"#;
154154

155155
// SPARQL query
156-
if let QueryResults::Solutions(solutions) = store.query(query).unwrap() {
156+
if let QueryResults::Solutions(solutions) = SparqlEvaluator::new()
157+
.parse_query(query)
158+
.expect("SPARQL syntax expected to be OK")
159+
.on_store(&store)
160+
.execute()
161+
.expect("SPARQL expected to execute")
162+
{
157163
for option_solution in solutions {
158164
let solution = option_solution.unwrap();
159165

@@ -387,8 +393,8 @@ mod tests {
387393
);
388394

389395
let store = Store::new()?;
390-
assert!(store.insert(quad0)?);
391-
assert!(!store.insert(quad1)?);
396+
store.insert(quad0)?;
397+
store.insert(quad1)?;
392398

393399
assert!(store.contains(quad2)?);
394400
Result::<_, Box<dyn std::error::Error>>::Ok(())
@@ -425,7 +431,13 @@ WHERE {
425431
))?;
426432

427433
// SPARQL query
428-
if let QueryResults::Solutions(mut solutions) = store.query(query)? {
434+
if let QueryResults::Solutions(mut solutions) = SparqlEvaluator::new()
435+
.parse_query(query)
436+
.expect("SPARQL syntax expected to be OK")
437+
.on_store(&store)
438+
.execute()
439+
.expect("SPARQL expected to execute")
440+
{
429441
assert_eq!(
430442
solutions.next().unwrap()?.get("nLocation"),
431443
Some(&n_kb_location.into_owned().into())

0 commit comments

Comments
 (0)