<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ValidateSyntax(rdf_artifact):
 """Validates 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(). Args: rdf_artifact: RDF object artifact. Raises: ArtifactSyntaxError: If artifact syntax is invalid. """

  if not rdf_artifact.doc:
    raise rdf_artifacts.ArtifactSyntaxError(rdf_artifact, "missing doc")

  for supp_os in rdf_artifact.supported_os:
    valid_os = rdf_artifact.SUPPORTED_OS_LIST
    if supp_os not in valid_os:
      detail = "invalid `supported_os` ('%s' not in %s)" % (supp_os, valid_os)
      raise rdf_artifacts.ArtifactSyntaxError(rdf_artifact, detail)

  for condition in rdf_artifact.conditions:
    # FIXME(hanuszczak): It does not look like the code below can throw
    # `ConditionException`. Do we really need it then?
    try:
      of = objectfilter.Parser(condition).Parse()
      of.Compile(objectfilter.BaseFilterImplementation)
    except rdf_artifacts.ConditionError as e:
      detail = "invalid condition '%s'" % condition
      raise rdf_artifacts.ArtifactSyntaxError(rdf_artifact, detail, e)

  for label in rdf_artifact.labels:
    if label not in rdf_artifact.ARTIFACT_LABELS:
      raise rdf_artifacts.ArtifactSyntaxError(rdf_artifact,
                                              "invalid label '%s'" % label)

  # Anything listed in provides must be defined in the KnowledgeBase
  valid_provides = rdf_client.KnowledgeBase().GetKbFieldNames()
  for kb_var in rdf_artifact.provides:
    if kb_var not in valid_provides:
      detail = "broken `provides` ('%s' not in %s)" % (kb_var, valid_provides)
      raise rdf_artifacts.ArtifactSyntaxError(rdf_artifact, detail)

  # Any %%blah%% path dependencies must be defined in the KnowledgeBase
  for dep in GetArtifactPathDependencies(rdf_artifact):
    if dep not in valid_provides:
      detail = "broken path dependencies ('%s' not in %s)" % (dep,
                                                              valid_provides)
      raise rdf_artifacts.ArtifactSyntaxError(rdf_artifact, detail)

  for source in rdf_artifact.sources:
    try:
      source.Validate()
    except rdf_artifacts.ArtifactSourceSyntaxError as e:
      raise rdf_artifacts.ArtifactSyntaxError(rdf_artifact, "bad source", e)