Package org.apache.stanbol.entityhub.core.mapping

Examples of org.apache.stanbol.entityhub.core.mapping.DefaultFieldMapperImpl


                        siteConfiguration.getEntityDereferencerType() != null
                        && siteConfiguration.getEntityDereferencerType().equals(
                            siteConfiguration.getEntitySearcherType());

        // init the fieldMapper based on the configuration
        fieldMappings = new DefaultFieldMapperImpl(ValueConverterFactory.getDefaultInstance());
        if (siteConfiguration.getFieldMappings() != null) {
            log.debug(" > Initialise configured field mappings");
            for (String configuredMapping : siteConfiguration.getFieldMappings()) {
                FieldMapping mapping =
                        FieldMappingUtils.parseFieldMapping(configuredMapping, nsPrefixService);
View Full Code Here


        //at last get the FieldMappingConfig and create the FieldMappings instance
        // -> we need to do that after the init of the Entityhub-yard, because than we
        //    can use the valueFactory of the configured Yard to create instances
        //    of converted values!
        log.info(" ... init FieldMappings");
        fieldMapper = new DefaultFieldMapperImpl(ValueConverterFactory.getDefaultInstance());
        for(String mappingString : config.getFieldMappingConfig()){
            FieldMapping mapping = FieldMappingUtils.parseFieldMapping(mappingString,nsPrefixService);
            if(mapping != null){
                log.info("   + mapping: "+mapping);
                fieldMapper.addMapping(mapping);
View Full Code Here

        //(2) Init the additional mappings based on the configuration
        Object mappings = context.getProperties().get(Cache.ADDITIONAL_MAPPINGS);
        FieldMapper configuredMappings = null;
        if (mappings instanceof String[] && ((String[]) mappings).length > 0) {
            configuredMappings = new DefaultFieldMapperImpl(ValueConverterFactory.getDefaultInstance());
            for (String mappingString : (String[]) mappings) {
                FieldMapping fieldMapping = FieldMappingUtils.parseFieldMapping(mappingString, nsPrefixService);
                if (fieldMapping != null) {
                    configuredMappings.addMapping(fieldMapping);
                }
View Full Code Here

        this.nsPrefixService = nsPrefixService;
        this.siteMetadata = extractSiteMetadata(config,InMemoryValueFactory.getInstance());
        //all entities of managed sites are locally cached - so we can add this
        //to the site metadata
        this.siteMetadata.put(RdfResourceEnum.isChached.getUri(), (Object)Boolean.TRUE);
        fieldMapper = new DefaultFieldMapperImpl(ValueConverterFactory.getDefaultInstance());
        if(config.getFieldMappings() != null){
            log.debug(" > Initialise configured field mappings");
            for(String configuredMapping : config.getFieldMappings()){
                FieldMapping mapping = FieldMappingUtils.parseFieldMapping(configuredMapping,nsPrefixService);
                if(mapping != null){
View Full Code Here

        if(config == null){
            throw new IllegalArgumentException("The parsed EntityhubConfig MUST NOT be NULL!");
        }
        this.config = config;
        log.info(" ... init FieldMappings");
        fieldMapper = new DefaultFieldMapperImpl(ValueConverterFactory.getDefaultInstance());
        for(String mappingString : config.getFieldMappingConfig()){
            FieldMapping mapping = FieldMappingUtils.parseFieldMapping(mappingString,nsPrefixService);
            if(mapping != null){
                log.info("   + mapping: "+mapping);
                fieldMapper.addMapping(mapping);
View Full Code Here

                    log.warn("   - unable to parse FieldMapping '{}'", configuredMapping);
                }
            }
            if(!mappings.isEmpty()){
                log.debug(" > apply {} valid mappings",mappings.size());
                fieldMapper = new DefaultFieldMapperImpl(ValueConverterFactory.getDefaultInstance());
                for(FieldMapping mapping : mappings){
                  fieldMapper.addMapping(mapping);
                }
            } else { //no valid mapping parsed
              log.debug(" > no valid mapping parsed ... will dereference all fields");
View Full Code Here

            //we need to modify the field and add a global filter for the
            //languages. NOTE that the field might be null. In that case we
            //need just filter literals by language
            //TODO: maybe cache fieldMappers for sets of languages
            fieldMapper = this.fieldMapper != null ? this.fieldMapper.clone() :
                new DefaultFieldMapperImpl(ValueConverterFactory.getDefaultInstance());
            fieldMapper.addMapping(new FieldMapping(new TextConstraint(
                (String)null, langs.toArray(new String[graph.size()]))));
        } else { //just use the fieldMapper as parsed in the config
            fieldMapper = this.fieldMapper;
        }
View Full Code Here

        this.siteConfiguration = config;
        this.cache = cache;
        this.dereferencer = dereferencer;
        this.entitySearcher = searcher;
        // init the fieldMapper based on the configuration
        fieldMappings = new DefaultFieldMapperImpl(ValueConverterFactory.getDefaultInstance());
        if (siteConfiguration.getFieldMappings() != null) {
            log.debug(" > Initialise configured field mappings");
            for (String configuredMapping : siteConfiguration.getFieldMappings()) {
                FieldMapping mapping =
                        FieldMappingUtils.parseFieldMapping(configuredMapping, nsPrefixService);
View Full Code Here

        this.yard = yard;
        //(1) Read the base mappings from the Yard
        this.baseMapper = CacheUtils.loadBaseMappings(yard,nsPrefixService);
        FieldMapper configuredMappings = null;
        if(additionalMappings != null && additionalMappings.length > 0){
            configuredMappings = new DefaultFieldMapperImpl(ValueConverterFactory.getDefaultInstance());
            for (String mappingString : additionalMappings) {
                FieldMapping fieldMapping = FieldMappingUtils.parseFieldMapping(mappingString, nsPrefixService);
                if (fieldMapping != null) {
                    configuredMappings.addMapping(fieldMapping);
                }
View Full Code Here

                && siteConfiguration.getEntityDereferencerType() != null
                && siteConfiguration.getEntityDereferencerType().equals(
                    siteConfiguration.getEntitySearcherType());

        // init the fieldMapper based on the configuration
        FieldMapper fieldMappings = new DefaultFieldMapperImpl(ValueConverterFactory.getDefaultInstance());
        if (siteConfiguration.getFieldMappings() != null) {
            log.debug(" > Initialise configured field mappings");
            for (String configuredMapping : siteConfiguration.getFieldMappings()) {
                FieldMapping mapping =
                        FieldMappingUtils.parseFieldMapping(configuredMapping, nsPrefixService);
                if (mapping != null) {
                    log.debug("   - add FieldMapping {}", mapping);
                    fieldMappings.addMapping(mapping);
                }
            }
        }
        // now init the referenced Services
        initDereferencerAndEntitySearcher();
View Full Code Here

TOP

Related Classes of org.apache.stanbol.entityhub.core.mapping.DefaultFieldMapperImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.