Examples of BindingSet


Examples of org.openrdf.query.BindingSet

        + "  mfx = <http://www.openrdf.org/test-manifest-extensions#>, "
        + "  qt = <http://www.w3.org/2001/sw/DataAccess/tests/test-query#>";

    TupleResult tests = con.prepareTupleQuery(QueryLanguage.SERQL, query).evaluate();
    while (tests.hasNext()) {
      BindingSet testBindings = tests.next();
      String testName = testBindings.getValue("testName").toString();
      String queryFile = testBindings.getValue("query").toString();
      Value result = testBindings.getValue("result");
      if (MFX_CORRECT.equals(result)) {
        positiveTests.addTest(factory.createTest(testName, queryFile, result));
      }
      else if (MFX_PARSE_ERROR.equals(result)) {
        negativeTests.addTest(factory.createTest(testName, queryFile, result));
View Full Code Here

Examples of org.openrdf.query.BindingSet

        + "  qt = <http://www.w3.org/2001/sw/DataAccess/tests/test-query#>, "
        + "  tck = <urn:openrdf.org:sesame:tests#> ";

    TupleResult tests = con.prepareTupleQuery(QueryLanguage.SERQL, query).evaluate();
    while (tests.hasNext()) {
      BindingSet testBindings = tests.next();
      String testName = ((Literal)testBindings.getValue("testName")).getLabel();
      String inputFile = testBindings.getValue("input").toString();
      String queryFile = testBindings.getValue("query").toString();
      String resultFile = testBindings.getValue("result").toString();
      String entailment = ((Literal)testBindings.getValue("entailment")).getLabel();

      query = "SELECT graph " + "FROM {} mf:name {testName}; "
          + "        mf:action {} qt:graphData {graph} " + "WHERE testName = \""
          + SeRQLUtil.encodeString(testName) + "\" " + "USING NAMESPACE"
          + "  mf = <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#>,"
          + "  qt = <http://www.w3.org/2001/sw/DataAccess/tests/test-query#>";

      List<String> graphNames = new ArrayList<String>();

      TupleResult graphs = con.prepareTupleQuery(QueryLanguage.SERQL, query).evaluate();
      while (graphs.hasNext()) {
        BindingSet graphBindings = graphs.next();
        graphNames.add(graphBindings.getValue("graph").toString());
      }
      graphs.close();

      if (testName.startsWith("test-029:")) {
        logger.error("test-029 SKIPPED in {}", SeRQLQueryTestCase.class.getName());
View Full Code Here

Examples of org.openrdf.query.BindingSet

   *---------*/

  public void run() {
    evaluationThread = Thread.currentThread();
    try {
      BindingSet bindings;
      while (!closed && (bindings = leftIter.next()) != null) {
        Cursor<BindingSet> nextCursor = strategy.evaluate(rightArg, bindings);
        cursorQueue.put(nextCursor);
      }
    }
View Full Code Here

Examples of org.openrdf.query.BindingSet

  public BindingSet next()
    throws StoreException
  {
    while (currentCursor != null || (currentCursor = cursorQueue.next()) != null) {
      BindingSet result = currentCursor.next();
      if (result != null) {
        return result;
      }
      else {
        currentCursor.close();
View Full Code Here

Examples of org.openrdf.query.BindingSet

   *---------*/

  public void run() {
    evaluationThread = Thread.currentThread();
    try {
      BindingSet leftBindings;
      ValueExpr condition = join.getCondition();
      while (!closed && (leftBindings = leftIter.next()) != null) {
        Cursor<BindingSet> result = strategy.evaluate(join.getRightArg(), leftBindings);
        if (condition != null) {
          result = new FilterCursor(result, condition, scopeBindingNames, strategy);
View Full Code Here

Examples of org.openrdf.query.BindingSet

  public BindingSet next()
    throws StoreException
  {
    while (rightIter != null || (rightIter = rightQueue.next()) != null) {
      BindingSet rightNext = rightIter.next();
      if (rightNext != null) {
        return rightNext;
      }
      else {
        rightIter.close();
View Full Code Here

Examples of org.openrdf.query.BindingSet

  @Override
  public BindingSet next()
    throws StoreException
  {
    BindingSet next = super.next();
    if (next == null) {
      return null;
    }
    int size = bindings.size() + next.size();
    QueryBindingSet set = new QueryBindingSet(size);
    set.addAll(bindings);
    for (Binding binding : next) {
      set.setBinding(binding);
    }
View Full Code Here

Examples of org.openrdf.query.BindingSet

  }

  private TupleResult createSingletonQueryResult() {
    List<String> bindingNames = Collections.emptyList();

    BindingSet solution = EmptyBindingSet.getInstance();
    List<? extends BindingSet> bindingSets = Arrays.asList(solution);

    return new TupleResultImpl(bindingNames, bindingSets);
  }
View Full Code Here

Examples of org.openrdf.query.BindingSet

    try {
      assertNotNull(result);
      assertTrue(result.hasNext());

      while (result.hasNext()) {
        BindingSet solution = result.next();
        assertTrue(solution.hasBinding("name"));
        assertTrue(solution.hasBinding("mbox"));

        Value nameResult = solution.getValue("name");
        Value mboxResult = solution.getValue("mbox");

        assertTrue((nameAlice.equals(nameResult) || nameBob.equals(nameResult)));
        assertTrue((mboxAlice.equals(mboxResult) || mboxBob.equals(mboxResult)));
      }
    }
View Full Code Here

Examples of org.openrdf.query.BindingSet

    try {
      assertNotNull(result);
      assertTrue(result.hasNext());

      while (result.hasNext()) {
        BindingSet solution = result.next();
        assertTrue(solution.hasBinding("person"));
        assertEquals(alexander, solution.getValue("person"));
      }
    }
    finally {
      result.close();
    }
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.