Package org.iirds.dita.ot.plugin.contrib
Class SubjectSchemeDataMetadataHandler
java.lang.Object
org.iirds.dita.ot.plugin.contrib.SubjectSchemeDataMetadataHandler
- All Implemented Interfaces:
IirdsMetadataHandler
Metadata handler code implementation that extracts metadata from
data
elements in the prolog or topicmeta area.
The data elements must reference a subject definition via keyref
attribute. From the target subject definition metadata information gets
pulled.
E.g., snippet from topic :
<prolog>
<metadata>
<data keyref="iirds.Disposal"/>
</metadata>
</prolog>
Snippet from subject scheme map:
<subjectdef keys="iirds.ProductMetadata">
<topicmeta>
<navtitle>productMetadata</navtitle>
<shortdesc>information about a product or component</shortdesc>
<resourceid appid="http://iirds.tekom.de/iirds#ProductMetadata" appname="class-iri"/>
</topicmeta>
<subjectdef keys="iirds.ProductLifeCyclePhase">
<topicmeta>
<navtitle>phase of product lifecycle</navtitle>
<shortdesc>defined period in the evolution of a product from the conceptual idea to its ultimate disposal</shortdesc>
<resourceid appid="http://iirds.tekom.de/iirds#ProductLifeCyclePhase"
appname="class-iri"/>
</topicmeta>
<subjectdef keys="iirds.AfterUse">
<topicmeta>
<navtitle>after use</navtitle>
<shortdesc>product life cycle phase that follows the active use of the product</shortdesc>
<resourceid appid="http://iirds.tekom.de/iirds#AfterUse" appname="class-iri"/>
</topicmeta>
<subjectdef keys="iirds.Disposal">
<topicmeta>
<navtitle>disposal</navtitle>
<shortdesc>product life cycle phase spanning the process of elimination of a product or component</shortdesc>
<resourceid appid="http://iirds.tekom.de/iirds#Disposal" appname="instance-iri"/>
</topicmeta>
</subjectdef>
</subjectdef>
In this example, the data element references the subjectdef
element via its key iirds.Disposal. The subjectdef elements
surrounding this element provide the class hierarchy from the iiRDS scheme .
- Author:
- Martin Kreutzer, Empolis Information Management GmbH
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToModel(ToCNode root, org.apache.jena.rdf.model.Model model) Adds extracted metadata of a topic or map to the iiRDS RDF model.voidextractMetadata(ToCNode node, Document document) Extract metadata from an XML DOM of a topic or map.(package private) static SubjectDeffindClassOf(SubjectDef subjectdef) getName()The name this metadata handler can be activated by from theditacommand via parameters(package private) static booleanisClass(SubjectDef subjectdef) (package private) booleanisType(SubjectDef clazz, String classUri) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.iirds.dita.ot.plugin.spi.IirdsMetadataHandler
completeModel
-
Field Details
-
logger
static org.slf4j.Logger logger -
PROP_SUBJECTSCHEME
- See Also:
-
INSTANCE_IRI
- See Also:
-
CLASS_IRI
- See Also:
-
-
Constructor Details
-
SubjectSchemeDataMetadataHandler
public SubjectSchemeDataMetadataHandler()
-
-
Method Details
-
getName
Description copied from interface:IirdsMetadataHandlerThe name this metadata handler can be activated by from theditacommand via parameters- Specified by:
getNamein interfaceIirdsMetadataHandler- Returns:
- the unique name, should be short and comprehensible to users of the DITA OT.
-
toString
-
extractMetadata
Description copied from interface:IirdsMetadataHandlerExtract metadata from an XML DOM of a topic or map. Implementations should store the extracted metadata viaToCNode.setProperty(String, Object). The key of the property should reflect the element / attribute where the metadata come form in order to achieve unique keys for the properties.- Specified by:
extractMetadatain interfaceIirdsMetadataHandler- Parameters:
node- the ToC node contextdocument- the DOM to extract from
-
isClass
-
findClassOf
-
isType
-
addToModel
Description copied from interface:IirdsMetadataHandlerAdds extracted metadata of a topic or map to the iiRDS RDF model. Implementations shall access the extracted metadata viaToCNode.getProperty(String). The iiRDSInformationUnithas already been created when this method gets called and is accessible viaToCNode.getInformationUnit()- Specified by:
addToModelin interfaceIirdsMetadataHandler- Parameters:
root- the ToC node contextmodel- the RDF model (graph) to work with and update
-