v.3.2.0
Minor release with the not so minor new ability to parse JSON metadata. This enables metadig-engine to run quality checks on json metadata (notably, schema.org).
Schema Updates
Implementing this required some major, but non-breaking, changes to metadig. The metadig schema was changed to include a more general expression element alongside xpath in the selector field. This prevents us from having to shoehorn the jq expressions needed to extract information from json metadata into the xpath field. This expression element has a syntax attribute describing what syntax the expression is written in. Thus, the more flexible expression could (and eventually, should) entirely replace xpath.
<xs:complexType name="selector">
<xs:sequence>
<xs:element name="name" type="xs:string" />
<xs:element name="xpath" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="subSelector" type="tns:selector" minOccurs="0" />
<xs:element name="namespaces" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="namespace" type="tns:namespace" nillable="true" minOccurs="0"
maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="expression" type = "tns:expression" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="namespaceAware" type="xs:boolean" />
</xs:complexType>
Note that this change is a backwards compatible change from previous versions of the schema. xpath is optional and is still handled as previously. Because of the backwards compatibility, and difficulties in getting the JAXB class model to support multiple versions of the schema, this version of metadig-engine will automatically migrate forward any old schema versions found to the newest version.
Document Processing
In order to process json documents, we added a MetadataDialect interface into the existing suite of processing tools, along with a MetadataDialectFactory. This allowed us to make minimal changes to the calling code, which now instead of running:
XMLDialect xml = new XMLDialect(IOUtils.toInputStream(metadataContent, "UTF-8"));
runs:
MetadataDialect docDialect = MetadataDialectFactory.createDialect(sysMeta,
IOUtils.toInputStream(metadataContent, "UTF-8"));
createDialect then calls the interface implementations XMLDialect or JSONDialect as appropriate, and additional document processing steps proceed from there. This infrastructure also enables additional metadata formats to be added if needed.
What's Changed
- Feature support json by @jeanetteclark in #496
Full Changelog: v.3.1.4...v.3.2.0