|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ow2.weblab.service.normaliser.tika.metadatawriter.MetadataWriter
public abstract class MetadataWriter
This class is the base class for MetadataWriters. It contains the mapping
between metadata as found by Tika to Weblab ontology (or any ontology you'd
like) and write these metadata in the Weblab resource according to the
PokHelper given. As this class does not contain any mapping, a subclass must
be created. This subclass have to provide an implementation for
init method which basically makes calls to
addMapping method. This
method takes MappingDescription (or one of its
subclasses) instances.
PoKHelper,
Metadata,
MappingDescription| Field Summary | |
|---|---|
protected org.apache.commons.logging.Log |
logger
The logger to be used inside this class. |
| Constructor Summary | |
|---|---|
MetadataWriter()
Default constructor used by subclasses |
|
| Method Summary | |
|---|---|
protected void |
addMapping(java.lang.String propertyToMap,
MappingDescription toDescription)
Method used by subclass in their init method to add a mapping |
protected abstract void |
init()
Method to implement in subclass. |
void |
write(Metadata metadataToWrite,
PoKHelper pokHelperToWriteInto,
java.net.URI documentUri)
This method allows to write the Metadata created by Tika inside the correct part of the document pointed out by a PokHelper
instance. |
protected void |
writeUnmmappedMetadata(Metadata metadataToWrite,
java.lang.String name,
PoKHelper pokHelperToWriteInto,
java.net.URI documentUri)
This method aims to write a metadata that was not mapped. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final org.apache.commons.logging.Log logger
| Constructor Detail |
|---|
public MetadataWriter()
| Method Detail |
|---|
public void write(Metadata metadataToWrite,
PoKHelper pokHelperToWriteInto,
java.net.URI documentUri)
PokHelper
instance. Each annotation is written to reference the URI of the document
provided.
metadataToWrite - The Metadata object
to map and writepokHelperToWriteInto - The PokHelper used to write into the
documentdocumentUri - The URI of the document that should be
used for reference
protected void addMapping(java.lang.String propertyToMap,
MappingDescription toDescription)
init method to add a mapping
propertyToMap - the Tika property name to maptoDescription - the description to use for mapping. Can be instance of MappingDescription or one of its subclass.protected abstract void init()
addMapping
protected void writeUnmmappedMetadata(Metadata metadataToWrite,
java.lang.String name,
PoKHelper pokHelperToWriteInto,
java.net.URI documentUri)
metadataToWrite - The Metadata object
to map and writename - Name of the metadata which is not mappedpokHelperToWriteInto - The PokHelper used to write into the
documentdocumentUri - The URI of the document that should be
used for reference
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||