Checking for exact text in metadata

2790
1
05-07-2013 07:18 AM
KatieMcHugh1
New Contributor
Hi there,

am trying to verify a chunk of text in my metadata. I have a section of text,several sentences long, that should be present in the Use Constraints section of my metadata. At this time I am using ESRI format but I will also need to check FGDC. I have a custom
check set up and it reads as follows (the actual text is several sentences long):
/metadata/idinfo/useconst [(. = "These data are provided by ...xxyyzz...")]

When I verify, the message says that "The expression was verified correctly." However, when I run the check, it comes back with no errors, even when I have altered the text, so I know there are errors. I want the check to throw an error if anything between " " is
not exactly as it is shown in the check.

Is there something extra I need to do, to indicate that I am checking for exact text?

Thanks so much!
Tags (2)
0 Kudos
1 Reply
JayCary
Esri Contributor
Hi,

This is a great question and highlights one of the challenges (and under-documented aspects) of using the advanced features of the Metadata Check.

To validate metadata content using a custom XPath query it should be constructed as an error condition which will return as "True" when the expression is executed in the Metadata Check.  For each metadata element which tests �??True�?� you will be returned a Reviewer result.

In your scenario, you want to write a result when the FGDC Use Constraints element (/metadata/idinfo/useconst) is NOT equal to "These data are provided by ...xxyyzz...".  The XPath expression which tests "True" for this condition would be:

/metadata/idinfo/useconst[not(. = "These data are provided by ...xxyyzz...")]

Using this expression, Data Reviewer will write an result for every instance of the Use Constraint element (/metadata/idinfo/useconst) which is not equal to "These data are provided by ...xxyyzz...".

Since this particular element may be repeated a number of times in the metadata record I'd recommend that you disable duplicate checking.  This will ensure that you get a complete list of these element errors.

Give this a try and let us know how it works!
0 Kudos