Examples of EntityProcessor


Examples of org.apache.olingo.odata2.api.processor.part.EntityProcessor

    when(entitySet.readEntitySet(any(UriInfoImpl.class), anyString())).thenAnswer(getAnswer());
    when(entitySet.countEntitySet(any(UriInfoImpl.class), anyString())).thenAnswer(getAnswer());
    when(entitySet.createEntity(any(UriInfoImpl.class), any(InputStream.class), anyString(), anyString())).thenAnswer(
        getAnswer());

    EntityProcessor entity = mock(EntityProcessor.class);
    when(entity.readEntity(any(UriInfoImpl.class), anyString())).thenAnswer(getAnswer());
    when(entity.existsEntity(any(UriInfoImpl.class), anyString())).thenAnswer(getAnswer());
    when(entity.deleteEntity(any(UriInfoImpl.class), anyString())).thenAnswer(getAnswer());
    when(entity.updateEntity(any(UriInfoImpl.class), any(InputStream.class), anyString(), anyBoolean(), anyString()))
        .thenAnswer(getAnswer());

    EntityComplexPropertyProcessor entityComplexProperty = mock(EntityComplexPropertyProcessor.class);
    when(entityComplexProperty.readEntityComplexProperty(any(UriInfoImpl.class), anyString())).thenAnswer(getAnswer());
    when(
View Full Code Here

Examples of org.apache.stanbol.entityhub.indexing.core.EntityProcessor

            return entityProcessor;
        } else if (configuration.containsKey(KEY_ENTITY_PROCESSOR)){
            List<ConfigEntry> configs = parseConfigEntries(configuration.get(KEY_ENTITY_PROCESSOR).toString());
            List<EntityProcessor> processorList = new ArrayList<EntityProcessor>(configs.size());
            for(ConfigEntry config : configs){
                EntityProcessor processor;
                try {
                    processor = (EntityProcessor)Class.forName(config.getClassName()).newInstance();
                } catch (Exception e) {
                    throw new IllegalArgumentException("Invalid EntityProcessor configuration '"+config.getConfigString()+"'!",e);
                }
                //add the configuration
                Map<String,Object> configMap = getComponentConfig(config, processor.getClass().getSimpleName(), false);
                //add also the directly provided parameters
                configMap.putAll(config.getParams());
                processor.setConfiguration(configMap);
                processorList.add(processor);
            }
            if(!processorList.isEmpty()){ //do not set empty lists
                entityProcessor = Collections.unmodifiableList(processorList);
            }
View Full Code Here

Examples of org.apache.stanbol.entityhub.indexing.core.EntityProcessor

            return entityPostProcessor;
        } else if(configuration.containsKey(KEY_ENTITY_POST_PROCESSOR)){
            List<ConfigEntry> configs = parseConfigEntries(configuration.get(KEY_ENTITY_POST_PROCESSOR).toString());
            List<EntityProcessor> postProcessorList = new ArrayList<EntityProcessor>(configs.size());
            for(ConfigEntry config : configs){
                EntityProcessor postProcessor;
                try {
                    postProcessor = (EntityProcessor)Class.forName(config.getClassName()).newInstance();
                } catch (Exception e) {
                    throw new IllegalArgumentException("Invalid EntityProcessor configuration '"+config.getConfigString()+"' for post-processing!",e);
                }
                //add the configuration
                Map<String,Object> configMap = getComponentConfig(config, postProcessor.getClass().getSimpleName(), false);
                //add also the directly provided parameters
                configMap.putAll(config.getParams());
                postProcessor.setConfiguration(configMap);
                postProcessorList.add(postProcessor);
            }
            if(!postProcessorList.isEmpty()){ //do not set empty lists
                entityPostProcessor = Collections.unmodifiableList(postProcessorList);
            }
View Full Code Here

Examples of org.apache.stanbol.entityhub.indexing.core.EntityProcessor

   
   
    @Test
    public void testIncludeConfig(){
        EntityProcessor filter = new FieldValueFilter(nsPrefixProvider,"rdf:type","foaf:Person");
       
        Representation r = getRepresentation(NamespaceEnum.foaf+"Person");
        Assert.assertNotNull(filter.process(r));
       
        r = getRepresentation(NamespaceEnum.skos+"Concept");
        Assert.assertNull(filter.process(r));
       
        r = getRepresentation(NamespaceEnum.skos+"Concept", NamespaceEnum.foaf+"Person");
        Assert.assertNotNull(filter.process(r));
       
        //test empty value
        filter = new FieldValueFilter(nsPrefixProvider,"skos:releated","");
        Assert.assertNotNull(filter.process(r));
       
        filter = new FieldValueFilter(nsPrefixProvider,"skos:releated","null");
        Assert.assertNotNull(filter.process(r));

        filter = new FieldValueFilter(nsPrefixProvider,"skos:releated", null);
        Assert.assertNotNull(filter.process(r));
    }
View Full Code Here

Examples of org.apache.stanbol.entityhub.indexing.core.EntityProcessor

        Assert.assertNotNull(filter.process(r));
    }
   
    @Test
    public void testExcludeConfig(){
        EntityProcessor filter = new FieldValueFilter(nsPrefixProvider,"rdf:type","*;!foaf:Person");
       
        Representation r = getRepresentation(NamespaceEnum.foaf+"Person");
        Assert.assertNull(filter.process(r));
       
        r = getRepresentation(NamespaceEnum.skos+"Concept");
        Assert.assertNotNull(filter.process(r));
       
        r = getRepresentation(NamespaceEnum.skos+"Concept", NamespaceEnum.foaf+"Person");
        Assert.assertNotNull(filter.process(r));
       
        //test empty value
        filter = new FieldValueFilter(nsPrefixProvider,"skos:releated","*;!null");
        Assert.assertNull(filter.process(r));
       
        filter = new FieldValueFilter(nsPrefixProvider,"skos:releated","*;!");
        Assert.assertNull(filter.process(r));

        filter = new FieldValueFilter(nsPrefixProvider,"skos:releated", "*;!;!foaf:Person");
        Assert.assertNull(filter.process(r));
    }
View Full Code Here

Examples of org.apache.stanbol.entityhub.indexing.core.EntityProcessor

            return entityProcessor;
        } else if (configuration.containsKey(KEY_ENTITY_PROCESSOR)){
            List<ConfigEntry> configs = parseConfigEntries(configuration.get(KEY_ENTITY_PROCESSOR).toString());
            List<EntityProcessor> processorList = new ArrayList<EntityProcessor>(configs.size());
            for(ConfigEntry config : configs){
                EntityProcessor processor;
                try {
                    processor = (EntityProcessor)Class.forName(config.getClassName()).newInstance();
                } catch (Exception e) {
                    throw new IllegalArgumentException("Invalid EntityProcessor configuration '"+config.getConfigString()+"'!",e);
                }
                //add the configuration
                Map<String,Object> configMap = getComponentConfig(config, processor.getClass().getSimpleName(), false);
                //add also the directly provided parameters
                configMap.putAll(config.getParams());
                processor.setConfiguration(configMap);
                processorList.add(processor);
            }
            if(!processorList.isEmpty()){ //do not set empty lists
                entityProcessor = Collections.unmodifiableList(processorList);
            }
View Full Code Here

Examples of org.apache.stanbol.entityhub.indexing.core.EntityProcessor

            return entityPostProcessor;
        } else if(configuration.containsKey(KEY_ENTITY_POST_PROCESSOR)){
            List<ConfigEntry> configs = parseConfigEntries(configuration.get(KEY_ENTITY_POST_PROCESSOR).toString());
            List<EntityProcessor> postProcessorList = new ArrayList<EntityProcessor>(configs.size());
            for(ConfigEntry config : configs){
                EntityProcessor postProcessor;
                try {
                    postProcessor = (EntityProcessor)Class.forName(config.getClassName()).newInstance();
                } catch (Exception e) {
                    throw new IllegalArgumentException("Invalid EntityProcessor configuration '"+config.getConfigString()+"' for post-processing!",e);
                }
                //add the configuration
                Map<String,Object> configMap = getComponentConfig(config, postProcessor.getClass().getSimpleName(), false);
                //add also the directly provided parameters
                configMap.putAll(config.getParams());
                postProcessor.setConfiguration(configMap);
                postProcessorList.add(postProcessor);
            }
            if(!postProcessorList.isEmpty()){ //do not set empty lists
                entityPostProcessor = Collections.unmodifiableList(postProcessorList);
            }
View Full Code Here

Examples of org.apache.stanbol.entityhub.indexing.core.EntityProcessor

            return entityProcessor;
        } else if (configuration.containsKey(KEY_ENTITY_PROCESSOR)){
            List<ConfigEntry> configs = parseConfigEntries(configuration.get(KEY_ENTITY_PROCESSOR).toString());
            List<EntityProcessor> processorList = new ArrayList<EntityProcessor>(configs.size());
            for(ConfigEntry config : configs){
                EntityProcessor processor;
                try {
                    processor = (EntityProcessor)Class.forName(config.getClassName()).newInstance();
                } catch (Exception e) {
                    throw new IllegalArgumentException("Invalid EntityProcessor configuration '"+config.getConfigString()+"'!",e);
                }
                //add the configuration
                Map<String,Object> configMap = getComponentConfig(config, processor.getClass().getSimpleName(), false);
                //add also the directly provided parameters
                configMap.putAll(config.getParams());
                processor.setConfiguration(configMap);
                processorList.add(processor);
            }
            if(!processorList.isEmpty()){ //do not set empty lists
                entityProcessor = Collections.unmodifiableList(processorList);
            }
View Full Code Here

Examples of org.apache.stanbol.entityhub.indexing.core.EntityProcessor

            return entityPostProcessor;
        } else if(configuration.containsKey(KEY_ENTITY_POST_PROCESSOR)){
            List<ConfigEntry> configs = parseConfigEntries(configuration.get(KEY_ENTITY_POST_PROCESSOR).toString());
            List<EntityProcessor> postProcessorList = new ArrayList<EntityProcessor>(configs.size());
            for(ConfigEntry config : configs){
                EntityProcessor postProcessor;
                try {
                    postProcessor = (EntityProcessor)Class.forName(config.getClassName()).newInstance();
                } catch (Exception e) {
                    throw new IllegalArgumentException("Invalid EntityProcessor configuration '"+config.getConfigString()+"' for post-processing!",e);
                }
                //add the configuration
                Map<String,Object> configMap = getComponentConfig(config, postProcessor.getClass().getSimpleName(), false);
                //add also the directly provided parameters
                configMap.putAll(config.getParams());
                postProcessor.setConfiguration(configMap);
                postProcessorList.add(postProcessor);
            }
            if(!postProcessorList.isEmpty()){ //do not set empty lists
                entityPostProcessor = Collections.unmodifiableList(postProcessorList);
            }
View Full Code Here

Examples of org.apache.stanbol.entityhub.indexing.core.EntityProcessor

            if(item != null){
                Long start = Long.valueOf(System.currentTimeMillis());
                item.setProperty(PROCESS_STARTED, start);
                Iterator<EntityProcessor> it = processors.iterator();
                Representation processed = item.getItem();
                EntityProcessor processor = null;
                while(processed != null && it.hasNext()){
                    processor = it.next();
                    processed = processor.process(processed);
                }
                if(processed == null){
                    log.debug("Item {} filtered by processor {}",item.getItem().getId(),processor);
                } else {
                    for(String key : keys){
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.