Package com.esri.ontology.service.catalog

Examples of com.esri.ontology.service.catalog.Term


        Filter.any);
      if (path != null) {

        float ii = 1;
        int TopicRecord = numberrecord;
        Term countCat = new Term(key, Relationship.SubClassOf, path.size());
        terms.add(countCat);
        numberrecord++;

        for (Iterator it = path.iterator(); it.hasNext();) {

          Statement statement = (Statement) it.next();
          OntClass onts =
            ontCtx.getModel().getOntClass(statement.getSubject().getNameSpace());
          OntClass onto =
            ontCtx.getModel().getOntClass(statement.getObject().toString());
          if (statement.getPredicate().getLocalName().equalsIgnoreCase(
            "seeAlso")) {
            ii = ii - (1 - queryCriteria.getSeeAlsoWeight());
          } else if (statement.getPredicate().getLocalName().equalsIgnoreCase(
            "subClassOf")) {
            ii = ii - (1 - queryCriteria.getSubClassWeight());
          }
          Term countCatDetails = new Term(onts.getLabel(locale.getLanguage()),
            Relationship.parse(statement.getPredicate().getLocalName()),
            onto.getLabel(locale.getLanguage()), ii);
          terms.add(countCatDetails);
          numberrecord++;
          ii++;

        }
        Term countCat1 = new Term(key, Relationship.SubClassOf, ii - 1);
        terms.set(TopicRecord, countCat1);
      }
    }
  }
View Full Code Here


          for (Iterator iter = search.listSeeAlso(); iter.hasNext();) {
            OntResource ontResource = (OntResource) iter.next();

            if (!termsFound.contains(ontResource.getLabel(locale.getLanguage()))) {
              Term term =
                new Term(search.getLabel(locale.getLanguage()),
                Relationship.SeeAlso,
                ontResource.getLabel(locale.getLanguage()),
                queryCriteria.getSeeAlsoWeight() * (lev + 1));
              terms.add(term);
              ontClasses.add(ontResource.asClass());
              termsFound.add(ontResource.getLabel(locale.getLanguage()));
            }
          }
        }

        if (search.hasSubClass()) {

          for (Iterator iter = search.listSubClasses(); iter.hasNext();) {
            OntResource ontResource = (OntResource) iter.next();

            if (!termsFound.contains(ontResource.getLabel(locale.getLanguage()))) {
              Term term =
                new Term(ontResource.getLabel(locale.getLanguage()),
                Relationship.SubClassOf,
                search.getLabel(locale.getLanguage()),
                queryCriteria.getSubClassWeight() * (lev + 1));
              terms.add(term);
              ontClasses.add(ontResource.asClass());
              termsFound.add(ontResource.getLabel(locale.getLanguage()));
            }
          }

          if (search.hasSuperClass()) {

            for (Iterator iter = search.listSuperClasses(); iter.hasNext();) {
              OntResource ontResource = (OntResource) iter.next();

              if (!termsFound.contains(
                ontResource.getLabel(locale.getLanguage()))) {
                Term term =
                  new Term(search.getLabel(locale.getLanguage()),
                  Relationship.SubClassOf,
                  ontResource.getLabel(locale.getLanguage()),
                  queryCriteria.getSubClassWeight() * (lev + 1));
                terms.add(term);
                ontClasses.add(ontResource.asClass());
View Full Code Here

    if (ontCtx.isReady()) {
      queryCriteria.setTerm(term);
      OntologyProcessor processor = new OntologyProcessor(ontCtx, locale);
      terms = processor.search(queryCriteria, selection);
    } else {
      Term tm = new Term(term,Term.Relationship.SeeAlso,1);
      terms.add(tm);
    }

    PrintWriter writer = new PrintWriter(os);
View Full Code Here

TOP

Related Classes of com.esri.ontology.service.catalog.Term

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.