Package org.apache.stanbol.entityhub.servicesapi.model

Examples of org.apache.stanbol.entityhub.servicesapi.model.Entity


        QueryResultList<Representation> externalEnties = referencedSiteManager.find(fieldQuery);
        String entityId = null;
        if (externalEnties != null && externalEnties.size() > 0) {
            entityId = externalEnties.iterator().next().getId();
            try {
                Entity entity = entityhub.lookupLocalEntity(entityId, true);
                if (entity != null) {
                    results = getRelatedKeywordsFromEntity(entity);
                } else {
                    logger.warn("There is no obtained external entity having id: {}", entityId);
                }
View Full Code Here


        Float maxScore = null;
        int exactCount = 0;
        List<Entity> matches = new ArrayList<Entity>(numSuggestions);
        for (Iterator<Entity> guesses = results.iterator();guesses.hasNext() && exactCount<numSuggestions;) {
            Entity guess = guesses.next();
            Representation rep = guess.getRepresentation();
            if(maxScore == null){
                maxScore = rep.getFirst(RdfResourceEnum.resultScore.getUri(),Float.class);
            }
            Iterator<Text> labels = rep.getText(nameField);
            boolean found = false;
View Full Code Here

        }
        Entityhub entityhub = getSearchService();
        if(entityhub == null){
            throw new IllegalStateException("The Entityhub is currently not active");
        }
        Entity entity;
        try {
            entity = entityhub.getEntity(id);
        catch (EntityhubException e) {
            throw new IllegalStateException("Exception while getting "+id+
                " from the Entityhub",e);
        }
        return entity == null ? null : entity.getRepresentation();
    }
View Full Code Here

                    .entity("No or empty ID was parsed. Missing parameter id.\n")
                    .header(HttpHeaders.ACCEPT, acceptedMediaType).build();
            }
        }
        log.info("handle Request for Entity {} of Site {}", id, site.getId());
        Entity entity;
        try {
            entity = site.getEntity(id);
        } catch (ReferencedSiteException e) {
            log.error("ReferencedSiteException while accessing Site " + site.getConfiguration().getName() +
                " (id=" + site.getId() + ")", e);
View Full Code Here

TOP

Related Classes of org.apache.stanbol.entityhub.servicesapi.model.Entity

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.