Package org.apache.clerezza.rdf.core.sparql.query

Examples of org.apache.clerezza.rdf.core.sparql.query.AskQuery


    queryStrBuf.append("ASK { ?").append(variable).append(" <")
        .append(predicate).append("> \"").append(object).append("\" }");

    Query q = QueryParser.getInstance().parse(queryStrBuf.toString());
    Assert.assertTrue(AskQuery.class.isAssignableFrom(q.getClass()));
    AskQuery askQuery = (AskQuery) q;

    GraphPattern gp = (GraphPattern) askQuery.getQueryPattern()
        .getGraphPatterns().toArray()[0];
    Assert.assertTrue(BasicGraphPattern.class.isAssignableFrom(gp.getClass()));
    BasicGraphPattern bgp = (BasicGraphPattern) gp;

    Set<TriplePattern> triplePatterns = bgp.getTriplePatterns();
View Full Code Here


  @Test
  public void executeSparqlQueryWithEngineWithAskQuery() throws Exception {
    // Prepare
    injectQueryEngine(queryEngine);
    TripleCollection tripleCollection = new SimpleMGraph();
    AskQuery query = Mockito.mock(AskQuery.class);

    Mockito.when(
        queryEngine.execute((TcManager) Mockito.anyObject(),
            (TripleCollection) Mockito.anyObject(),
            (Query) Mockito.anyObject())).thenReturn(Boolean.TRUE);
View Full Code Here

        queryStrBuf.append("ASK { ?").append(variable).append(" <")
                .append(predicate).append("> \"").append(object).append("\" }");

        Query q = QueryParser.getInstance().parse(queryStrBuf.toString());
        Assert.assertTrue(AskQuery.class.isAssignableFrom(q.getClass()));
        AskQuery askQuery = (AskQuery) q;

        GraphPattern gp = (GraphPattern) askQuery.getQueryPattern()
                .getGraphPatterns().toArray()[0];
        Assert.assertTrue(BasicGraphPattern.class.isAssignableFrom(gp.getClass()));
        BasicGraphPattern bgp = (BasicGraphPattern) gp;

        Set<TriplePattern> triplePatterns = bgp.getTriplePatterns();
View Full Code Here

TOP

Related Classes of org.apache.clerezza.rdf.core.sparql.query.AskQuery

Copyright © 2018 www.massapicom. 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.