The DDMS specification identifies several groups of attributes which always tend to be used together: ISM security attributes (such as classification), ISM notice attributes, XLink attributes, GML SRS attributes, and attributes used as part of the Extensible Layer.
ExtensibleAttributes are discussed in the Power Tip on The Extensible Layer.
ISM security attributes are defined in the Intelligence Community's "XML Data Encoding Specification for Information Security Marking Metadata" document (DES) and
implemented in the SecurityAttributes class. This class encapsulates
the ISM attributes which can decorate various DDMS components, such as ddms:resource
or ddms:security
. The constructor which builds
the attributes from a XOM element will simply load these attributes from the element itself. The constructor which builds the attributes from raw data is defined as:
public SecurityAttributes(String classification, List<String> ownerProducers, Map<String,String> otherAttributes)
Figure 1. SecurityAttributes constructor
Because the classification
and ownerProducers
are the most commonly referenced attributes, they are explicit parameters. Any other
attribute can be added in the String-based map called otherAttributes
. Here is an example which creates Confidential markings and puts them on a ddms:title
element:
List<String> ownerProducers = Util.getXsListAsList("AUS USA"); Map<String, String> otherAttributes = new HashMap<String, String>(); otherAttributes.put("SCIcontrols", "SI"); otherAttributes.put("SARIdentifier", "SAR-USA"); SecurityAttributes security = new SecurityAttributes("C", ownerProducers, otherAttributes); Title title = new Title("My Confidential Notes", security); System.out.println(title.toXML());
Figure 2. Code to generate SecurityAttributes
Note: The actual values assigned to each attribute in Figure 2 are for example's sake only, and might be illogical in real-world metadata.
<ddms:title xmlns:ddms="http://metadata.dod.mil/mdr/ns/DDMS/3.0/" xmlns:ISM="urn:us:gov:ic:ism" ISM:classification="C" ISM:ownerProducer="AUS USA" ISM:SCIcontrols="SI" ISM:SARIdentifier="SAR-USA"> My Confidential Notes </ddms:title>
Figure 3. The resultant XML element with security attributes
If an attribute in the otherAttributes
map does not have one of the expected ISM attribute names, it is ignored. In addition, the parameter versions
of classification
and ownerProducer
always take precedence if you try to override them with otherAttributes
:
List<String> ownerProducers = Util.getXsListAsList("AUS USA"); Map<String, String> otherAttributes = new HashMap<String, String>(); // The next line will be ignored, because there is no ISM attribute with this name. otherAttributes.put("favoriteColor", "blue"); // The next line will be ignored, because the "classification" parameter takes precedence. otherAttributes.put("classification", "U"); // The next line will be ignored, because the "ownerProducers" parameter takes precedence. otherAttributes.put("ownerProducer", "FRA"); SecurityAttributes security = new SecurityAttributes("C", ownerProducers, otherAttributes); Title title = new Title("My Confidential Notes", security); System.out.println(title.toXML());
Figure 4. Code to generate SecurityAttributes
<ddms:title xmlns:ddms="http://metadata.dod.mil/mdr/ns/DDMS/3.0/" xmlns:ISM="urn:us:gov:ic:ism" ISM:classification="C" ISM:ownerProducer="AUS USA"> My Confidential Notes </ddms:title>
Figure 5. The resultant XML element with security attributes
The DES also defines many logical constraints on these attributes, but DDMSence does not validate these rules today. A set of Schematron files is bundled with ISM.XML V5, and V9 (which are used by DDMS 3.1 and 4.1, respectively), and sample code for using DDMSence with these files can be found in the Schematron Validation Power Tip.
The values assigned to some attributes must come from the Controlled Vocabulary Enumerations (CVEs) defined by the Intelligence Community. The enumerations used by DDMSence are taken from Public Release versions of ISM.XML, so DDMSence will not be able to recognize enumeration values from higher classification levels. This restriction will be addressed in a future release.
NoticeAttributes are only applicable in DDMS 4.0.1 and 4.1, and follow the same patterns used
by the SecurityAttributes. The ISM:noticeType
attribute is validated against a CVE when present.
// Assume that a list of noticeTexts, and the security attributes were previously created. NoticeAttributes noticeAttributes = new NoticeAttributes("POC", "This is a reason.", "2011-09-15", null, Boolean.TRUE); Notice notice = new Notice(noticeTexts, securityAttributes, noticeAttributes); System.out.println(notice.toXML());
Figure 6. Code to generate NoticeAttributes
<ISM:Notice ISM:noticeType="POC" ISM:noticeReason="This is a reason." ISM:noticeDate="2011-09-15" ISM:externalNotice="true" ISM:classification="U" ISM:ownerProducer="USA"> [...] </ISM:Notice>
Figure 7. The resultant XML element with notice attributes
XLinkAttributes support the various components
which provide external link attributes. An XLinkAttributes instance can function as 3 different types of XLink attribute groups: locator, simple, and resource, based on
the value of the xlink:type
attribute, or the constructor used to build the instance.
// Constructor for attributes with type="locator", used with ddms:link public XLinkAttributes(String href, String role, String title, String label); // Constructor for attributes with type="resource", used with ddms:revisionRecall public XLinkAttributes(String role, String title, String label); // Constructor for attributes with type="simple", used with ddms:taskID public XLinkAttributes(String href, String role, String title, String arcrole, String show, String actuate);
Figure 8. Constructors to generate XLinkAttributes for various purposes
Spatial Reference System (SRS) attributes are defined in the GML specification and implemented as an SRSAttributes class.
They can be applied to the various GML and TSPI shapes inside of a ddms:boundingGeometry
element.
Here is an example which creates SRS attributes on a gml:pos
element in DDMS 4.1:
List<String> axisLabels = Util.getXsListAsList("X Y"); List<String> uomLabels = Util.getXsListAsList("Meter Meter"); SRSAttributes srsAttributes = new SRSAttributes("http://metadata.dod.mil/mdr/ns/GSIP/crs/WGS84E_2D", new Integer(10), axisLabels, uomLabels); List<Double> coordinates = new ArrayList<Double>(); coordinates.add(new Double(32.1)); coordinates.add(new Double(40.1)); Position position = new Position(coordinates, srsAttributes); System.out.println(position.toXML());
Figure 9. Code to generate SRSAttributes in DDMS 4.1
<gml:pos srsName="http://metadata.dod.mil/mdr/ns/GSIP/crs/WGS84E_2D" srsDimension="10" axisLabels="X Y" uomLabels="Meter Meter">32.1 40.1</gml:pos>
Figure 10. The resultant XML element with SRS attributes
Please note that the SRSAttributes do not belong in any XML namespace.