Package gavo :: Package dm :: Module vodml :: Class Model
[frames] | no frames]

Class Model

source code

object --+
         |
        Model

a vo-dml model.

These are usually constructed using the fromPrefix constructor, which uses a built-in mapping from well-known prefix to VO-DML file to populate the model.

Instance Methods
 
__init__(self, prefix, dmlTree)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
getByVODMLId(self, vodmlId)
returns the element with vodmlId.
source code
 
getAttributeMeta(self, vodmlId)
returns a metadata dictionary for a VO-DML element with vodmlId.
source code
 
getVOT(self, ctx, instance)
returns xmlstan for a VOTable declaration of this DM.
source code

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

Class Methods
 
fromPrefix(cls, prefix)
returns a VO-DML model for a well-known prefix.
source code
 
fromFile(cls, src, srcURL='http //not.given/invalid')
returns a VO-DML model from src.
source code
Properties
  idIndex
returns a dictionary mapping vodmlids to elementtree objects.

Inherited from object: __class__

Method Details

__init__(self, prefix, dmlTree)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

fromPrefix(cls, prefix)
Class Method

source code 

returns a VO-DML model for a well-known prefix.

User code should typically use the getModelFromPrefix function.

fromFile(cls, src, srcURL='http //not.given/invalid')
Class Method

source code 

returns a VO-DML model from src.

src can either be a file name (interpreted relative to the root of DaCHS' VO-DML repository) or an open file (which will be closed as a side effect of this function).

This is intended for documents using non-standard models with custom prefixes (i.e., not known to DaCHS).

getByVODMLId(self, vodmlId)

source code 

returns the element with vodmlId.

This raises a NotFoundError for elements that are not present.

This can be used with or without the prefix. The prefix is not validated, though.

getAttributeMeta(self, vodmlId)

source code 

returns a metadata dictionary for a VO-DML element with vodmlId.

This includes datatype add description. If vodmlId points to the value of a quantity, the associate unit and ucd attributes are returned as well.

If the vodmlId cannot be found, a NotFoundError is raised.


Property Details

idIndex

returns a dictionary mapping vodmlids to elementtree objects.

Get Method:
unreachable.idIndex(self) - returns a dictionary mapping vodmlids to elementtree objects.