Probabilistic Relational Models
For now, pyAgrum only allows to explore Probabilistic Relational Models written with o3prm syntax (see O3PRM website).
class pyagrum.PRMexplorer
Section titled “class pyagrum.PRMexplorer”PRMexplorer helps navigate through probabilistic relational models.
PRMexplorer() -> PRMexplorer : default constructor
property aggType
Section titled “property aggType”min/max/count/exists/forall/or/and/amplitude/median
classAggregates(class_name)
Section titled “classAggregates(class_name)”- Parameters: class_name (str) – a class name
- Returns: the list of aggregates in the class
- Return type: list
- Raises: pyagrum.IndexError – If the class is not in the PRM
classAttributes(class_name)
Section titled “classAttributes(class_name)”- Parameters: class_name (str) – a class name
- Returns: the list of attributes
- Return type: list
- Raises: pyagrum.IndexError – If the class is not in the PRM
classDag(class_name)
Section titled “classDag(class_name)”- Parameters: class_name (str) – a class name
- Returns: a description of the DAG
- Return type: tuple
- Raises: pyagrum.IndexError – If the class is not in the PRM
classImplements(class_name)
Section titled “classImplements(class_name)”- Parameters: class_name (str) – a class name
- Returns: the list of interfaces implemented by the class
- Return type: list
classParameters(class_name)
Section titled “classParameters(class_name)”- Parameters: class_name (str) – a class name
- Returns: the list of parameters
- Return type: list
- Raises: pyagrum.IndexError – If the class is not in the PRM
classReferences(class_name)
Section titled “classReferences(class_name)”- Parameters: class_name (str) – a class name
- Returns: the list of references
- Return type: list
- Raises: pyagrum.IndexError – If the class is not in the PRM
classSlotChains(class_name)
Section titled “classSlotChains(class_name)”- Parameters: class_name (str) – a class name
- Returns: the list of class slot chains
- Return type: list
- Raises: pyagrum.IndexError – if the class is not in the PRM
classes()
Section titled “classes()”- Returns: the list of classes
- Return type: list
cpf(class_name, attribute)
Section titled “cpf(class_name, attribute)”- Parameters:
- class_name (str) – a class name
- attribute (str) – an attribute
- Returns: the tensor of the attribute
- Return type: pyagrum.Tensor
- Raises:
- pyagrum.OperationNotAllowed – If the class element doesn’t have any “pyagrum.Tensor” (like a pyagrum.PRMReferenceSlot).
- pyagrum.IndexError – If the class is not in the PRM
- pyagrum.IndexError – If the attribute in parameters does not exist
getDirectSubClass(class_name)
Section titled “getDirectSubClass(class_name)”- Parameters: class_name (str) – a class name
- Returns: the list of direct subclasses
- Return type: list
- Raises: pyagrum.IndexError – If the class is not in the PRM
getDirectSubInterfaces(interface_name)
Section titled “getDirectSubInterfaces(interface_name)”- Parameters: interface_name (str) – an interface name
- Returns: the list of direct subinterfaces
- Return type: list
- Raises: pyagrum.IndexError – If the interface is not in the PRM
getDirectSubTypes(type_name)
Section titled “getDirectSubTypes(type_name)”- Parameters: type_name (str) – a type name
- Returns: the list of direct subtypes
- Return type: list
- Raises: pyagrum.IndexError – If the type is not in the PRM
getImplementations(interface_name)
Section titled “getImplementations(interface_name)”- Parameters: interface_name (str) – an interface name
- Returns: the list of classes implementing the interface
- Return type: str
- Raises: pyagrum.IndexError – If the interface is not in the PRM
getLabelMap(type_name)
Section titled “getLabelMap(type_name)”- Parameters: type_name (str) – a type name
- Returns: a dict containing pairs of label and their values
- Return type: dict
- Raises: pyagrum.IndexError – If the type is not in the PRM
getLabels(type_name)
Section titled “getLabels(type_name)”- Parameters: type_name (str) – a type name
- Returns: the list of type labels
- Return type: list
- Raises: pyagrum.IndexError – If the type is not in the PRM
getSuperClass(class_name)
Section titled “getSuperClass(class_name)”- Parameters: class_name (str) – a class name
- Returns: the class extended by class_name
- Return type: str
- Raises: pyagrum.IndexError – If the class is not in the PRM
getSuperInterface(interface_name)
Section titled “getSuperInterface(interface_name)”- Parameters: interface_name (str) – an interface name
- Returns: the interace extended by interface_name
- Return type: str
- Raises: pyagrum.IndexError – If the interface is not in the PRM
getSuperType(type_name)
Section titled “getSuperType(type_name)”- Parameters: type_name (str) – a type name
- Returns: the type extended by type_name
- Return type: str
- Raises: pyagrum.IndexError – If the type is not in the PRM
getalltheSystems()
Section titled “getalltheSystems()”- Returns: the list of all the systems and their components
- Return type: list
interAttributes(interface_name, allAttributes=False)
Section titled “interAttributes(interface_name, allAttributes=False)”- Parameters:
- interface_name (str) – an interface
- allAttributes (bool) – True if supertypes of a custom type should be indicated
- Returns:
the list of (
,<attribute_name>) for the given interface - Return type: list
- Raises: pyagrum.IndexError – If the type is not in the PRM
interReferences(interface_name)
Section titled “interReferences(interface_name)”- Parameters: interface_name (str) – an interface
- Returns:
the list of (<reference_type>,<reference_name>,
) for the given interface - Return type: list
- Raises: pyagrum.IndexError – If the type is not in the PRM
interfaces()
Section titled “interfaces()”- Returns: the list of interfaces in the PRM
- Return type: list
isAttribute(class_name, att_name)
Section titled “isAttribute(class_name, att_name)”- Parameters:
- class_name (str) – a class name
- att_name (str) – the name of the attribute to be tested
- Returns: True if att_name is an attribute of class_name
- Return type: bool
- Raises:
- pyagrum.IndexError – If the class is not in the PRM
- pyagrum.IndexError – If att_name is not an element of class_name
isClass(name)
Section titled “isClass(name)”- Parameters: name (str) – an element name
- Returns: True if the parameter correspond to a class in the PRM
- Return type: bool
isInterface(name)
Section titled “isInterface(name)”- Parameters: name (str) – an element name
- Returns: True if the parameter correspond to an interface in the PRM
- Return type: bool
isType(name)
Section titled “isType(name)”- Parameters: name (str) – an element name
- Returns: True if the parameter correspond to a type in the PRM
- Return type: bool
load(*args)
Section titled “load(*args)”Load a PRM into the explorer.
- Parameters:
- filename (str) – the name of the o3prm file
- classpath (str) – the classpath of the PRM
- Raises: pyagrum.FatalError – If file not found
- Return type:
None
types()
Section titled “types()”- Returns: the list of the custom types in the PRM
- Return type: list