OJP

Schema Subset Generation Tool Options

GTRI
Home
Technical Documentation
Global JXDM Developer's Workshop
XML Tools
Schema Subset Generation Tool (SSGT)
Global JXDM Issue Tracking
Office of Justice Programs (OJP)
National Information Exchange Model (NIEM)
On This Page
Add as element vs. add as reference
Add in type vs. add as independent component

The Schema Subset Generation Tool (SSGT) options don't really have pros and cons. The different options are available for different needs and situations.

Add as element vs. add as reference

Adding properties as elements gives you the expected result -- hierarchical XML content. A person tag has a birth date tag which has a data value. This is the standard way of adding content.

Example: adding PersonBirthDate as an element to type PersonType would cause your XML to look like

<doc>

<j:Person>
	<j:PersonBirthDate>1980-01-01</j:PersonBirthDate>
</j:Person>

</doc>

Adding properties as references gives you a way of creating a pointer to something else. Reference elements let you specify the unique ID of another element in the XML document. Rather than having to duplicate information, you can enter the data in once (per XML document) and give it a unique ID, and then refer back to it as many times as you need. References can also help you to distinguish between data that looks similar but is different and data that is actually the same (e.g., if you see John Doe twice in the same document, is it the same person or two different people?)

Example: adding PersonParent as a reference to show that three children have the same unknown father

<doc>

<j:Person>
	<j:PersonName>
		<j:PersonFullName>Alice Johnson</j:PersonFullName>
	</j:PersonName>
	<j:PersonParentReference j:ref="P1"/>
</j:Person>

<j:Person>
	<j:PersonName>
		<j:PersonFullName>Bobby Johnson</j:PersonFullName>
	</j:PersonName>
	<j:PersonParentReference j:ref="P1"/>
</j:Person>

<j:Person>
	<j:PersonName>
		<j:PersonFullName>Sammy Johnson</j:PersonFullName>
	</j:PersonName>
	<j:PersonParentReference j:ref="P1"/>
</j:Person>

<j:Person j:id="P1">
	<j:PersonName>
		<j:PersonFullName>John Doe</j:PersonFullName>
	</j:PersonName>
</j:Person>

</doc>

The alternative (shown below) would have been to add PersonParent as an element. We would not have been able to tell if the three children had the same or different fathers:

<doc>

<j:Person>
	<j:PersonName>
		<j:PersonFullName>Alice Johnson</j:PersonFullName>
	</j:PersonName>
	<j:PersonParent>
		<j:PersonName>
			<j:PersonFullName>John Doe</j:PersonFullName>
		</j:PersonName>
	</j:PersonParent>
</j:Person>

<j:Person>
	<j:PersonName>
		<j:PersonFullName>Bobby Johnson</j:PersonFullName>
	</j:PersonName>
	<j:PersonParent>
		<j:PersonName>
			<j:PersonFullName>John Doe</j:PersonFullName>
		</j:PersonName>
	</j:PersonParent>
</j:Person>

<j:Person>
	<j:PersonName>
		<j:PersonFullName>Sammy Johnson</j:PersonFullName>
	</j:PersonName>
	<j:PersonParent>
		<j:PersonName>
			<j:PersonFullName>John Doe</j:PersonFullName>
		</j:PersonName>
	</j:PersonParent>
</j:Person>

</doc>

Add in type vs. add as independent component

Adding an element in type creates a global element definition in your subset and also adds that element to the type it appears in on the display. It preserves hierarchy.

Example: Let's say that you are trying to add PersonFullName to a person. You search on Person, expand it, then expand PersonName, and click on PersonFullName. You choose to add it "in type." This means that PersonFullName is created in your subset, plus it is added to PersonNameType. In addition, the tool will make sure that PersonName exists and is added to PersonType.

<doc>

<j:Person>
	<j:PersonName>
		<j:PersonFullName>Jack Smith</j:PersonFullName>
	</j:PersonName>
</j:Person>

</doc>

Adding an element as an independent component only creates the global element definition in your subset. It will not add the element to a type, even if it currently appears in one in the display.

Example: Let's say that this time, you just want PersonFullName and not the person object. You've already found PersonFullName under PersonName, which is under Person. Rather than adding everything else, you choose the option of adding as an independent component and add PersonFullName. Only PersonFullName is added to your subset.

<doc>

<j:PersonFullName>Jack Smith</j:PersonFullName>

</doc>