Package com.esri.ontology.service.control

Examples of com.esri.ontology.service.control.OntologyProcessor


      }
    }

    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);
    }
View Full Code Here


    response.setCharacterEncoding("UTF-8");
    response.setContentType(format.isOwl() ? "text/html" : "text/plain");

    // creates ontology context
    Context ontContext = Context.extract(this.getServletContext());
    OntologyProcessor ontProcessor = new OntologyProcessor(ontContext,
      request.getLocale());

    // checks if ontology context is ready
    if (!ontContext.isReady()) {
      log.info("Ontology context not ready.");
      response.setStatus(response.SC_SERVICE_UNAVAILABLE);
      return;
    }

    // checks if query criteria are correct
    if (queryCriteria.getTerm().length() == 0) {
      log.info("No search term entered.");
      response.setStatus(response.SC_BAD_REQUEST);
      return;
    }

    // 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.control.OntologyProcessor

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.