Package intermine :: Module constraints :: Class SubClassConstraint
[hide private]
[frames] | no frames]

Class SubClassConstraint

source code

              object --+        
                       |        
pathfeatures.PathFeature --+    
                           |    
                  Constraint --+
                               |
                              SubClassConstraint
Known Subclasses:

Constraints on the class of a reference

If an object has a reference X to another object of type A, and type B extends type A, then any object of type B may be the value of the reference X. If you only want to see X's which are B's, this may be achieved with subclass constraints, which allow the type of an object to be limited to one of the subclasses (at any depth) of the class type required by the attribute.

These constraints do not use operators. Since they cannot be conditional (eg. "A is a B or A is a C" would not be possible in an InterMine query), they do not have codes and cannot be referenced in logic expressions.

Instance Methods [hide private]
 
__init__(self, path, subclass) source code
 
to_string(self)
Provide a human readable representation of the logic.
source code
 
to_dict(self)
Return a dict object which can be used to construct a DOM element with the appropriate attributes.
source code

Inherited from pathfeatures.PathFeature: __repr__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from Constraint: child_type

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, path, subclass)
(Constructor)

source code 

Constructor

Parameters:
  • path (str) - The path to constrain. This must refer to a class or a reference to a class.
  • subclass (str) - The class to subclass the path to. This must be a simple class name (not a dotted name)
Overrides: object.__init__

to_string(self)

source code 

Provide a human readable representation of the logic. This method is called by repr.

Overrides: pathfeatures.PathFeature.to_string

to_dict(self)

source code 

Return a dict object which can be used to construct a DOM element with the appropriate attributes.

Overrides: pathfeatures.PathFeature.to_dict