'Validate artifact syntax.
This method can be used to validate individual artifacts as they are loaded,
without needing all artifacts to be loaded first, as for Validate().
Raises:
ArtifactDefinitionError: If artifact is invalid.'

def ValidateSyntax(self):

    cls_name = self.name
    if (not self.doc):
        raise ArtifactDefinitionError(('Artifact    %s    has    missing    doc' % cls_name))
    for supp_os in self.supported_os:
        if (supp_os not in self.SUPPORTED_OS_LIST):
            raise ArtifactDefinitionError(('Artifact    %s    has    invalid    supported_os    %s' % (cls_name, supp_os)))
    for condition in self.conditions:
        try:
            of = objectfilter.Parser(condition).Parse()
            of.Compile(objectfilter.BaseFilterImplementation)
        except ConditionError as e:
            raise ArtifactDefinitionError(('Artifact    %s    has    invalid    condition    %s.    %s' % (cls_name, condition, e)))
    for label in self.labels:
        if (label not in self.ARTIFACT_LABELS):
            raise ArtifactDefinitionError(('Artifact    %s    has    an    invalid    label    %s.    Please    use    one    from    ARTIFACT_LABELS.' % (cls_name, label)))
    valid_provides = rdf_client.KnowledgeBase().GetKbFieldNames()
    for kb_var in self.provides:
        if (kb_var not in valid_provides):
            raise ArtifactDefinitionError(("Artifact    %s    has    broken    provides:    '%s'    not    in    KB    fields:    %s" % (cls_name, kb_var, valid_provides)))
    for dep in self.GetArtifactPathDependencies():
        if (dep not in valid_provides):
            raise ArtifactDefinitionError(("Artifact    %s    has    an    invalid    path    dependency:    '%s',    not    in    KB    fields:    %s" % (cls_name, dep, valid_provides)))
    for source in self.sources:
        try:
            source.Validate()
        except Error as e:
            raise ArtifactDefinitionError(('Artifact    %s    has    bad    source.    %s' % (cls_name, e)))
