-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: config file parsing and testing (#19)
Co-authored-by: Cyril Matthey-Doret <[email protected]> Co-authored-by: Gabriel Nützi <[email protected]>
- Loading branch information
1 parent
341de0e
commit d440e34
Showing
7 changed files
with
191 additions
and
25 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
use ::std::collections::{HashMap, HashSet}; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Serialize, Deserialize, Debug)] | ||
struct Config { | ||
pub struct Config { | ||
// Replace values of nodes with a certain type. | ||
replace_values_of_nodes_with_type: Vec<String>, | ||
pub replace_uri_of_nodes_with_type: HashSet<String>, | ||
|
||
// Replace values of `subject` & `predicate`. | ||
replace_values_of_subject_predicate: Vec<(String, String)>, | ||
pub replace_values_of_subject_predicate: HashMap<String, HashSet<String>>, | ||
|
||
// Replace values in matched `predicates`. | ||
replace_value_of_predicate: Vec<String>, | ||
pub replace_value_of_predicate: HashSet<String>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
# Hash URIs of people and online accounts. | ||
replace-uris-of-nodes-with-type: | ||
"http://xmlns.com/foaf/0.1/Person" # All nodes which are `rdf:type Person`. | ||
"http://xmlns.com/foaf/OnlineAccount" # or `rdf::type OnlineAccount` | ||
# hash URIs of people and online accounts | ||
replace_uri_of_nodes_with_type: | ||
- "http://xmlns.com/foaf/0.1/Person" # All nodes which are rdf:type Person | ||
- "http://xmlns.com/foaf/OnlineAccount" # "" OnlineAccount | ||
|
||
# Hash name only for instances of person and online account. | ||
replace-values-of-predicate-object: | ||
# hash name only for instances of person and online account | ||
replace_values_of_subject_predicate: | ||
"http://xmlns.com/foaf/OnlineAccount": | ||
"http://schema.org/name" | ||
- "http://schema.org/name" | ||
"http://xmlns.com/foaf/0.1/Person": | ||
"http://schema.org/name" | ||
- "http://schema.org/name" | ||
|
||
# Hash accesscode values for all nodes. | ||
replace-values-of-predicate: | ||
"http://schema.org/accessCode" | ||
# hash accesscode values for all nodes | ||
replace_value_of_predicate: | ||
- "http://schema.org/accessCode" |