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

Module vodml

source code

Parsing VO-DML files and validating against the rules obtained in this way.

Validation is something we expect to do only fairly rarely, so none of this code is expected to be efficient.

Classes
  Model
a vo-dml model.
Functions
 
openModelFile(prefix)
returns an open file for the VO-DML file corresponding to prefix.
source code
 
getModelForPrefix(*args)
returns a vodml.Model instance for as well-known VODML prefix.
source code
 
getAttributeDefinition(typeDef, attName)
returns the attribute definition for attName in typeDef as an etree.
source code
 
resolveVODMLId(vodmlId)
returns an etree element corresponding to the prefixed vodmlId.
source code
Variables
  KNOWN_MODELS = {'NDcube': ('CubeDM-1.0.vo-dml.xml', 'http://ww...
  __package__ = 'gavo.dm'
Function Details

openModelFile(prefix)

source code 

returns an open file for the VO-DML file corresponding to prefix.

This will raise a NotFoundError for an unknown prefix.

getModelForPrefix(*args)

source code 

returns a vodml.Model instance for as well-known VODML prefix.

This caches models for prefixes and thus should usually be used from user code.

Note that this currently will currently return some stand-in shim for unknown prefixes. That behaviour will change to become a NotFoundError exception when there's actually useful data models.

Decorators:
  • @utils.memoized

getAttributeDefinition(typeDef, attName)

source code 

returns the attribute definition for attName in typeDef as an etree.

This raises a NotFoundError if the attribute is not found.

resolveVODMLId(vodmlId)

source code 

returns an etree element corresponding to the prefixed vodmlId.

Of course, this only works if vodmlId has a well-known prefix.


Variables Details

KNOWN_MODELS

Value:
{'NDcube': ('CubeDM-1.0.vo-dml.xml',
            'http://www.ivoa.net/dm/CubeDM-1.0.vo-dml.xml'),
 'dachstoy': ('dachstoy.vo-dml.xml', 'http://docs.g-vo.org/dachstoy'),
 'ds': ('DatasetMetadata-1.0.vo-dml.xml',
        'http://www.ivoa.net/dm/DatasetMetadata-1.0.vo-dml.xml'),
 'geojson': ('geojson.vo-dml.xml', 'http://docs.g-vo.org/geojson'),
 'ivoa': ('IVOA.vo-dml.xml', 'http://www.ivoa.net/dm/ivoa.vo-dml.xml')\
,
...