Examples of BindingSet


Examples of edu.umd.cs.findbugs.ba.bcp.BindingSet

        MethodGen methodGen = classContext.getMethodGen(method);
        CFG cfg = classContext.getCFG(method);


        // Get the variable referenced in the pattern instance.
        BindingSet bindingSet = match.getBindingSet();
        Binding binding = bindingSet.lookup("f");

        // Look up the field as an XField.
        // If it is volatile, then the instance is not a bug.
        FieldVariable field = (FieldVariable) binding.getVariable();
        XField xfield = Hierarchy.findXField(field.getClassName(), field.getFieldName(), field.getFieldSig(),
View Full Code Here

Examples of org.openrdf.query.BindingSet

        "SELECT X, P, Y FROM {X} P {Y}", null);

    Cursor<? extends BindingSet> iter = con.evaluate(query,
        EmptyBindingSet.getInstance(), false);

    BindingSet bindingSet = iter.next();

    assertEquals(bindingSet.getValue("X"), foo);
    assertEquals(bindingSet.getValue("P"), RDF.TYPE);
    assertEquals(bindingSet.getValue("Y"), bar);
    iter.close();
    con.close();

    store.shutDown();

    store = new MemoryStore(dataDir);
    store.initialize();

    factory = store.getURIFactory();
    foo = factory.createURI("http://www.foo.example/foo");
    bar = factory.createURI("http://www.foo.example/bar");

    con = store.getConnection();

    iter = con.evaluate(query, EmptyBindingSet.getInstance(), false);

    bindingSet = iter.next();

    assertEquals(bindingSet.getValue("X"), foo);
    assertEquals(bindingSet.getValue("P"), RDF.TYPE);
    assertEquals(bindingSet.getValue("Y"), bar);

    iter.close();
    con.addStatement(bar, RDF.TYPE, foo);
    con.close();
   
View Full Code Here

Examples of org.openrdf.query.BindingSet

    TupleResult queryResult = con.prepareTupleQuery(QueryLanguage.SERQL, query).evaluate();

    // Add all positive parser tests to the test suite
    while (queryResult.hasNext()) {
      BindingSet bindingSet = queryResult.next();
      String testName = bindingSet.getValue("testName").toString();
      String inputURL = bindingSet.getValue("inputURL").toString();
      String outputURL = bindingSet.getValue("outputURL").toString();

      String baseURL = BASE_URL + testName + ".ttl";

      suite.addTest(new PositiveParserTest(testName, inputURL, outputURL, baseURL));
    }

    queryResult.close();

    // Add the manifest for negative test cases to a repository and query it
    con.clear();
    url = TriGParserTestCase.class.getResource(MANIFEST_BAD_URL);
    con.add(url, base(url.toExternalForm()), RDFFormat.TURTLE);

    query = "SELECT testName, inputURL " + "FROM {} mf:name {testName}; "
        + "        mf:action {} qt:data {inputURL} " + "USING NAMESPACE "
        + "  mf = <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#>, "
        + "  qt = <http://www.w3.org/2001/sw/DataAccess/tests/test-query#>";
    queryResult = con.prepareTupleQuery(QueryLanguage.SERQL, query).evaluate();

    // Add all negative parser tests to the test suite
    while (queryResult.hasNext()) {
      BindingSet bindingSet = queryResult.next();
      String testName = bindingSet.getValue("testName").toString();
      String inputURL = bindingSet.getValue("inputURL").toString();

      String baseURL = BASE_URL + testName + ".ttl";

      suite.addTest(new NegativeParserTest(testName, inputURL, baseURL));
    }
View Full Code Here

Examples of org.openrdf.query.BindingSet

        + "               n3test:outputDocument {outputURL} "
        + "USING NAMESPACE n3test = <http://www.w3.org/2004/11/n3test#>";

    TupleResult queryResult = con.prepareTupleQuery(QueryLanguage.SERQL, query).evaluate();
    while (queryResult.hasNext()) {
      BindingSet bindingSet = queryResult.next();
      String testURI = bindingSet.getValue("testURI").toString();
      String inputURL = bindingSet.getValue("inputURL").toString();
      String outputURL = bindingSet.getValue("outputURL").toString();

      suite.addTest(new PositiveParserTest(testURI, inputURL, outputURL));
    }

    queryResult.close();

    // Add all negative parser tests to the test suite
    query = "SELECT testURI, inputURL " + "FROM {testURI} rdf:type {n3test:NegativeParserTest}; "
        + "               n3test:inputDocument {inputURL} "
        + "USING NAMESPACE n3test = <http://www.w3.org/2004/11/n3test#>";

    queryResult = con.prepareTupleQuery(QueryLanguage.SERQL, query).evaluate();

    while (queryResult.hasNext()) {
      BindingSet bindingSet = queryResult.next();
      String testURI = bindingSet.getValue("testURI").toString();
      String inputURL = bindingSet.getValue("inputURL").toString();

      suite.addTest(new NegativeParserTest(testURI, inputURL));
    }
    queryResult.close();
    con.close();
View Full Code Here

Examples of org.openrdf.query.BindingSet

        + "                test:outputDocument {OUTPUT}; "
        + "                test:status {\"APPROVED\"} "
        + "using namespace test = <http://www.w3.org/2000/10/rdf-tests/rdfcore/testSchema#>";
    TupleResult queryResult = con.prepareTupleQuery(QueryLanguage.SERQL, query).evaluate();
    while (queryResult.hasNext()) {
      BindingSet bindingSet = queryResult.next();
      String caseURI = bindingSet.getValue("TESTCASE").toString();
      String inputURL = bindingSet.getValue("INPUT").toString();
      String outputURL = bindingSet.getValue("OUTPUT").toString();
      suite.addTest(new PositiveParserTest(caseURI, inputURL, outputURL));
    }

    queryResult.close();

    // Add all negative parser tests
    query = "select TESTCASE, INPUT " + "from {TESTCASE} rdf:type {test:NegativeParserTest}; "
        + "                test:inputDocument {INPUT}; " + "                test:status {\"APPROVED\"} "
        + "using namespace test = <http://www.w3.org/2000/10/rdf-tests/rdfcore/testSchema#>";
    queryResult = con.prepareTupleQuery(QueryLanguage.SERQL, query).evaluate();
    while (queryResult.hasNext()) {
      BindingSet bindingSet = queryResult.next();
      String caseURI = bindingSet.getValue("TESTCASE").toString();
      String inputURL = bindingSet.getValue("INPUT").toString();
      suite.addTest(new NegativeParserTest(caseURI, inputURL));
    }

    queryResult.close();
    con.close();
View Full Code Here

Examples of org.openrdf.query.BindingSet

    TupleResult queryResult = con.prepareTupleQuery(QueryLanguage.SERQL, query).evaluate();

    // Add all positive parser tests to the test suite
    while (queryResult.hasNext()) {
      BindingSet bindingSet = queryResult.next();
      testName = ((Literal)bindingSet.getValue("testName")).getLabel();
      inputURL = ((URI)bindingSet.getValue("inputURL")).toString();
      outputURL = ((URI)bindingSet.getValue("outputURL")).toString();

      baseURL = BASE_URL + testName + ".ttl";

      suite.addTest(new PositiveParserTest(testName, inputURL, outputURL, baseURL));
    }

    queryResult.close();

    // Add the manifest for negative test cases to a repository and query it
    con.clear();
    url = TurtleParserTestCase.class.getResource(MANIFEST_BAD_URL);
    con.add(url, base(url.toExternalForm()), RDFFormat.TURTLE);

    query = "SELECT testName, inputURL " + "FROM {} mf:name {testName}; "
        + "        mf:action {} qt:data {inputURL} " + "USING NAMESPACE "
        + "  mf = <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#>, "
        + "  qt = <http://www.w3.org/2001/sw/DataAccess/tests/test-query#>";
    queryResult = con.prepareTupleQuery(QueryLanguage.SERQL, query).evaluate();

    // Add all negative parser tests to the test suite
    while (queryResult.hasNext()) {
      BindingSet bindingSet = queryResult.next();
      testName = ((Literal)bindingSet.getValue("testName")).toString();
      inputURL = ((URI)bindingSet.getValue("inputURL")).toString();

      baseURL = BASE_URL + testName + ".ttl";

      suite.addTest(new NegativeParserTest(testName, inputURL, baseURL));
    }
View Full Code Here

Examples of org.openrdf.query.BindingSet

          EmptyBindingSet.getInstance(), true);

      try {
        ValueFactory vf = getValueFactory();

        BindingSet bindings;
        while ((bindings = bindingsIter.next()) != null) {

          Value subj = bindings.getValue("subject");
          Value pred = bindings.getValue("predicate");
          Value obj = bindings.getValue("object");

          if (subj instanceof Resource && pred instanceof URI && obj != null) {
            statements.add(vf.createStatement((Resource)subj, (URI)pred, obj));
          }
        }
View Full Code Here

Examples of org.openrdf.query.BindingSet

    return currentIndex < bindingSets.size();
  }

  public BindingSet next() {
    if (hasNext()) {
      BindingSet result = get(currentIndex);
      lastReturned = currentIndex;
      currentIndex++;
      return result;
    }
View Full Code Here

Examples of org.openrdf.query.BindingSet

    return currentIndex > 0;
  }

  public BindingSet previous() {
    if (hasPrevious()) {
      BindingSet result = bindingSets.get(currentIndex - 1);
      currentIndex--;
      lastReturned = currentIndex;
      return result;
    }
View Full Code Here

Examples of org.openrdf.query.BindingSet

    lastReturned = -1;
  }

  public BindingSet remove(int index) {
    BindingSet result = bindingSets.remove(index);

    if (currentIndex > index) {
      currentIndex--;
    }
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.