Skip to content

Commit

Permalink
add part-of
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinKl committed Jan 19, 2024
1 parent 174841d commit 9946c3a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/importer/opus/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use graphannis::{
model::AnnotationComponentType,
update::{GraphUpdate, UpdateEvent},
};
use graphannis_core::graph::ANNIS_NS;
use serde_derive::Deserialize;
use xml::{EventReader, ParserConfig};

Expand Down Expand Up @@ -87,10 +88,24 @@ impl ImportOpusLinks {
node_name: source_id.to_string(),
node_type: "node".to_string(),
})?;
update.add_event(UpdateEvent::AddEdge {
source_node: source_id.to_string(),
target_node: source_doc_node_id.to_string(),
layer: ANNIS_NS.to_string(),
component_type: AnnotationComponentType::PartOf.to_string(),
component_name: "".to_string(),
})?;
update.add_event(UpdateEvent::AddNode {
node_name: target_id.to_string(),
node_type: "node".to_string(),
})?;
update.add_event(UpdateEvent::AddEdge {
source_node: target_id.to_string(),
target_node: target_doc_node_id.to_string(),
layer: ANNIS_NS.to_string(),
component_type: AnnotationComponentType::PartOf.to_string(),
component_name: "".to_string(),
})?;
update.add_event(UpdateEvent::AddEdge {
source_node: source_id.to_string(),
target_node: target_id.to_string(),
Expand Down

0 comments on commit 9946c3a

Please sign in to comment.