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

build(deps): bump sophia from 0.7.2 to 0.8.0 #118

Merged
merged 4 commits into from
Aug 13, 2024
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
127 changes: 60 additions & 67 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion dsp-meta/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ serde_yaml.workspace = true
nonempty.workspace = true
valico.workspace = true
regex.workspace = true
sophia = "0.7.2"
sophia = "0.8.0"
tokio.workspace = true
tower.workspace = true
tower-http.workspace = true
Expand Down
10 changes: 2 additions & 8 deletions dsp-meta/src/api/convert/rdf/error.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
use crate::error::DspMetaError;

impl From<sophia::iri::error::InvalidIri> for DspMetaError {
fn from(error: sophia::iri::error::InvalidIri) -> Self {
impl From<sophia::iri::InvalidIri> for DspMetaError {
fn from(error: sophia::iri::InvalidIri) -> Self {

Check warning on line 4 in dsp-meta/src/api/convert/rdf/error.rs

View check run for this annotation

Codecov / codecov/patch

dsp-meta/src/api/convert/rdf/error.rs#L4

Added line #L4 was not covered by tests
DspMetaError::SerializeToRdf(error.0)
}
}

impl From<sophia::term::TermError> for DspMetaError {
fn from(error: sophia::term::TermError) -> Self {
DspMetaError::SerializeToRdf(error.to_string())
}
}
24 changes: 14 additions & 10 deletions dsp-meta/src/api/convert/rdf/project.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// placeholder for project

use dsp_domain::metadata::entity::project::Project;
use sophia::graph::inmem::LightGraph;
use sophia::graph::{Graph, MutableGraph};
use sophia::ns::{rdf, Namespace};
use sophia::term::SimpleIri;
use sophia::api::graph::{Graph, MutableGraph};
use sophia::api::ns::{rdf, Namespace};
use sophia::inmem::graph::LightGraph;
use sophia::iri::Iri;

use crate::api::convert::rdf::constance::DSP_NAMESPACE_STRING;
use crate::api::convert::rdf::value::shortcode::ShortcodeGraphDto;
Expand All @@ -15,17 +15,21 @@
let mut graph = LightGraph::new();

// http://ns.dasch.swiss/repository#dsp-081C-project a http://ns.dasch.swiss/repository#Project
let dsp = Namespace::new_unchecked(DSP_NAMESPACE_STRING);
let project_iri_suffix = format!("dsp-{}-project", self.0.shortcode.0);
let project_iri = SimpleIri::new_unchecked(dsp.as_ref(), Some(project_iri_suffix.as_str()));
let project_class = SimpleIri::new_unchecked(dsp.as_ref(), Some("Project"));
let ns = Namespace::new_unchecked(DSP_NAMESPACE_STRING);

Check warning on line 18 in dsp-meta/src/api/convert/rdf/project.rs

View check run for this annotation

Codecov / codecov/patch

dsp-meta/src/api/convert/rdf/project.rs#L18

Added line #L18 was not covered by tests

let shortcode_graph = ShortcodeGraphDto(&self.0.shortcode).to_graph(&project_iri);
let project_iri = ns
.get(format!("{}dsp-{}-project", ns.as_str(), self.0.shortcode.0).as_str())
.expect("project_iri creation failed.")
.to_string();
let project_iri = Iri::new(project_iri).expect("project_iri creation failed.");

let project_class = ns.get("Project").expect("project_class creation failed.");

Check warning on line 26 in dsp-meta/src/api/convert/rdf/project.rs

View check run for this annotation

Codecov / codecov/patch

dsp-meta/src/api/convert/rdf/project.rs#L20-L26

Added lines #L20 - L26 were not covered by tests

graph
.insert(&project_iri, &rdf::type_, &project_class)
.insert(&project_iri, rdf::type_, project_class)

Check warning on line 29 in dsp-meta/src/api/convert/rdf/project.rs

View check run for this annotation

Codecov / codecov/patch

dsp-meta/src/api/convert/rdf/project.rs#L29

Added line #L29 was not covered by tests
.expect("insert of project triples into graph failed.");

let shortcode_graph = ShortcodeGraphDto(&self.0.shortcode).to_graph(&project_iri);

Check warning on line 32 in dsp-meta/src/api/convert/rdf/project.rs

View check run for this annotation

Codecov / codecov/patch

dsp-meta/src/api/convert/rdf/project.rs#L32

Added line #L32 was not covered by tests
graph
.insert_all(shortcode_graph.triples())
.expect("insert of project triples into graph failed.");
Expand Down
Loading