pycrap.ontologies.crax.rules#
Classes#
A class that represents a rule in PyCRAP. |
|
A rule that asserts that parent objects contain the objects contained by their parts. |
Module Contents#
- class pycrap.ontologies.crax.rules.CRAXRule(ontology: owlready2.Ontology = CRAXOntology, ontology_name: str = CRAX_ONTOLOGY_NAME)#
Bases:
abc.ABCA class that represents a rule in PyCRAP.
- all_rules: typing_extensions.Dict[owlready2.Ontology, typing_extensions.Dict[typing_extensions.Type[CRAXRule], CRAXRule]]#
A dictionary that maps ontology rule classes to rule instances, so that the same rule is not created multiple times.
- ontology#
- ontology_name#
- property rule_in_all_rules#
- _get_old_rule()#
Gets the old rule from the all_rules dictionary.
- _add_rule()#
Adds the rule to the ontology.
- property name#
- Returns:
The name of the rule
- abstract property rule_body#
- Returns:
The body of the rule as a string in SWRL syntax.
- class pycrap.ontologies.crax.rules.HierarchicalContainment(ontology: owlready2.Ontology = CRAXOntology, ontology_name: str = CRAX_ONTOLOGY_NAME)#
Bases:
CRAXRuleA rule that asserts that parent objects contain the objects contained by their parts.
- property rule_body#
- Returns:
The body of the rule as a string in SWRL syntax.