In the Best Record file, an element path, called an ePath, is used to specify the location of a field or list of fields. ePaths are also used in the StandardizationConfig element of the Match Field file. An ePath is a sequence of nested nodes in an enterprise record where the most nested element is a data field or a list of data fields. ePaths allow you to retrieve and transform values that are located in the object tree.
ePath strings can be of four basic types:
ObjectField - A field defined in the master index object structure.
ObjectNode - A parent or child object defined in the master index object structure.
ObjectField List - A list of references to certain ObjectFields in the master index object structure.
ObjectNode List - A list of references to certain ObjectNodes in the master index object structure.
A context node is specified when evaluating each ePath expression. The context is considered as the root node of the structure for evaluation.
These topics describe and illustrate how to form ePath strings:
The syntax of an ePath consists of three components: nodes, qualifiers, and fields, as shown below.
node{.node{”[”qualifier’]’}+}+.field |
Node - Specifies the node type and optionally includes qualifiers to restrict the number of nodes. A node without any qualifier defaults to only the first node of the specified type. Use “node.*” to address a node rather than a field.
Qualifier - Restricts the number of nodes addressed at each level. The following qualifiers are allowed:
* (asterisk) - Denotes all nodes of the specified type.
int - Accesses the node by index.
@keystring= valuestring - Accesses the node using a key-value pair. Only one instance of the node is addressed using keys. If a composite key is defined, then multiple key-value pairs can be separated by a comma in the ePath (for example, [@key1=value1,@key2=value2]). The following ePath uses the keystring qualifier and returns the alias where the unique key field type is “Main”. It returns only one alias in a given record.
Person.Alias[@type=Main]
filter=value - Considers only nodes whose field matches the specified value. A subset of nodes is addressed using filters. Multiple filter-value pairs can be separated by a comma (for example, [filter1=value1, filter2=value2]). The following ePath uses the filter qualifier and returns all aliases where the last name is “Jones”.
Person.Alias[lastname=Jones]
Field - Designates the field to return and is in the form of a string.
The following sample illustrates an object structure containing a system object from Site A with a local ID of 111. The object contains a first name, last name, and three addresses. Following the sample, there are several ePath examples that refer to various elements of this object structure along with a description of the data in the sample object structure referred by each ePath.
Enterprise SystemObject - A 111 Person FirstName LastName -Address AddressType = Home Street = 800 Royal Oaks Dr. City = Monrovia State = CA PostalCode = 91016 -Address AddressType = Office Street = 181 2nd Ave.. City = Monrovia State = CA PostalCode = 91016 -Address AddressType = Billing Street = 100 Grand Avenue City = El Segundo State = CA PostalCode = 90245 |
Person.Address.City – Equivalent to Person.Address[0].City.
Person.FirstName – Uses Person as the context, and is equivalent to Enterprise.SystemObject[@SystemCode=A, @Lid= 111].Person.FirstName with Enterprise as the context.
Person.Address[@AddressType=Home].City – Returns a single ObjectField reference to “Monrovia” (the City field of the home address).
Person.Address[City=Monrovia,State=CA].Street – Returns a list of ObjectField references: “800 Royal Oaks Dr.”, “181 2nd Ave.” (the street fields for both addresses where the city is Monrovia and the state is CA). Note that a reference to the Billing address is not returned.
Person.Address[*].Street – Returns a list of ObjectField references: “800 Royal Oaks Dr.”, “181 2nd Ave..”, “100 Grand Avenue”. Note that all references to Street are returned.
Person.Address[2].* – Addresses the second address object as an ObjectNode instead of an ObjectField.