SemanticValidator#
- class pyopenms.SemanticValidator#
Bases:
objectSemantically validates XML files using CVMappings and a ControlledVocabulary
- __init__(mapping: pyopenms.CVMappings, cv: pyopenms.ControlledVocabulary) None#
Methods
__init__(mapping, cv)locateTerm(path, parsed_term)Locate a CV term in the mapping file
setAccessionAttribute(accession)Sets the name of the attribute for accessions in the CV parameter tag name (default 'accession')
setCheckTermValueTypes(check)Sets if CV term value types should be check (enabled by default)
setCheckUnits(check)Sets if CV term units should be check (disabled by default)
setNameAttribute(name)Sets the name of the attribute for accessions in the CV parameter tag name (default 'name')
setTag(tag)Sets the CV parameter tag name (default 'cvParam')
setUnitAccessionAttribute(accession)Sets the name of the unit accession attribute
setUnitNameAttribute(name)Sets the name of the unit name attribute
setValueAttribute(value)Sets the name of the attribute for accessions in the CV parameter tag name (default 'value')
validate(filename)Validates an XML file.
- locateTerm(path: str, parsed_term: pyopenms.SemanticValidator_CVTerm) bool#
Locate a CV term in the mapping file
- setAccessionAttribute(accession: str) None#
Sets the name of the attribute for accessions in the CV parameter tag name (default ‘accession’)
- setCheckTermValueTypes(check: bool) None#
Sets if CV term value types should be check (enabled by default)
- setCheckUnits(check: bool) None#
Sets if CV term units should be check (disabled by default)
- setNameAttribute(name: str) None#
Sets the name of the attribute for accessions in the CV parameter tag name (default ‘name’)
- setTag(tag: str) None#
Sets the CV parameter tag name (default ‘cvParam’)
- setUnitAccessionAttribute(accession: str) None#
Sets the name of the unit accession attribute
- setUnitNameAttribute(name: str) None#
Sets the name of the unit name attribute
- setValueAttribute(value: str) None#
Sets the name of the attribute for accessions in the CV parameter tag name (default ‘value’)
- validate(filename: str) tuple#
Validates an XML file. Returns (success, errors, warnings)