Using custom XPath expressions to validate metadata elements (Defense Mapping)
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.
Before running the Metadata check, the metadata on your data must be updated using one of the following to ensure that the check results are complete.
- The Description tab in ArcCatalog
- The Description tab on the Item Description dialog box, which can be opened through the Catalog window in ArcMap
- The Upgrade Metadata geoprocessing tool
- Start ArcMap.
- On the main menu, click Customize → Toolbars → Data Reviewer.
-
Click the Reviewer Batch Job Manager button on the Data Reviewer toolbar.
The Reviewer Batch Job Manager dialog box appears.
- Create a batch job.
- Right-click a group in the batch job, then click Add Check → Advanced Checks → Metadata Check.
The Metadata Check Properties dialog box appears.
- 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.
- In the Check Options area, check the Validate Metadata Standard check box.
- Click Configure to configure metadata element expressions.
The Metadata Content Validation dialog box appears.
- In the Element Expressions area, choose the Custom Expression option.
- 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.
- 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.
- In the Edit Custom Expression area, type the custom XPath 1.0 expression in the XPath Expression text box.
- 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.
- In the Edit Custom Expression area, click Verify to validate the syntax of the XPath expression.
- 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\Production<release>\Metadata\Queries directory.
- 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.
- Click OK to close the Metadata Content Validation dialog box.
- If necessary, type descriptive text for the check results in the Notes text box in the Reviewer Remarks area.
-
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.
The severity indicates the importance of the check result. The values range from 1 to 5, with 1 being the highest priority and 5 being the lowest.
- [OK] をクリックします。
- Save the batch job.
- [OK] をクリックします。