Package org.openrdf.repository

Examples of org.openrdf.repository.RepositoryConnection.prepareTupleQuery()


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


    RepositoryConnection conn = null;
    try {
      conn = repo.getConnection();

      HTTPTupleQuery query = (HTTPTupleQuery)conn.prepareTupleQuery(qInfo.getQueryLanguage(),
          qInfo.getQueryString());
      query.setIncludeInferred(qInfo.isIncludeInferred());
      try {
        queryResult = query.evaluate();
      }
View Full Code Here

    RepositoryConnection conn = null;
    try {
      conn = repo.getConnection();
      String query = "SELECT DISTINCT C FROM {} rdf:type {C}";
      TupleQueryResult classes = conn.prepareTupleQuery(QueryLanguage.SERQL, query).evaluate();
      try {
        while (classes.hasNext()) {
          BindingSet bindingSet = classes.next();
          Resource resource = (Resource)bindingSet.getValue("C");
          result.add(resource);
View Full Code Here

    String query = "SELECT testName, inputURL, outputURL " + "FROM {} mf:name {testName}; "
        + "        mf:result {outputURL}; " + "        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#>";

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

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

      writeln("Evaluating query...");
      long startTime = System.currentTimeMillis();

      Collection<Namespace> namespaces = con.getNamespaces().addTo(new ArrayList<Namespace>());

      TupleQueryResult tupleQueryResult = con.prepareTupleQuery(ql, queryString).evaluate();

      try {
        int resultCount = 0;
        List<String> bindingNames = tupleQueryResult.getBindingNames();
View Full Code Here

        + "from {TESTCASE} rdf:type {test:PositiveParserTest}; "
        + "                test:inputDocument {INPUT}; "
        + "                test:outputDocument {OUTPUT}; "
        + "                test:status {\"APPROVED\"} "
        + "using namespace test = <http://www.w3.org/2000/10/rdf-tests/rdfcore/testSchema#>";
    TupleQueryResult 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();
View Full Code Here

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

        // query result directly to the client.

        List<String> bindingNames = new ArrayList<String>();
        List<BindingSet> bindingSets = new ArrayList<BindingSet>();

        TupleQueryResult queryResult = con.prepareTupleQuery(QueryLanguage.SERQL, REPOSITORY_LIST_QUERY).evaluate();
        try {
          // Determine the repository's URI
          StringBuffer requestURL = request.getRequestURL();
          if (requestURL.charAt(requestURL.length() - 1) != '/') {
            requestURL.append('/');
View Full Code Here

    String query = "SELECT testName, inputURL, outputURL " + "FROM {} mf:name {testName}; "
        + "        mf:result {outputURL}; " + "        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#>";

    TupleQueryResult 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();
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.