Package org.apache.stanbol.entityhub.servicesapi.mapping

Examples of org.apache.stanbol.entityhub.servicesapi.mapping.FieldMapper.addMapping()


        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);
                }
            }
            //check if there are valid mappings
            if (configuredMappings.getMappings().isEmpty()) {
                configuredMappings = null; //if no mappings where found set to null
View Full Code Here


        //this wrapper allows to use an API to write metadata
        ManagedEntity managedEntity = ManagedEntity.init(localEntity, state);
        FieldMapper siteMapper = site.getFieldMapper();
        FieldMapper mapper = this.fieldMapper.clone();
        for(FieldMapping siteMapping : siteMapper.getMappings()){
            mapper.addMapping(siteMapping);
        }
        //TODO: As soon as MappingActivities are implemented we need to add such
        //      information to the EntityMapping instance!
        mapper.applyMappings(remoteEntity.getRepresentation(),
            localEntity.getRepresentation(),valueFactory);
View Full Code Here

        //this wrapper allows to use an API to write metadata
        ManagedEntity managedEntity = ManagedEntity.init(localEntity, state);
        FieldMapper siteMapper = site.getFieldMapper();
        FieldMapper mapper = this.fieldMapper.clone();
        for(FieldMapping siteMapping : siteMapper.getMappings()){
            mapper.addMapping(siteMapping);
        }
        //TODO: As soon as MappingActivities are implemented we need to add such
        //      information to the EntityMapping instance!
        mapper.applyMappings(remoteEntity.getRepresentation(),
            localEntity.getRepresentation(),valueFactory);
View Full Code Here

            //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;
        }
        //execute the field mappings
View Full Code Here

        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);
                }
            }
            //check if there are valid mappings
            if (configuredMappings.getMappings().isEmpty()) {
                configuredMappings = null; //if no mappings where found set to null
View Full Code Here

     */
    public static FieldMapper createDefaultFieldMapper(Iterator<String> mappings, NamespacePrefixService nps){
        FieldMapper mapper =  new DefaultFieldMapperImpl(ValueConverterFactory.getDefaultInstance());
        if(mappings != null){
            for(FieldMapping mapping : parseFieldMappings(mappings,nps)){
                mapper.addMapping(mapping);
            }
        }
        return mapper;
    }
    /**
 
View Full Code Here

     */
    public static FieldMapper createDefaultFieldMapper(Iterable<FieldMapping> mappings){
        FieldMapper mapper =  new DefaultFieldMapperImpl(ValueConverterFactory.getDefaultInstance());
        if(mappings != null){
            for(FieldMapping mapping : mappings){
                mapper.addMapping(mapping);
            }
        }
        return mapper;
    }

View Full Code Here

            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

        //this wrapper allows to use an API to write metadata
        ManagedEntity managedEntity = ManagedEntity.init(localEntity, state);
        FieldMapper siteMapper = site.getFieldMapper();
        FieldMapper mapper = this.fieldMapper.clone();
        for(FieldMapping siteMapping : siteMapper.getMappings()){
            mapper.addMapping(siteMapping);
        }
        //TODO: As soon as MappingActivities are implemented we need to add such
        //      information to the EntityMapping instance!
        mapper.applyMappings(remoteEntity.getRepresentation(),
            localEntity.getRepresentation(),valueFactory);
View Full Code Here

        if (mappings instanceof String[] && ((String[]) mappings).length > 0) {
            configuredMappings = new DefaultFieldMapperImpl(ValueConverterFactory.getDefaultInstance());
            for (String mappingString : (String[]) mappings) {
                FieldMapping fieldMapping = FieldMappingUtils.parseFieldMapping(mappingString);
                if (fieldMapping != null) {
                    configuredMappings.addMapping(fieldMapping);
                }
            }
            //check if there are valid mappings
            if (configuredMappings.getMappings().isEmpty()) {
                configuredMappings = null; //if no mappings where found set to null
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.