Home | Trees | Indices | Help |
|
---|
|
object --+ | Model
An abstraction of the database schema
>>> service = Service("http://www.flymine.org/query/service") >>> model = service.model >>> model.get_class("Gene") <intermine.model.Class: Gene>
This class represents the data model - ie. an abstraction of the database schema. It can be used to introspect what data is available and how it is inter-related
|
|||
|
|||
|
|||
|
|||
list(intermine.model.Class) |
|
||
list(intermine.model.Class) |
|
||
intermine.model.Class |
|
||
intermine.model.Path |
|
||
|
|||
|
|||
Inherited from |
|
|||
Inherited from |
|
Constructor
>>> model = Model(xml)
You will most like not need to create a model directly, instead get one from the Service object:
See Also: intermine.webservice.Service |
Create classes, attributes, references and collections from the model.xmlThe xml can be provided as a file, url or string. This method is called during instantiation - it does not need to be called directly.
|
Make names point to instances and insert inherited fieldsThis method ensures the model is internally consistent. This method is called during instantiaton. It does not need to be called directly.
|
take a list of class names and return a list of classes>>> classes = model.to_classes(["Gene", "Protein", "Organism"]) This simply maps from a list of strings to a list of classes in the calling model.
|
Get a class by its name, or by a dotted path>>> model = Model("http://www.flymine.org/query/service/model") >>> model.get_class("Gene") <intermine.model.Class: Gene> >>> model.get_class("Gene.proteins") <intermine.model.Class: Protein> This is the recommended way of retrieving a class from the model. As well as handling class names, you can also pass in a path such as "Gene.proteins" and get the corresponding class back (<intermine.model.Class: Protein>)
|
Return a path object for the given path string>>> path = Model.make_path("Gene.organism.name") <intermine.model.Path: Gene.organism.name> This is recommended manner of constructing path objects.
|
Validate a path>>> try: ... model.validate_path("Gene.symbol") ... return "path is valid" ... except PathParseError: ... return "path is invalid" "path is valid" When you don't need to interrogate relationships between paths, simply using this method to validate a path string is enough. It guarantees that there is a descriptor for each section of the string, with the appropriate relationships
|
Parse a path string into a list of descriptors - one for each section
>>> parts = Model.parse_path_string(string)
This method is used when making paths from a model, and when validating path strings. It probably won't need to be called directly. |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue Apr 5 11:19:34 2011 | http://epydoc.sourceforge.net |