Search in sources :

Example 1 with OntologyMappings

use of org.apache.stanbol.enhancer.engines.tika.metadata.OntologyMappings in project stanbol by apache.

the class TikaEngine method activate.

@Override
protected void activate(ComponentContext ctx) throws ConfigurationException {
    super.activate(ctx);
    config = TikaConfig.getDefaultConfig();
    this.detector = config.getDetector();
    this.parser = new AutoDetectParser(config);
    this.skipLinebreaks = getBoolean(ctx.getProperties(), SKIP_LINEBREAKS_WITHIN_CONTENT, DEFAULT_SKIP_LINEBREAKS);
    this.ontologyMappings = new OntologyMappings();
    if (getBoolean(ctx.getProperties(), MAPPING_MEDIA_RESOURCE, DEFAULT_MAPPING_MEDIA_RESOURCE_STATE)) {
        addMediaResourceOntologyMappings(ontologyMappings);
    }
    if (getBoolean(ctx.getProperties(), MAPPING_DUBLIN_CORE_TERMS, DEFAULT_MAPPING_DUBLIN_CORE_TERMS_STATE)) {
        addDcMappings(ontologyMappings);
    }
    if (getBoolean(ctx.getProperties(), MAPPING_NEPOMUK_MESSAGE, DEFAULT_MAPPING_NEPOMUK_MESSAGE_STATE)) {
        addNepomukMessageMappings(ontologyMappings);
    }
    if (getBoolean(ctx.getProperties(), MAPPING_NEPOMUK_EXIF, DEFAULT_MAPPING_NEPOMUK_EXIF_STATE)) {
        addNepomukExifMappings(ontologyMappings);
    }
    if (getBoolean(ctx.getProperties(), MAPPING_SKOS, DEFAULT_MAPPING_SKOS_STATE)) {
        addSkosMappings(ontologyMappings);
    }
    if (getBoolean(ctx.getProperties(), MAPPING_RDFS, DEFAULT_MAPPING_RDFS_STATE)) {
        addRdfsMappings(ontologyMappings);
    }
    if (getBoolean(ctx.getProperties(), MAPPING_GEO, DEFAULT_MAPPING_GEO_STATE)) {
        addGeoMappings(ontologyMappings);
    }
    includeUnmappedProperties = getBoolean(ctx.getProperties(), UNMAPPED_PROPERTIES, DEFAULT_UNMAPPED_PROPERTIES_STATE);
}
Also used : AutoDetectParser(org.apache.tika.parser.AutoDetectParser) OntologyMappings.addMediaResourceOntologyMappings(org.apache.stanbol.enhancer.engines.tika.metadata.OntologyMappings.addMediaResourceOntologyMappings) OntologyMappings(org.apache.stanbol.enhancer.engines.tika.metadata.OntologyMappings)

Aggregations

OntologyMappings (org.apache.stanbol.enhancer.engines.tika.metadata.OntologyMappings)1 OntologyMappings.addMediaResourceOntologyMappings (org.apache.stanbol.enhancer.engines.tika.metadata.OntologyMappings.addMediaResourceOntologyMappings)1 AutoDetectParser (org.apache.tika.parser.AutoDetectParser)1