Package org.apache.stanbol.contenthub.search.related

Examples of org.apache.stanbol.contenthub.search.related.RelatedKeywordImpl


        } else if (maxDepth == 0) {
            log.debug("Max depth reached not examining the resource {}", classURI);
            return;
        } else {
            String rkw = ontClass.getLocalName();
            relatedKeywords.add(new RelatedKeywordImpl(rkw, initialScore, "Ontology"));
            log.debug("Added {} as a related keyword to {} by super class relation", rkw, keyword);
            log.debug("Computing super class closure of {} ", classURI);
            List<OntClass> superClasses = ontClass.listSuperClasses(true).toList();
            for (OntClass superClass : superClasses) {
                computeSuperClassClosure(superClass.getURI(), maxDepth - 1, initialScore
View Full Code Here


        } else if (maxDepth == 0) {
            log.debug("Max depth reached not examining the resource {}", classURI);
            return;
        } else {
            String rkw = ontClass.getLocalName();
            relatedKeywords.add(new RelatedKeywordImpl(rkw, initialScore, "Ontology"));
            log.debug("Added {} as related keyword to {} by sub class relation", classURI, keyword);
            log.debug("Computing sub class closure of {} ", classURI);
            List<OntClass> subClasses = ontClass.listSubClasses(true).toList();
            for (OntClass subClass : subClasses) {
                computeSubClassClosure(subClass.getURI(), maxDepth - 1, initialScore / degradingCoefficient,
View Full Code Here

                if (instance == null || instance.isAnon() || !instance.isIndividual()) {
                    continue;
                } else {
                    Individual individual = instance.asIndividual();
                    String rkw = individual.getLocalName();
                    relatedKeywords.add(new RelatedKeywordImpl(rkw, initialScore / degradingCoefficient,
                            "Ontology"));
                    log.debug("Added {} as a relate keyword to {} ", rkw, keyword);
                }
            }
        }
View Full Code Here

            for (Statement childStatement : children) {
                Resource subject = childStatement.getSubject();
                String childName = IndexingHelper.getCMSObjectName(subject);
                if (!childName.equals("")) {
                    childName = cropFileExtensionFromKeyword(childName);
                    relatedKeywords.add(new RelatedKeywordImpl(childName, score, "Ontology"));
                    log.debug("Added {} as a related keyword", childName);
                    computeSubclosureWithProperty(subject, subsumptionProperty, depth - 1, score,
                        degradingCoefficient, keyword, relatedKeywords);
                }
            }
View Full Code Here

            for (Statement parentStatement : parents) {
                Resource object = parentStatement.getResource();
                String parentName = IndexingHelper.getCMSObjectName(object);
                if (!parentName.equals("")) {
                    parentName = cropFileExtensionFromKeyword(parentName);
                    relatedKeywords.add(new RelatedKeywordImpl(parentName, score, "Ontology"));
                    log.debug("Added {} as related keyword to ", parentName, keyword);
                    computeSuperclosureWithProperty(object, subsumptionProperty, depth - 1, score,
                        degradingCoefficient, keyword, relatedKeywords);
                }
            }
View Full Code Here

                    fieldValueStr = fieldValueStr.substring(Util.splitNamespace(fieldValueStr));
                } catch (UnsupportedEncodingException e) {
                    logger.warn("Unsupported encoding while trying to decode to related entity URI", e);
                    continue;
                }
                RelatedKeyword rkw = new RelatedKeywordImpl(fieldValueStr, 0, source);
                if (results.containsKey(source)) {
                    results.get(source).add(rkw);
                } else {
                    List<RelatedKeyword> rkwList = new ArrayList<RelatedKeyword>();
                    rkwList.add(rkw);
View Full Code Here

            List<Statement> nameStatements = userOntology.listStatements(keywordResource, nameProp,
                (RDFNode) null).toList();
            if (nameStatements.size() > 0) {
                String matchedResourceName = nameStatements.get(0).getString();
                double initialScore = results.get(uri);
                relatedKeywords.add(new RelatedKeywordImpl(matchedResourceName, initialScore,
                        RelatedKeyword.Source.ONTOLOGY));

                ClosureHelper.getInstance(userOntology).computeClosureWithProperty(keywordResource,
                    subsumptionProp, 2, initialScore, 1.5, keyword, relatedKeywords);
View Full Code Here

                    fieldValueStr = fieldValueStr.substring(Util.splitNamespace(fieldValueStr));
                } catch (UnsupportedEncodingException e) {
                    logger.warn("Unsupported encoding while trying to decode to related entity URI", e);
                    continue;
                }
                RelatedKeyword rkw = new RelatedKeywordImpl(fieldValueStr, 0, source);
                if (results.containsKey(source)) {
                    results.get(source).add(rkw);
                } else {
                    List<RelatedKeyword> rkwList = new ArrayList<RelatedKeyword>();
                    rkwList.add(rkw);
View Full Code Here

TOP

Related Classes of org.apache.stanbol.contenthub.search.related.RelatedKeywordImpl

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.