A common error in LEXS-based XML instances is that NIEM and LEXS references point to the wrong objects. This comes about because it is not always obvious what the endpoint of the reference should be. XML validation and even ConTesA validation will only catch references that point to non-existant objects or objects outside the proper scope (e.g. a reference to something outside of the Package), but will not catch problems with references pointing to the wrong kind of "thing". So it is up to those building the instances to make sure references are used correctly.
The best way to determine what a reference is supposed to point to is to look at the definition of the reference itself. The annotation for the element definition will include details on the reference target. For example, the NIEM SubjectInvolvedPersonAssociation includes nc:PersonReference and j:SubjectReference. Since nc:PersonReference is in the nc namespace, you can look in the niem-core.xsd file and find the definition of PersonReference. The ReferenceTarget is specified as PersonType. So nc:PersonReference must point to an element of PersonType or of a type derived from PersonType. Similarly, j:SubjectReference is defined in the jxdm.xsd file, and the ReferenceTarget is defined as SubjectType; so the reference needs to point to a Subject role rather than the underlying Person that has the Subject role.
Even without looking at each and every reference definition, there are some rules of thumb you can follow.
One point of confusion is that some associations include the word "Entity", such as EntityTelephoneNumberAssociation or EntityAttachmentLinkAssociation, leading people to believe that the association points to an Entity, rather than an object inside the Entity such as a Person. (Part of the confusion stems from the difference between the NIEM and LEXS concepts of "Entity", which is covered in a separate FAQ.)
If you look at EntityTelephoneNumberAssociation, you can see that the reference elements do not include "Entity" in the name, which provides a hint that none of those references are intended to point to Entity objects. You can also see that the EntityAttachmentLinkAssociation includes an EntityReference, which hints that it points to an Entity versus something inside the Entity. You can certainly confirm details if necessary by looking at the definition of EntityReference in the lexsdigest.xsd file to see that it has a ReferenceTarget of EntityType.
So as a rule of thumb, if the reference element name (not the association name) includes the word "Entity", the reference element points to the high level entity rather than an object inside the entity. To determine the correct target of other reference elements, you can get hints from the reference elements name (such as PersonReference or SubjectReference). Some reference names include terms for multiple objects, such as SubjectPersonReference. Since the reference name is "SubjectPerson" versus just Person, you have a hint that it doesn't point to a Subject role, but a Person object where the person is a subject.
When in doubt, refer to the reference element definition.
LEXS and NIEM both use the term "Entity", but in different ways.
LEXS uses the term "Entity" in a general sense as defined in the dictionary, specifically as something that exists. Early versions of LEXS defined the concept of Entity as being high level objects, such as person or drug or vehicle, that were of interest to the LEXS community. In LEXS 3.x, entities were expanded to include roles. So in LEXS 3.x, an Entity is a grouping of a base object (such as a person or drug or vehicle), and the base object's applicable roles (such as subject or weapon).
NIEM uses the term "Entity" from more of a court perspective to represent people or organizations that are capable of bearing legal rights and responsibilities.
Note that LEXS defines some associations using the NIEM concept of Entity, such as EntityTelephoneNumberAssociation which defines a relationship between a NIEM Entity (i.e. a person or organization) and a telephone number.
©2009 Georgia Tech Research Institute