Package org.apache.stanbol.entityhub.indexing.core

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


            consumed = true;
        } else {
            throw new IllegalStateException("This implementation supports only a"
                    + "single Iteration of the data.");
        }
        return new EntityDataIterator() {
           
            Iterator<Resource> resources = resourceList.iterator();
            Resource r;
            LineIterator it = null;
            private String next;
View Full Code Here


        EntityDataIterable iterable = config.getDataIterable();
        assertNotNull(iterable);
        assertEquals(iterable.getClass(), RdfIndexingSource.class);
        assertTrue(iterable.needsInitialisation());
        iterable.initialise();
        EntityDataIterator it = iterable.entityDataIterator();
        long count = 0;
        while(it.hasNext()){
            String entity = it.next();
            log.info("validate Entity "+entity);
            assertNotNull(entity);
            validateRepresentation(it.getRepresentation(), entity);
            count++;
        }
        //check if all entities where indexed
        //this checks if more entities are indexed as listed by the
        //textEntityIDs.txt file
View Full Code Here

        assertNotNull(iterable);
        assertEquals(iterable.getClass(), RdfIndexingSource.class);
        assertTrue(iterable.needsInitialisation());
        iterable.initialise();
        //((RdfIndexingSource)iterable).debug();
        EntityDataIterator it = iterable.entityDataIterator();
        long count = 0;
        while(it.hasNext()){
            String entity = it.next();
            log.info("validate Entity "+entity);
            assertNotNull(entity);
            validateRepresentation(it.getRepresentation(), entity);
            count++;
        }
        //check if all entities where indexed
        //Expected are 3 entities First France from france.rdf
        //and two from BNode Entities in bnode.nt
View Full Code Here

            consumed = true;
        } else {
            throw new IllegalStateException("This implementation supports only a"
                    + "single Iteration of the data.");
        }
        return new EntityDataIterator() {
           
            Iterator<Resource> resources = resourceList.iterator();
            Resource r;
            LineIterator it = null;
            private String next;
View Full Code Here

        EntityDataIterable iterable = config.getDataIterable();
        assertNotNull(iterable);
        assertEquals(iterable.getClass(), RdfIndexingSource.class);
        assertTrue(iterable.needsInitialisation());
        iterable.initialise();
        EntityDataIterator it = iterable.entityDataIterator();
        long count = 0;
        while(it.hasNext()){
            String entity = it.next();
            log.info("validate Entity "+entity);
            assertNotNull(entity);
            validateRepresentation(it.getRepresentation(), entity);
            count++;
        }
        //check if all entities where indexed
        //this checks if more entities are indexed as listed by the
        //textEntityIDs.txt file
View Full Code Here

        assertNotNull(iterable);
        assertEquals(iterable.getClass(), RdfIndexingSource.class);
        assertTrue(iterable.needsInitialisation());
        iterable.initialise();
        ((RdfIndexingSource)iterable).debug();
        EntityDataIterator it = iterable.entityDataIterator();
        long count = 0;
        while(it.hasNext()){
            String entity = it.next();
            log.info("validate Entity "+entity);
            assertNotNull(entity);
            validateRepresentation(it.getRepresentation(), entity);
            count++;
        }
        //check if all entities where indexed
        //Expected are 3 entities First France from france.rdf
        //and two from BNode Entities in bnode.nt
View Full Code Here

    }

    @Override
    public void run() {
        log.info("...start iterating over Entity data");
        EntityDataIterator dataIterator = dataIterable.entityDataIterator();
        while(dataIterator.hasNext()){
            Long start = Long.valueOf(System.currentTimeMillis());
            String id = dataIterator.next();
            Representation rep = null;
            Float score;
            if(!scoreProvider.needsData()){
                score = scoreProvider.process(id);
            } else {
                rep = dataIterator.getRepresentation();
                score = scoreProvider.process(rep);
            }
            //normalise the score
            if(normaliser != null){
                score = normaliser.normalise(score);
            }
            if(indexAllEntitiesState || //all entities are indexed anyway
                    score == null || //no score available
                    score.compareTo(ScoreNormaliser.ZERO) >= 0){ //score >= 0
                if(rep == null){
                    rep = dataIterator.getRepresentation();
                }
                produce(rep,score,start);
            } // else ignore this entity
        }
        setFinished();
View Full Code Here

        EntityDataIterable iterable = config.getDataInterable();
        assertNotNull(iterable);
        assertEquals(iterable.getClass(), RdfIndexingSource.class);
        assertTrue(iterable.needsInitialisation());
        iterable.initialise();
        EntityDataIterator it = iterable.entityDataIterator();
        long count = 0;
        while(it.hasNext()){
            String entity = it.next();
            log.info("validate Entity "+entity);
            assertNotNull(entity);
            validateRepresentation(it.getRepresentation(), entity);
            count++;
        }
        //check if all entities where indexed
        //this checks if more entities are indexed as listed by the
        //textEntityIDs.txt file
View Full Code Here

        EntityDataIterable iterable = config.getDataInterable();
        assertNotNull(iterable);
        assertEquals(iterable.getClass(), RdfIndexingSource.class);
        assertTrue(iterable.needsInitialisation());
        iterable.initialise();
        EntityDataIterator it = iterable.entityDataIterator();
        long count = 0;
        while(it.hasNext()){
            String entity = it.next();
            log.info("validate Entity "+entity);
            assertNotNull(entity);
            validateRepresentation(it.getRepresentation(), entity);
            count++;
        }
        //check if all entities where indexed
        //this checks if more entities are indexed as listed by the
        //textEntityIDs.txt file
View Full Code Here

TOP

Related Classes of org.apache.stanbol.entityhub.indexing.core.EntityDataIterator

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.