Skip to content

Commit 09f2f3c

Browse files
chore: resolve merge conflicts with master
1 parent 8156e22 commit 09f2f3c

File tree

11 files changed

+41
-45
lines changed

11 files changed

+41
-45
lines changed

python/src/pyrudof_lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,8 +1093,8 @@ impl PyRudof {
10931093
let mode = mode.unwrap_or("shex");
10941094
let reader_mode = cnv_reader_mode(reader_mode);
10951095

1096-
let format = CompareSchemaFormat::from_str(format).map_err(cnv_comparator_err)?;
1097-
let mode = CompareSchemaMode::from_str(mode).map_err(cnv_comparator_err)?;
1096+
let format = InputCompareFormat::from_str(format).map_err(cnv_string_err)?;
1097+
let mode = InputCompareMode::from_str(mode).map_err(cnv_string_err)?;
10981098
let mut reader = schema.as_bytes();
10991099
let coshamo = self
11001100
.inner
@@ -1146,10 +1146,10 @@ impl PyRudof {
11461146
let format2 = format2.unwrap_or("turtle");
11471147
let reader_mode = cnv_reader_mode(reader_mode);
11481148

1149-
let format1 = CompareSchemaFormat::from_str(format1).map_err(cnv_comparator_err)?;
1150-
let format2 = CompareSchemaFormat::from_str(format2).map_err(cnv_comparator_err)?;
1151-
let mode1 = CompareSchemaMode::from_str(mode1).map_err(cnv_comparator_err)?;
1152-
let mode2 = CompareSchemaMode::from_str(mode2).map_err(cnv_comparator_err)?;
1149+
let format1 = InputCompareFormat::from_str(format1).map_err(cnv_string_err)?;
1150+
let format2 = InputCompareFormat::from_str(format2).map_err(cnv_string_err)?;
1151+
let mode1 = InputCompareMode::from_str(mode1).map_err(cnv_string_err)?;
1152+
let mode2 = InputCompareMode::from_str(mode2).map_err(cnv_string_err)?;
11531153
let mut reader1 = schema1.as_bytes();
11541154
let coshamo1 = self
11551155
.inner

rudof_cli/src/commands/service.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ impl Command for ServiceCommand {
4444
ctx.rudof.read_service_description(
4545
&mut reader,
4646
self.args.service.source_name().as_str(),
47-
&rdf_format,
47+
Some(&rdf_format),
4848
base,
49-
&reader_mode,
49+
Some(&reader_mode),
5050
)?;
5151

5252
Ok(())

rudof_cli/src/commands/shacl_validate.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ impl ShaclValidateCommand {
5252
Ok(())
5353
},
5454
ResultShaclValidationFormat::Compact => {
55-
report.show_as_table(writer, sort_mode, false, terminal_width)?;
55+
report.show_as_table(writer, sort_mode, Some(false), Some(terminal_width))?;
5656
Ok(())
5757
},
5858
ResultShaclValidationFormat::Details => {
59-
report.show_as_table(writer, sort_mode, true, terminal_width)?;
59+
report.show_as_table(writer, sort_mode, Some(true), Some(terminal_width))?;
6060
Ok(())
6161
},
6262
ResultShaclValidationFormat::Json => Err(anyhow!(
@@ -118,7 +118,7 @@ impl Command for ShaclValidateCommand {
118118
};
119119

120120
// Perform SHACL validation
121-
let validation_report = ctx.rudof.validate_shacl(&shacl_validation_mode, &shapes_graph_source)?;
121+
let validation_report = ctx.rudof.validate_shacl(Some(&shacl_validation_mode), Some(&shapes_graph_source))?;
122122

123123
// Write the validation report to output
124124
self.write_validation_report(&mut ctx.writer, &result_format, validation_report, &sort_by)?;

rudof_cli/src/commands/shapemap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl Command for ShapemapCommand {
4444

4545
// Write results in the requested format
4646
ctx.rudof
47-
.serialize_shapemap(&result_format, &formatter, &mut ctx.writer)?;
47+
.serialize_shapemap(Some(&result_format), &formatter, &mut ctx.writer)?;
4848

4949
Ok(())
5050
}

rudof_cli/src/commands/shex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl ShexCommand {
6060
) -> Result<()> {
6161
if self.args.show_schema == true {
6262
let formatter = Self::get_formatter(&ctx.color);
63-
ctx.rudof.serialize_current_shex(format, &formatter, &mut ctx.writer)?;
63+
ctx.rudof.serialize_current_shex(Some(format), &formatter, &mut ctx.writer)?;
6464
}
6565
Ok(())
6666
}

rudof_cli/src/commands/shex_validate.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ impl ShexValidateCommand {
3636
match format {
3737
ShapeMapFormat::Compact => {
3838
writeln!(writer, "Result:")?;
39-
result.as_table(writer, sort_by.into(), false, terminal_width())?;
39+
result.as_table(writer, Some(&sort_by.into()), Some(false), Some(terminal_width()))?;
4040
},
4141
ShapeMapFormat::Csv => {
4242
result.as_csv(writer, sort_by.into(), true)?;
@@ -48,7 +48,7 @@ impl ShexValidateCommand {
4848
},
4949
ShapeMapFormat::Details => {
5050
writeln!(writer, "Result:")?;
51-
result.as_table(writer, sort_by.into(), true, terminal_width())?;
51+
result.as_table(writer, Some(&sort_by.into()), Some(true), Some(terminal_width()))?;
5252
},
5353
}
5454
Ok(())

rudof_lib/src/convert.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -509,11 +509,11 @@ pub fn run_shacl_convert(
509509
rudof.read_shacl(
510510
&mut reader,
511511
&input.to_string(),
512-
&input_format,
512+
Some(&input_format),
513513
base.as_deref(),
514-
reader_mode,
514+
Some(reader_mode),
515515
)?;
516516
let output_format = shacl_format_convert(*output_format)?;
517-
rudof.serialize_shacl(&output_format, writer)?;
517+
rudof.serialize_shacl(Some(&output_format), writer)?;
518518
Ok(())
519519
}

rudof_lib/src/rudof.rs

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,8 @@ impl Rudof {
325325
source_name2: Option<&str>,
326326
) -> Result<ShaCo> {
327327
let reader_mode: ReaderMode = reader_mode.into();
328-
let coshamo1 = self.get_coshamo(reader1, &mode1, &format1, base1, &reader_mode, label1, source_name1)?;
329-
let coshamo2 = self.get_coshamo(reader2, &mode2, &format2, base2, &reader_mode, label2, source_name2)?;
328+
let coshamo1 = self.get_coshamo(reader1, &mode1, &format1, base1, Some(&reader_mode), label1, source_name1)?;
329+
let coshamo2 = self.get_coshamo(reader2, &mode2, &format2, base2, Some(&reader_mode), label2, source_name2)?;
330330
Ok(coshamo1.compare(&coshamo2))
331331
}
332332

@@ -1367,10 +1367,10 @@ impl Rudof {
13671367
self.read_data(
13681368
&mut data_reader,
13691369
data_input.source_name().as_str(),
1370-
&rdf_format,
1370+
Some(&rdf_format),
13711371
Some(base.as_str()),
1372-
reader_mode,
1373-
true,
1372+
Some(reader_mode),
1373+
Some(true),
13741374
)?;
13751375
}
13761376
Ok(())
@@ -1422,9 +1422,9 @@ impl Rudof {
14221422
// Read the schema
14231423
self.read_shex(
14241424
schema_reader,
1425-
&schema_format,
1425+
Some(&schema_format),
14261426
Some(base_iri.as_str()),
1427-
reader_mode,
1427+
Some(reader_mode),
14281428
Some(&input.source_name()),
14291429
)?;
14301430

@@ -1642,9 +1642,9 @@ impl Rudof {
16421642
self.read_shacl(
16431643
&mut schema_reader,
16441644
&input.source_name(),
1645-
schema_format,
1645+
Some(schema_format),
16461646
Some(base_iri.as_str()),
1647-
reader_mode,
1647+
Some(reader_mode),
16481648
)?;
16491649

16501650
Ok(())
@@ -1950,7 +1950,7 @@ impl Rudof {
19501950
self.compile_shacl(&ShapesGraphSource::CurrentData)?;
19511951
}
19521952

1953-
self.serialize_shacl(result_format, writer)?;
1953+
self.serialize_shacl(Some(result_format), writer)?;
19541954

19551955
if tracing::enabled!(tracing::Level::DEBUG) {
19561956
match self.get_shacl_ir() {
@@ -2012,7 +2012,7 @@ impl Rudof {
20122012
context: "DCTAP".to_string(),
20132013
error: format!("{e}"),
20142014
})?;
2015-
self.read_dctap(reader, format)?;
2015+
self.read_dctap(reader, Some(format))?;
20162016
Ok(())
20172017
},
20182018
// Excel formats require a file path (cannot read from stdin/URL/string)
@@ -2320,9 +2320,9 @@ mod tests {
23202320
rudof
23212321
.read_shex(
23222322
shex.as_bytes(),
2323-
&ShExFormat::ShExC,
2323+
Some(&ShExFormat::ShExC),
23242324
None,
2325-
&ReaderMode::Strict,
2325+
Some(&ReaderMode::Strict),
23262326
None,
23272327
)
23282328
.unwrap();
@@ -2355,9 +2355,9 @@ mod tests {
23552355
rudof
23562356
.read_shex(
23572357
shex.as_bytes(),
2358-
&ShExFormat::ShExC,
2358+
Some(&ShExFormat::ShExC),
23592359
None,
2360-
&ReaderMode::Strict,
2360+
Some(&ReaderMode::Strict),
23612361
None,
23622362
)
23632363
.unwrap();
@@ -2411,8 +2411,8 @@ mod tests {
24112411
.unwrap();
24122412
let result = rudof
24132413
.validate_shacl(
2414-
&ShaclValidationMode::Native,
2415-
&crate::ShapesGraphSource::CurrentSchema,
2414+
Some(&ShaclValidationMode::Native),
2415+
Some(&crate::ShapesGraphSource::CurrentSchema),
24162416
)
24172417
.unwrap();
24182418
assert!(result.results().is_empty())
@@ -2459,8 +2459,8 @@ mod tests {
24592459
.unwrap();
24602460
let result = rudof
24612461
.validate_shacl(
2462-
&ShaclValidationMode::Native,
2463-
&crate::ShapesGraphSource::CurrentSchema,
2462+
Some(&ShaclValidationMode::Native),
2463+
Some(&crate::ShapesGraphSource::CurrentSchema),
24642464
)
24652465
.unwrap();
24662466
assert!(!result.conforms())
@@ -2496,8 +2496,8 @@ mod tests {
24962496
.unwrap();
24972497
let result = rudof
24982498
.validate_shacl(
2499-
&ShaclValidationMode::Native,
2500-
&crate::ShapesGraphSource::CurrentData,
2499+
Some(&ShaclValidationMode::Native),
2500+
Some(&crate::ShapesGraphSource::CurrentData),
25012501
)
25022502
.unwrap();
25032503
assert!(!result.conforms())
@@ -2533,8 +2533,8 @@ mod tests {
25332533
.unwrap();
25342534
let result = rudof
25352535
.validate_shacl(
2536-
&ShaclValidationMode::Native,
2537-
&crate::ShapesGraphSource::CurrentData,
2536+
Some(&ShaclValidationMode::Native),
2537+
Some(&crate::ShapesGraphSource::CurrentData),
25382538
)
25392539
.unwrap();
25402540
assert!(result.conforms())

shex_ast/src/shapemap/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ pub mod shapemap_config;
1919
pub mod shapemap_error;
2020
pub mod shapemap_state;
2121
pub mod validation_status;
22-
pub mod pattern;
2322

2423
pub use association::*;
2524
pub use conformant_info::*;
@@ -35,7 +34,6 @@ pub use shapemap_config::*;
3534
pub use shapemap_error::*;
3635
pub use shapemap_state::*;
3736
pub use validation_status::*;
38-
pub use pattern::*;
3937

4038
/// Format of Shapemap files
4139
#[derive(Debug, Clone, PartialEq, Default)]

shex_ast/src/shapemap/node_selector.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use crate::object_value::ObjectValue;
22
use crate::shapemap::Pattern;
33
use crate::shapemap::SHACLPathRef;
44
use crate::shapemap::ShapemapError;
5-
use crate::shapemap::Pattern;
65
use iri_s::IriS;
76
use prefixmap::DerefIri;
87
use prefixmap::IriRef;

0 commit comments

Comments
 (0)