Skip to content

Commit

Permalink
- Changed the way that we represent enums in Python to use propre enu…
Browse files Browse the repository at this point in the history
…ms with default values

- Added `read_shacl_str` and `read_shacl_path` to pyrudof
  • Loading branch information
labra committed Oct 29, 2024
1 parent 6c4e54f commit 67fd7ba
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@

## Current changes without release yet

## [v0.1.45] - 2025-10-29
## [v0.1.47] - 2025-10-29

- Changed the way that we represent enums in Python to use propre enums with default values
- Added `read_shacl_str` and `read_shacl_path` to pyrudof

## [v0.1.46] - 2025-10-29

- Added default values to `pyrudof` to allow a more flexible API
- minor release to include RDFFormat and ReaderMode in export list of `pyrudof`

## [v0.1.45] - 2024-10-29
Expand Down
4 changes: 2 additions & 2 deletions rudof_cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ fn run_validate_shex(
};
let base_iri = config.shex_config().base;
let schema_base = base_iri.as_ref().map(|iri| iri.as_str());
rudof.read_shex(schema_reader, schema_base, &schema_format)?;
rudof.read_shex(schema_reader, &schema_format, schema_base)?;
get_data_rudof(&mut rudof, data, data_format, endpoint, reader_mode, config)?;

let shapemap_format = shapemap_format_convert(shapemap_format);
Expand Down Expand Up @@ -1429,7 +1429,7 @@ fn parse_shex_schema_rudof(
let schema_format = shex_format_convert(schema_format);
let shex_config = config.shex_config();
let base = base_convert(&shex_config.base);
rudof.read_shex(reader, base, &schema_format)?;
rudof.read_shex(reader, &schema_format, base)?;
Ok(())
}

Expand Down
6 changes: 3 additions & 3 deletions rudof_lib/src/rudof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,8 @@ impl Rudof {
pub fn read_shex<R: io::Read>(
&mut self,
reader: R,
base: Option<&str>,
format: &ShExFormat,
base: Option<&str>,
) -> Result<()> {
let schema_json = match format {
ShExFormat::ShExC => {
Expand Down Expand Up @@ -668,7 +668,7 @@ mod tests {
.unwrap();

rudof
.read_shex(shex.as_bytes(), None, &ShExFormat::ShExC)
.read_shex(shex.as_bytes(), &ShExFormat::ShExC, None)
.unwrap();
rudof
.read_shapemap(shapemap.as_bytes(), &ShapeMapFormat::default())
Expand All @@ -695,7 +695,7 @@ mod tests {
.unwrap();

rudof
.read_shex(shex.as_bytes(), None, &ShExFormat::ShExC)
.read_shex(shex.as_bytes(), &ShExFormat::ShExC, None)
.unwrap();
rudof
.read_shapemap(shapemap.as_bytes(), &ShapeMapFormat::default())
Expand Down

0 comments on commit 67fd7ba

Please sign in to comment.