pycram.ontomatic.performables_to_ontology#

Classes#

ParameterDigest

Encapsulation of meta information about a parameter.

ActionAbstractDigest

Wrap all information about an action abstract class that are necessary for the created ontology.

Functions#

create_ontology_from_performables(→ None)

Create an ontology from the performables.

Module Contents#

class pycram.ontomatic.performables_to_ontology.ParameterDigest#

Encapsulation of meta information about a parameter.

clazz: typing_extensions.Any#

Class of the parameter.

name: str#

Name of the parameter.

docstring: str#

Docstring of the parameter itself (individual to each performable).

default_value: typing_extensions.Optional[typing_extensions.Any]#

Holds the default value of the parameter if set.

property docstring_of_clazz: str#
property is_enum: bool#
property is_optional: bool#
get_default_value() typing_extensions.Optional[typing_extensions.List[str]]#
Returns:

A list containing the string representation of the default value or None if no default value exists.

class pycram.ontomatic.performables_to_ontology.ActionAbstractDigest(clazz: typing_extensions.Type[pycram.designator.ActionDescription])#

Wrap all information about an action abstract class that are necessary for the created ontology.

clazz: typing_extensions.Type[pycram.designator.ActionDescription]#
full_name: str#
classname: str#
docstring: str#
parameters: typing_extensions.Optional[typing_extensions.List[ParameterDigest]] = []#
extract_dataclass_parameter_information() typing_extensions.List[ParameterDigest]#

Extract information about dataclass parameters from a dataclass.

Returns:

List of parameter information.

pycram.ontomatic.performables_to_ontology.create_ontology_from_performables(output_path: pathlib.Path = './performables.owl', abstract_actions_to_parse: typing_extensions.Union[typing_extensions.List[typing_extensions.Type[pycram.designator.ActionDescription]], typing_extensions.Type[pycram.designator.ActionDescription]] = None) None#

Create an ontology from the performables.

Parameters:
  • output_path – Path of the output ontology file.

  • abstract_actions_to_parse – ActionAbstract classes to parse.

If not set, all subclasses of ActionAbstract will be parsed.