lsp_core/feature/
parse.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
use bevy_ecs::{
    schedule::{IntoSystemConfigs, ScheduleLabel},
    system::Resource,
    world::World,
};

pub use crate::systems::{
    derive_classes, derive_prefix_links, derive_properties, derive_shapes, extract_type_hierarchy,
    fetch_lov_properties, infer_types,
};
use crate::{
    client::Client,
    systems::{check_added_ontology_extract, derive_owl_imports_links},
};

/// Parse schedule barrier, after this system, triples should be derived
pub fn triples() {}
/// Parse schedule barrier, after this system, prefixes should be derived
pub fn prefixes() {}

/// [`ScheduleLabel`] related to the Parse schedule
#[derive(ScheduleLabel, Clone, Eq, PartialEq, Debug, Hash)]
pub struct Label;

pub fn setup_schedule<C: Client + Resource>(world: &mut World) {
    let mut parse_schedule = bevy_ecs::schedule::Schedule::new(Label);
    parse_schedule.add_systems((
        prefixes,
        triples,
        derive_prefix_links.after(prefixes),
        derive_owl_imports_links.after(triples),
        derive_classes.after(triples),
        derive_properties.after(triples),
        fetch_lov_properties::<C>.after(prefixes),
        extract_type_hierarchy.after(triples),
        infer_types.after(triples),
        derive_shapes.after(triples),
        check_added_ontology_extract.after(triples),
    ));
    world.add_schedule(parse_schedule);
}