Skip to content

Commit

Permalink
feat: config option and config parser
Browse files Browse the repository at this point in the history
  • Loading branch information
supermaxiste committed Jun 24, 2024
1 parent d28865c commit 606a7a0
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
16 changes: 3 additions & 13 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ rio_turtle = "0.8.4"
rio_api = "0.8.4"
bitflags = "2.5.0"
serde_yml = "0.0.10"
serde_yaml = "0.9.34"
11 changes: 11 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,17 @@ struct PseudoArgs {
/// File descriptor to read input triples from.
/// Defaults to `stdin`.
#[arg(default_value = "-")]

/// The config file descriptor to use for defining RDF elements to pseudonymize.
/// Defaults to `stdin`.
/// Format: yaml
#[arg(short, long, default_value = "-")]
config: PathBuf,

/// The input file descriptor to use for outputting the RDF triples.
/// Defaults to `stdin`.
/// Format: .nt
#[arg(short, long, default_value = "-")]
input: PathBuf,

/// Output file descriptor for pseudonymized triples.
Expand Down
1 change: 1 addition & 0 deletions src/pass_second.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ pub fn pseudonymize_graph(log: &Logger, input: &Path, output: &Path, index: &Pat
let buf_input = io::get_reader(input);
let buf_index = io::get_reader(index);
let mut buf_output = io::get_writer(output);
let config = io::parse_config(config);

let node_to_type: HashMap<String, String> = load_type_map(buf_index);
let mut triples = io::parse_ntriples(buf_input);
Expand Down

0 comments on commit 606a7a0

Please sign in to comment.