Ejemplo n.º 1
0
def _is_ancestor_of(ancestor: str, child: str):
    G = caligraph.get_axiom_graph()
    assert ancestor in G.ancestors(child), f'{ancestor} should be ancestor of {child}'
Ejemplo n.º 2
0
def _is_no_parent_of(parent: str, child: str):
    G = caligraph.get_axiom_graph()
    assert child not in G.children(parent), f'{parent} should not be parent of {child}'
Ejemplo n.º 3
0
def _is_no_resource_of(res: str, node: str):
    G = caligraph.get_axiom_graph()
    if node in G.nodes:
        assert res not in G.get_resources(node), f'{res} should not be contained in {node}'
Ejemplo n.º 4
0
def _is_resource_of(res: str, node: str):
    G = caligraph.get_axiom_graph()
    assert node in G.nodes
    assert res in G.get_resources(node), f'{res} should be contained in {node}'
Ejemplo n.º 5
0
def _is_no_part_of(part: str, node: str):
    G = caligraph.get_axiom_graph()
    if node in G.nodes:
        assert part not in G.get_parts(node), f'{part} should not be part of {node}'
Ejemplo n.º 6
0
def _is_part_of(part: str, node: str):
    G = caligraph.get_axiom_graph()
    assert node in G.nodes
    assert part in G.get_parts(node), f'{part} should be part of {node}'
Ejemplo n.º 7
0
def _is_not_in_graph(node: str):
    G = caligraph.get_axiom_graph()
    assert node not in G.nodes, f'{node} should not be in the graph'