Examples of execAsk()


Examples of com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execAsk()

            authContext.put(Service.queryAuthPwd, "password");
            serviceContext.put(urlRoot, authContext);
            ctx.put(Service.serviceContext, serviceContext);

            qe.setAuthenticator(new ServiceAuthenticator());
            Assert.assertTrue(qe.execAsk());
        } finally {
            ctx.remove(Service.serviceContext);
        }
    }
   
View Full Code Here

Examples of com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execAsk()

        QueryEngineHTTP qe = (QueryEngineHTTP) QueryExecutionFactory.sparqlService(serviceQuery, "ASK { }");

        // Auth credentials for valid user with correct password
        // Use service authenticator with fallback credentials.
        qe.setAuthenticator(new ServiceAuthenticator("allowed", "password".toCharArray()));
        Assert.assertTrue(qe.execAsk());
     }
   
    @Test
    public void query_with_auth_13() throws URISyntaxException {
        QueryEngineHTTP qe = (QueryEngineHTTP) QueryExecutionFactory.sparqlService(serviceQuery, "ASK { }");
View Full Code Here

Examples of com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execAsk()

        // Auth credentials for valid user with correct password and scoped to
        // base URI of the actual service URL
        ScopedAuthenticator authenticator = new ScopedAuthenticator(new URI(urlRoot), "allowed", "password".toCharArray());
        qe.setAuthenticator(authenticator);
        Assert.assertTrue(qe.execAsk());
    }
   
    @Test
    public void query_with_auth_14() throws URISyntaxException {
        QueryEngineHTTP qe = (QueryEngineHTTP) QueryExecutionFactory.sparqlService(serviceQuery, "ASK { }");
View Full Code Here

Examples of com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execAsk()

        // Auth credentials for valid user with correct password and scoped to
        // base URI of the actual service URL
        ScopedAuthenticator authenticator = new ScopedAuthenticator(new URI("http://localhost:" + port), "allowed", "password".toCharArray());
        qe.setAuthenticator(authenticator);
        Assert.assertTrue(qe.execAsk());
    }

    @Test(expected = HttpException.class)
    public void update_with_auth_01() {
        UpdateRequest updates = UpdateFactory.create("CREATE SILENT GRAPH <http://graph>");
View Full Code Here

Examples of com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execAsk()

              + "ASK {[] rdf:type <" + possible + "> }";
        }
        try {
          Query query = Query.create(sparqlString);
          QueryEngineHTTP qExecution = QueryExecutionFactory.createServiceRequest(endpoint, query);
          if (qExecution.execAsk()) {
            certains.get(type).add(possible);
          }
        } catch (Exception e) {
          //fail silently, don't care!
        }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execAsk()

            authContext.put(Service.queryAuthPwd, "password");
            serviceContext.put(urlRoot, authContext);
            ctx.put(Service.serviceContext, serviceContext);

            qe.setAuthenticator(new ServiceAuthenticator());
            Assert.assertTrue(qe.execAsk());
        } finally {
            ctx.remove(Service.serviceContext);
        }
    }
   
View Full Code Here

Examples of com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execAsk()

        QueryEngineHTTP qe = (QueryEngineHTTP) QueryExecutionFactory.sparqlService(serviceQuery, "ASK { }");

        // Auth credentials for valid user with correct password
        // Use service authenticator with fallback credentials.
        qe.setAuthenticator(new ServiceAuthenticator("allowed", "password".toCharArray()));
        Assert.assertTrue(qe.execAsk());
     }
   
    @Test
    public void query_with_auth_13() throws URISyntaxException {
        QueryEngineHTTP qe = (QueryEngineHTTP) QueryExecutionFactory.sparqlService(serviceQuery, "ASK { }");
View Full Code Here

Examples of com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execAsk()

        // Auth credentials for valid user with correct password and scoped to
        // base URI of the actual service URL
        ScopedAuthenticator authenticator = new ScopedAuthenticator(new URI(urlRoot), "allowed", "password".toCharArray());
        qe.setAuthenticator(authenticator);
        Assert.assertTrue(qe.execAsk());
    }
   
    @Test
    public void query_with_auth_14() throws URISyntaxException {
        QueryEngineHTTP qe = (QueryEngineHTTP) QueryExecutionFactory.sparqlService(serviceQuery, "ASK { }");
View Full Code Here

Examples of com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execAsk()

        // Auth credentials for valid user with correct password and scoped to
        // base URI of the actual service URL
        ScopedAuthenticator authenticator = new ScopedAuthenticator(new URI("http://localhost:" + port), "allowed", "password".toCharArray());
        qe.setAuthenticator(authenticator);
        Assert.assertTrue(qe.execAsk());
    }

    @Test(expected = HttpException.class)
    public void update_with_auth_01() {
        UpdateRequest updates = UpdateFactory.create("CREATE SILENT GRAPH <http://graph>");
View Full Code Here

Examples of com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execAsk()

    @Test(expected = QueryExceptionHTTP.class)
    public void query_with_auth_01() {
        QueryEngineHTTP qe = (QueryEngineHTTP) QueryExecutionFactory.sparqlService(serviceQuery, "ASK { }");
        // No auth credentials should result in an error
        qe.execAsk();
    }

    @Test(expected = QueryExceptionHTTP.class)
    public void query_with_auth_02() {
        QueryEngineHTTP qe = (QueryEngineHTTP) QueryExecutionFactory.sparqlService(serviceQuery, "ASK { }");
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.