Examples of prepareTupleQuery()


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

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

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

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

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

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

    String query = "SELECT DISTINCT manifestFile FROM {x} rdf:first {manifestFile} "
        + "USING NAMESPACE mf = <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#>, "
        + "  qt = <http://www.w3.org/2001/sw/DataAccess/tests/test-query#>";

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

    while (manifestResults.hasNext()) {
      BindingSet bindingSet = manifestResults.next();
      String manifestFile = bindingSet.getValue("manifestFile").toString();
      suite.addTest(SPARQLQueryTest.suite(manifestFile, factory));
View Full Code Here

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

    ManifestTest.addTurtle(con, manifest, MANIFEST_FILE);

    logger.info("Searching for sub-manifests");
    List<String> subManifestList = new ArrayList<String>();

    TupleResult subManifests = con.prepareTupleQuery(QueryLanguage.SERQL, SUBMANIFEST_QUERY).evaluate();
    while (subManifests.hasNext()) {
      BindingSet bindings = subManifests.next();
      subManifestList.add(bindings.getValue("subManifest").toString());
    }
    subManifests.close();
View Full Code Here

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

      ManifestTest.addTurtle(con, subManifestURL, subManifest);

      TestSuite subSuite = new TestSuite(subManifest.substring(HOST.length()));

      logger.info("Creating test cases for {}", subManifest);
      TupleResult tests = con.prepareTupleQuery(QueryLanguage.SERQL, TESTCASE_QUERY).evaluate();
      while (tests.hasNext()) {
        BindingSet bindingSet = tests.next();

        String testURI = bindingSet.getValue("TestURI").toString();
        String testName = bindingSet.getValue("Name").toString();
View Full Code Here

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

    query.append("                                               [qt:data {defaultGraph}] ");
    query.append(" USING NAMESPACE ");
    query.append("  mf = <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#>, ");
    query.append("  dawgt = <http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#>, ");
    query.append("  qt = <http://www.w3.org/2001/sw/DataAccess/tests/test-query#>");
    TupleQuery testCaseQuery = con.prepareTupleQuery(QueryLanguage.SERQL, query.toString());

    query.setLength(0);
    query.append(" SELECT graph ");
    query.append(" FROM {action} qt:graphData {graph} ");
    query.append(" USING NAMESPACE ");
View Full Code Here

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

    query.setLength(0);
    query.append(" SELECT graph ");
    query.append(" FROM {action} qt:graphData {graph} ");
    query.append(" USING NAMESPACE ");
    query.append(" qt = <http://www.w3.org/2001/sw/DataAccess/tests/test-query#>");
    TupleQuery namedGraphsQuery = con.prepareTupleQuery(QueryLanguage.SERQL, query.toString());

    query.setLength(0);
    query.append("SELECT 1 ");
    query.append(" FROM {testURI} mf:resultCardinality {mf:LaxCardinality}");
    query.append(" USING NAMESPACE mf = <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#>");
View Full Code Here

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

    query.setLength(0);
    query.append("SELECT 1 ");
    query.append(" FROM {testURI} mf:resultCardinality {mf:LaxCardinality}");
    query.append(" USING NAMESPACE mf = <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#>");
    TupleQuery laxCardinalityQuery = con.prepareTupleQuery(QueryLanguage.SERQL, query.toString());

    logger.debug("evaluating query..");
    TupleResult testCases = testCaseQuery.evaluate();
    while (testCases.hasNext()) {
      BindingSet bindingSet = testCases.next();
View Full Code Here

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

    RepositoryConnection conn = repository.getConnection();
    try {
      String chordataQuery = "SELECT DISTINCT * WHERE {<" + RNA_CHORDATA + "> ?P ?Y . } ";

      // first test: evaluate the query anonymously
      TupleQuery query = conn.prepareTupleQuery(QueryLanguage.SPARQL, chordataQuery);

      TupleResult tr = query.evaluate();
      try {
        assertFalse(
            "query result should be empty: item is protected and current user has no viewing permission",
View Full Code Here

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

    try {
      Session session = SessionManager.getOrCreate();
      session.setUsername("trezorix");

      String conceptQuery = "SELECT DISTINCT ?X WHERE {?X a <" + SKOS_NS + "Concept" + "> ; ?P ?Y . } ";
      TupleQuery query = con.prepareTupleQuery(QueryLanguage.SPARQL, conceptQuery);

      TupleResult tr = query.evaluate();
      System.out.println(query.toString());

      try {
View Full Code Here

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

        + "        mf:action {query}; " + "        mf:result {result} " + "USING NAMESPACE "
        + "  mf = <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#>, "
        + "  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");
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.