Skip to content

Commit

Permalink
Fix iteration over multiple values
Browse files Browse the repository at this point in the history
  • Loading branch information
ckindermann committed Dec 12, 2024
1 parent 643dc36 commit 0578a50
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions src/ofn_2_ldtab/axiom_translation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ pub fn translate_rule(v: &Value) -> Value {
//TODO: we should hash the LDTab representation
let mut hasher = DefaultHasher::new();
v.hash(&mut hasher);
let blank_node = format!("_:gen{}", hasher.finish());
let blank_node = format!("<wiring:gen{}>", hasher.finish());

let owl = annotation_translation::get_owl(v);
let ofn_annotations = annotation_translation::get_annotations(v);
Expand Down Expand Up @@ -1131,19 +1131,24 @@ pub fn translate_rule(v: &Value) -> Value {

for (key,value) in obj {

let annotation = json!({
"assertion":"1",
"retraction":"0",
"graph":"graph",
"subject": blank_node,
"predicate":key,
"object":value["object"],
"datatype":value["datatype"],
"annotation": Value::Null
});
if let Some(list) = value.as_array(){

for e in list {

let annotation = json!({
"assertion":"1",
"retraction":"0",
"graph":"graph",
"subject": blank_node,
"predicate":key,
"object":e["object"],
"datatype":e["datatype"],
"annotation": Value::Null
});

triples.push(annotation);
triples.push(annotation);
}
}
}
}

Expand Down

0 comments on commit 0578a50

Please sign in to comment.