pycrap.ontologies.crax.rules
============================

.. py:module:: pycrap.ontologies.crax.rules


Classes
-------

.. autoapisummary::

   pycrap.ontologies.crax.rules.CRAXRule
   pycrap.ontologies.crax.rules.HierarchicalContainment


Module Contents
---------------

.. py:class:: CRAXRule(ontology: owlready2.Ontology = CRAXOntology, ontology_name: str = CRAX_ONTOLOGY_NAME)

   Bases: :py:obj:`abc.ABC`


   A class that represents a rule in PyCRAP.


   .. py:attribute:: all_rules
      :type:  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.



   .. py:attribute:: ontology


   .. py:attribute:: ontology_name


   .. py:property:: rule_in_all_rules


   .. py:method:: _get_old_rule()

      Gets the old rule from the all_rules dictionary.



   .. py:method:: _add_rule()

      Adds the rule to the ontology.



   .. py:property:: name

      :return: The name of the rule



   .. py:property:: rule_body
      :abstractmethod:


      :return: The body of the rule as a string in SWRL syntax.



.. py:class:: HierarchicalContainment(ontology: owlready2.Ontology = CRAXOntology, ontology_name: str = CRAX_ONTOLOGY_NAME)

   Bases: :py:obj:`CRAXRule`


   A rule that asserts that parent objects contain the objects contained by their parts.


   .. py:property:: rule_body

      :return: The body of the rule as a string in SWRL syntax.



