Examples of Query


Examples of de.dfki.owlsmx.gui.data.Query

       
        // Get a SortedSet with the loaded queries
        SortedSet queries = new TreeSet();
        queries = TestCollection.getInstance().getQueries();
       
        Query query;
        Map result = new HashMap();
        SortedSet set = new TreeSet();
       
        // Run through the set of queries and match them one by one
        current = 1;
        for(Iterator iter = queries.iterator(); iter.hasNext();current++) {
            query = (Query) iter.next();
            System.out.println("MatchmakerInterface: Matching query: " + query.getURI().toString() + ", " + current + "/" + queries.size());
            set = MatchmakerInterface.getInstance().matchRequest(query.getURI(),GUIState.getInstance().getMinDegree(), GUIState.getInstance().getTreshold());      
            result.put(query,set);
        }
       
        /*
         * Show the results of the matchmaking
         *
         * 0 - Exact match
         * 1 - Plug-in match
         * 2 - Subsumes match
         * 3 - Subsumed-by match
         * 4 - Nearest Neighbour match
         */
       
        System.out.println("***************************");
        System.out.println("Results:\n");
//        System.out.println(result.toString());
       
        // Extra output
//        System.out.println("Some extra output:\n**********************");
        double max_SynSim, min_SynSim;
        max_SynSim = 0;
        min_SynSim = 10;
        String uri, s_uri, result_count;
        String write;
        int counter = 1;
        int rqueries = 1;
        Iterator answerSet;
        HybridServiceItem item;
        Set ioset;
        for(Iterator iter = result.keySet().iterator();iter.hasNext();){
            query = (Query) iter.next();
            uri = query.getURI().toString();
            if (uri.contains("/"))
                uri = uri.substring(uri.lastIndexOf("/")+1);
            write = "Query " + rqueries + " " + uri;            
            //write = write.replaceAll("[\\r\\f]","");
            System.out.println(write);
            System.out.println("Inputs:");
            ioset = query.getInputs();
            for(Object input : ioset){
                System.out.println("  " + input.toString());
            }
            System.out.println("Outputs:");
            ioset = query.getOutputs();
            for(Object input : ioset){
                System.out.println("  " + input.toString());
            }
           
            for (answerSet = ((SortedSet) result.get(query)).iterator();answerSet.hasNext();) {
View Full Code Here

Examples of de.fzi.herakles.commons.Query

   * get the index of cache key
   * @param key the cache key(query)
   * @return the index of the query result in the cahe, if cache miss return <code>null</code>
   */
  private Integer getIndex(CacheKey key){
    Query query = (Query) key;
   
    for(Object o: indexMap.keySet()){
      Query q = (Query) o;
      if(query.equals(q)){
        return (Integer)indexMap.get(o);
      }
    }
    return null;
View Full Code Here

Examples of de.iritgo.aktera.query.Query

   * @throws QueryException in case of a query failure.
   */
  public static int executeCountQuery(ModelRequest req, String queryId, Object... params)
    throws ModelException, QueryException
  {
    Query query = (Query) req.getService(Query.ROLE, queryId);

    for (int i = 0; i + 1 < params.length;)
    {
      query.setCriteria(params[i].toString(), params[i + 1]);
      i += 2;
    }

    List res = query.getQueryResults();

    if (res.size() > 0)
    {
      return NumberTools.toInt(((Map) res.get(0)).get("count"), - 1);
    }
View Full Code Here

Examples of de.sebastianbenz.task.query.Query

  public ICompletionProposal[] computeCompletionProposals(
      String currentModelToParse, int cursorPosition) {
    if (currentModelToParse == null) {
      currentModelToParse = "";
    }
    Query query = queryParser.parse(currentModelToParse);
    if (query == null) {
      return new ICompletionProposal[0];
    }
    final XtextResource xtextResource = (XtextResource) query.eResource();
    final IXtextDocument xtextDocument = getDocument(xtextResource,
        currentModelToParse);

    XtextSourceViewerConfiguration configuration = configurationProvider
        .get();
View Full Code Here

Examples of de.uni_mannheim.swt.codeconjurer.domain.search.Query

    logger.debug("Make sure the recommendations view is present...");
    PluginUI.showRecommendationsView();
    logger.debug("Fetch source from active editor");
    ITypeRoot typeRoot = JavaUI.getEditorInputTypeRoot(editor
        .getEditorInput());
    Query query = new Query(typeRoot);
    logger.debug("Sourcecode\r\n" + query.getSource() + "\r\n");
    logger.debug("Query: " + query.getMqlQuery());
    final StandardSearch search = new StandardSearch(editor, "Search for ",
        query);
    // Delegate the search event listeners to the search
    for (SearchEventListener listener : listeners) {
      search.addSearchEventListener(listener);
View Full Code Here

Examples of de.unigoettingen.sub.search.opac.Query

        if (verbose) {
            Helper.setMeldung(null, Helper.getTranslation("CatalogueUsage") + ": ", this.coc.getDescription());
        }
        GetOpac myOpac = new GetOpac(cat);
        myOpac.setData_character_encoding(this.coc.getCharset());
        Query myQuery = new Query(inSuchbegriff, inSuchfeld);
        /* im Notfall ohne Treffer sofort aussteigen */
        this.hitcount = myOpac.getNumberOfHits(myQuery);
        if (this.hitcount == 0) {
            return null;
        }

        /*
         * -------------------------------- Opac abfragen und erhaltenes Dom-Dokument in JDom-Dokument umwandeln --------------------------------
         */
        Node myHitlist = myOpac.retrievePicaNode(myQuery, 1);
        /* Opac-Beautifier aufrufen */
        myHitlist = this.coc.executeBeautifier(myHitlist);
        Document myJdomDoc = new DOMBuilder().build(myHitlist.getOwnerDocument());
        Element myFirstHit = myJdomDoc.getRootElement().getChild("record");

        /* von dem Treffer den Dokumententyp ermitteln */
        this.gattung = getGattung(myFirstHit);

        myLogger.debug("Gattung: " + this.gattung);
        /*
         * -------------------------------- wenn der Treffer ein Volume eines Multivolume-Bandes ist, dann das Sammelwerk überordnen
         * --------------------------------
         */
        // if (isMultivolume()) {
        if (getOpacDocType().isMultiVolume()) {
            /* Sammelband-PPN ermitteln */
            String multiVolumePpn = getPpnFromParent(myFirstHit, "036D", "9");
            if (multiVolumePpn != "") {
                /* Sammelband aus dem Opac holen */

                myQuery = new Query(multiVolumePpn, "12");
                /* wenn ein Treffer des Parents im Opac gefunden wurde */
                if (myOpac.getNumberOfHits(myQuery) == 1) {
                    Node myParentHitlist = myOpac.retrievePicaNode(myQuery, 1);
                    /* Opac-Beautifier aufrufen */
                    myParentHitlist = this.coc.executeBeautifier(myParentHitlist);
                    /* Konvertierung in jdom-Elemente */
                    Document myJdomDocMultivolumeband = new DOMBuilder().build(myParentHitlist.getOwnerDocument());

                    /* Testausgabe */
                    // XMLOutputter outputter = new XMLOutputter();
                    // FileOutputStream output = new
                    // FileOutputStream("D:/fileParent.xml");
                    // outputter.output(myJdomDocMultivolumeband.getRootElement(),
                    // output);
                    /* dem Rootelement den Volume-Treffer hinzufügen */
                    myFirstHit.getParent().removeContent(myFirstHit);
                    myJdomDocMultivolumeband.getRootElement().addContent(myFirstHit);

                    /* Testausgabe */
                    // output = new FileOutputStream("D:/fileFull.xml");
                    // outputter.output(myJdomDocMultivolumeband.getRootElement(),
                    // output);
                    myJdomDoc = myJdomDocMultivolumeband;
                    myFirstHit = myJdomDoc.getRootElement().getChild("record");

                    /* die Jdom-Element wieder zurück zu Dom konvertieren */
                    DOMOutputter doutputter = new DOMOutputter();
                    myHitlist = doutputter.output(myJdomDocMultivolumeband);
                    /*
                     * dabei aber nicht das Document, sondern das erste Kind nehmen
                     */
                    myHitlist = myHitlist.getFirstChild();
                }
            }
        }

        /*
         * -------------------------------- wenn der Treffer ein Contained Work ist, dann übergeordnetes Werk --------------------------------
         */
        // if (isContainedWork()) {
        if (getOpacDocType().isContainedWork()) {
            /* PPN des übergeordneten Werkes ermitteln */
            String ueberGeordnetePpn = getPpnFromParent(myFirstHit, "021A", "9");
            if (ueberGeordnetePpn != "") {
                /* Sammelband aus dem Opac holen */
                myQuery = new Query(ueberGeordnetePpn, "12");
                /* wenn ein Treffer des Parents im Opac gefunden wurde */
                if (myOpac.getNumberOfHits(myQuery) == 1) {
                    Node myParentHitlist = myOpac.retrievePicaNode(myQuery, 1);
                    /* Opac-Beautifier aufrufen */
                    myParentHitlist = this.coc.executeBeautifier(myParentHitlist);
View Full Code Here

Examples of edu.berkeley.cs.db.yfilterplus.queryparser.Query

    protected void setUp() throws Exception {
        super.setUp();
    }

    protected Integer addQuery(String queryText) throws Exception {
        Query query = parseQuery(queryText);
        return new Integer(filter.addQuery(query));
    }
View Full Code Here

Examples of eu.balticdiversity.search.models.Query

    this.dao = dao;
  }
 
  @Override
  public void execute() throws Exception {
    Query query = parseQuery();
    Document response = generateResponse(query);
    String format = req.getParameter("format");
    if (format == null) {
      writeXMLToOut(response);
    } else if (format.equals("json")) {
View Full Code Here

Examples of gov.nasa.arc.mct.test.util.gui.Query

    f2.set(view, eList);

    ((ValueModel)view).clearModel();
   
    manifestation.updateFromFeed(data);
    JLabelFixture labelFixture = new Query().labelIn(fixture);
    labelFixture.requireText("1");
   
    JRadioButtonFixture buttonA = new Query().accessibleNameMatches("Alpha Value: ").radioButtonIn(fixture);
    buttonA.check();
    manifestation.updateFromFeed(data);
   
    JTableCellFixture cell = tableFixture.cell(row(0).column(2));
    JTableCellFixture cell2 = tableFixture.cell(row(1).column(2));
    cell.requireValue("1");
    cell2.requireValue("1");
   
    buttonA.uncheck();
    JRadioButtonFixture buttonI = new Query().accessibleNameMatches("Test Value: ").radioButtonIn(fixture);
    buttonI.check();
    JTextComponentFixture textFixture = new Query().textBoxIn(fixture);
    textFixture.enterText("2");
    manifestation.updateFromFeed(data);
    cell.requireValue("2");
    cell2.requireValue("2");
   
View Full Code Here

Examples of hendrey.orm.Query

  public Contact load(long id) {
    Connection con = null;
    try {
      con = dataSource.getConnection();
      Query q = dict.getQuery("byId");
      dbSess.setParameter("id", new Long(id));
      return (Contact) dbSess.executeQuery(con, q).populateNext(
          new Contact());
    } catch (SQLException ex) {
      throw new RuntimeException(ex);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.