Package com.esri.ontology.service.catalog

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


   * @param selection selection criteria
   * @return collection of terms
   */
  public Terms search(QueryCriteria queryCriteria, Selection selection) {

    Terms terms = new Terms();

    OntModelUtil ontModelUtil = new OntModelUtil(ontCtx.getModel());

    OntClass search = ontCtx.getModel().getOntClass(
      ontModelUtil.getCode(queryCriteria.getTerm(), locale));

    if (search == null) {
      log.fine("Query: " + queryCriteria + " returned no results.");
      return terms;
    }

    // process categories
    if (selection.isCategories()) {
      processCategories(ontModelUtil, queryCriteria, search, terms);
    }

    // process neighbors
    if (selection.isNeighbors()) {
      processNeighbors(ontModelUtil, queryCriteria, search, terms);

    }

    terms.removeByThreshold(queryCriteria.getThreshold());
    terms.sortByCount();

    return terms;
  }
View Full Code Here


      public void write(int b) throws IOException {
        sb.append((char) b);
      }
    };

    Terms terms = new Terms();

    if (!ontCtx.isReady()) {
      synchronized (ontCtx) {
        try {
          ontCtx.wait(10000);
        } catch (InterruptedException ex) {
        }
      }
    }

    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);

    OntologyWriter ontologyWriter =
View Full Code Here

    // performs ontology search
    log.info(
      "Performing ontology search. query criteria: " + queryCriteria + "; selection: " + selection + "; format: " + format);
    Date start = new Date();
    Terms terms = ontProcessor.search(queryCriteria, selection);
    Date end = new Date();
    log.info("Ontology search has been completed in " + (end.getTime() - start.
      getTime()) + " milliseconds.");

    OntologyWriter ontWriter = new OntologyWriter(out, ontContext, queryCriteria.getTerm(), format);
View Full Code Here

TOP

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

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.