Using custom XPath expressions to validate metadata elements

There may be situations where you need to evaluate the contents of your metadata in a more precise manner than what can be accomplished using the Metadata check's predefined content expressions. This could include the need to determine whether a metadata element is populated with a specific value, such as the Contact Person Name is equal to "John Smith" or that the Organization Title is equal to "City of Redlands". You may need to compare the value of two different metadata elements to ensure they are consistent. This could include comparing the Last Update date against the Planned Update date to ensure that these dates are consistent.

Once an expression has been created, it can be saved to disk for reuse in other Metadata checks or shared among different people in your organization to minimize duplication of effort in creating these sometimes complex queries and to standardize how metadata quality control is conducted.

Once you have defined the criteria for the check, you can configure the notes and a severity rating. The notes allow you to provide a more specific description for the feature that has been written to the Reviewer table and are copied to the Notes field in the Reviewer table. The severity rating allows you to indicate how important the results from a check are in terms of your quality assurance/quality control processes. The lower the number, the greater the priority the check's results have.

步骤:
  1. Start ArcMap.
    提示提示:

    If the ArcMap - Getting Started dialog box appears, you can open a new or existing map document. You can also check the Do not show this dialog box in the future check box and click Open.

  2. On the main menu, click Customize > Toolbars > Data Reviewer.
  3. Create a batch job and add the Metadata Check from the Advanced Checks category.

    The Metadata Check Properties dialog box appears.

    Metadata Check Properties dialog box
  4. If necessary, type a unique name for the check in the Check Title text box.
    注意注意:

    The check title can be used to describe the type, metadata standard, and conditions you are evaluating with the check. This is useful when you have a combination of mandatory and optional metadata elements and resources to be evaluated.

  5. In the Check Options area of the Metadata Check Properties dialog, check the Validate Metadata Content check box.
  6. Click Configure to configure metadata element expressions.

    The Metadata Content Validation dialog box appears.

    The Metadata Content Validation dialog box
  7. In the Element Expressions area, choose the Custom Expression option.
  8. Click the Custom Expression drop-down arrow and choose Create Custom Expression.
    提示提示:

    You can also edit a previously saved expression by choosing it from the Custom Expression drop-down list and clicking Edit to open the Edit Custom Expression dialog box to update the query

  9. In the Edit Custom Expression area, type a descriptive name for the query in the Check Name text box.
    注意注意:

    The check name can be used to describe the elements being evaluated and the error conditions you are looking for with the custom expression. It is also what is listed in the Create Custom Expression drop-down list once the query is saved to disk.

  10. In the Edit Custom Expression area, type the custom XPath 1.0 expression in the XPath Expression text box.
  11. In the Edit Custom Expression area, type a brief description of what the results of the query constitute in the Status text box.
    注意注意:

    The text entered in the Status property is written to an error result's REVIEWSTATUS in the Reviewer table. A good description of the error conditions allows for better reporting and correction of the error later in your quality control workflow.

    A complete custom expression in the Metadata Content Validation dialog box
  12. In the Edit Custom Expression area, click Verify to validate the syntax of the XPath expression.
  13. Once the query has been successfully verified, you can click Save to Disk to save the custom XPath expression for reuse.
    注意注意:

    It is not necessary to save the expression in order to run the check you are configuring, but if you want to reuse the expression in a different Metadata check, you need to save it to make it available for use in other checks. Saved XPath expressions are stored as an XML-formatted text file and named based on the name defined in the Check Name text box. The resulting file is stored on disk in the User_Profile\My Documents\ESRI\Production10.0\Metadata\Queries directory.

  14. In the Element Expressions area, click Add Expression to add the metadata element or custom expression pair to the list in the Configured Expressions area.
    注意注意:

    Each custom XPath expression configured for content evaluation is represented as a single row in the list in the Configured Expressions area.

  15. Click OK to close the Metadata Content Validation dialog box.
  16. If necessary, type descriptive text for the check results in the Notes text box in the Reviewer Remarks area.
  17. If necessary, click the Severity drop-down arrow and choose a value that indicates the priority of the check's results in the Reviewer Remarks area.
  18. Click OK.
  19. Save the batch job.
  20. Click OK.

9/30/2010