Package org.apache.stanbol.enhancer.engines.entitylinking

Examples of org.apache.stanbol.enhancer.engines.entitylinking.EntitySearcherException


        if(id == null || id.getUnicodeString().isEmpty()){
            return null;
        }
        Entityhub entityhub = getSearchService();
        if(entityhub == null){
            throw new EntitySearcherException("The Entityhub is currently not active");
        }
        org.apache.stanbol.entityhub.servicesapi.model.Entity entity;
        try {
            entity = entityhub.getEntity(id.getUnicodeString());
        catch (EntityhubException e) {
            throw new EntitySearcherException("Exception while getting "+id+
                " from the Entityhub",e);
        }
        if(entity != null){
            Set<String> languageSet;
            if(languages == null || languages.length < 1){
View Full Code Here


                                           List<String> search,
                                           String[] languages,
                                           Integer limit, Integer offset) throws EntitySearcherException {
        Entityhub entityhub = getSearchService();
        if(entityhub == null){
            throw new EntitySearcherException("The Entityhub is currently not active");
        }
        FieldQuery query = EntitySearcherUtils.createFieldQuery(entityhub.getQueryFactory(),
            field, includeFields, search, languages);
        if(limit != null && limit > 0){
            query.setLimit(limit);
        } else if(this.limit != null){
            query.setLimit(this.limit);
        }
        if(offset != null && offset.intValue() > 0){
            query.setOffset(offset.intValue());
        }
        QueryResultList<Representation> results;
        try {
            results = entityhub.find(query);
        } catch (EntityhubException e) {
            throw new EntitySearcherException("Exception while searchign for "+
                search+'@'+Arrays.toString(languages)+"in the Entityhub", e);
        }
        if(!results.isEmpty()){
            Set<String> languagesSet = new HashSet<String>(Arrays.asList(languages));
            Collection<Entity> entities = new ArrayList<Entity>(results.size());
View Full Code Here

        if(id == null || id.getUnicodeString().isEmpty()){
            return null;
        }
        Entityhub entityhub = getSearchService();
        if(entityhub == null){
            throw new EntitySearcherException("The Entityhub is currently not active");
        }
        org.apache.stanbol.entityhub.servicesapi.model.Entity entity;
        try {
            entity = entityhub.getEntity(id.getUnicodeString());
        catch (EntityhubException e) {
            throw new EntitySearcherException("Exception while getting "+id+
                " from the Entityhub",e);
        }
        return entity == null ? null : new EntityhubEntity(entity.getRepresentation());
    }
View Full Code Here

                                           List<String> search,
                                           String[] languages,
                                           Integer limit) throws EntitySearcherException {
        Entityhub entityhub = getSearchService();
        if(entityhub == null){
            throw new EntitySearcherException("The Entityhub is currently not active");
        }
        FieldQuery query = EntitySearcherUtils.createFieldQuery(entityhub.getQueryFactory(),
            field, includeFields, search, languages);
        if(limit != null && limit > 0){
            query.setLimit(limit);
        } else if(this.limit != null){
            query.setLimit(this.limit);
        }
        QueryResultList<Representation> results;
        try {
            results = entityhub.find(query);
        } catch (EntityhubException e) {
            throw new EntitySearcherException("Exception while searchign for "+
                search+'@'+Arrays.toString(languages)+"in the Entityhub", e);
        }
        Collection<Entity> entities = new ArrayList<Entity>(results.size());
        for(Representation result : results){
            entities.add(new EntityhubEntity(result));
View Full Code Here

TOP

Related Classes of org.apache.stanbol.enhancer.engines.entitylinking.EntitySearcherException

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.