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

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


        .equals(new UriRef(defaultGraph)));

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

    Set<TriplePattern> triplePatterns = bgp.getTriplePatterns();
    Assert.assertTrue(triplePatterns.size()==1);

    ResourceOrVariable s = new ResourceOrVariable(new UriRef(subject));
    UriRefOrVariable p = new UriRefOrVariable(new UriRef(predicate));
    ResourceOrVariable o = new ResourceOrVariable(new Variable(variable));
View Full Code Here


        "SELECT * WHERE {?a ?x 'tiger' . ?a ?x 'lion'@en . }");

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

    Set<TriplePattern> triplePatterns = bgp.getTriplePatterns();
    Assert.assertTrue(triplePatterns.size()==2);

    Assert.assertTrue(triplePatterns.contains(new SimpleTriplePattern(
        new Variable("a"), new Variable("x"),
        new PlainLiteralImpl("tiger"))));
View Full Code Here

        new SimpleTriplePattern(s, p, o)));

    GraphPattern gp = (GraphPattern) constructQuery.getQueryPattern()
        .getGraphPatterns().toArray()[0];
    Assert.assertTrue(BasicGraphPattern.class.isAssignableFrom(gp.getClass()));
    BasicGraphPattern bgp = (BasicGraphPattern) gp;
    triplePatterns = bgp.getTriplePatterns();
    Assert.assertTrue(triplePatterns.size()==1);

    s = new ResourceOrVariable(new Variable(variable2));
    p = new UriRefOrVariable(new UriRef(predicate2));
View Full Code Here

    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();
    Assert.assertTrue(triplePatterns.size()==1);

    Assert.assertTrue(triplePatterns.contains(
        new SimpleTriplePattern(new Variable(variable),
        new UriRef(predicate), new PlainLiteralImpl(object))));
View Full Code Here

        .equals(new Variable(variable)));

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

    Set<TriplePattern> triplePatterns = bgp.getTriplePatterns();
    Assert.assertTrue(triplePatterns.size()==1);

    ResourceOrVariable s = new ResourceOrVariable(new UriRef(base+subject));
    UriRefOrVariable p = new UriRefOrVariable(new UriRef(prefixUri+predicate));
    ResourceOrVariable o = new ResourceOrVariable(new Variable(variable));
View Full Code Here

    GraphPattern gp = (GraphPattern) ggp.getGraphPatterns().toArray()[0];
    Assert.assertTrue(OptionalGraphPattern.class.isAssignableFrom(gp.getClass()));
    OptionalGraphPattern ogp = (OptionalGraphPattern) gp;
    Assert.assertTrue(BasicGraphPattern.class.isAssignableFrom(
        ogp.getMainGraphPattern().getClass()));
    BasicGraphPattern bgp = (BasicGraphPattern) ogp.getMainGraphPattern();

    Set<TriplePattern> triplePatterns = bgp.getTriplePatterns();
    Assert.assertTrue(triplePatterns.size() == 1);
    Assert.assertTrue(triplePatterns.contains(
        new SimpleTriplePattern(var1, new UriRef(prefix1Uri + predicate1),
        var2)));

    GraphPattern gp2 = (GraphPattern) ogp.getOptionalGraphPattern()
        .getGraphPatterns().toArray()[0];
    Assert.assertTrue(BasicGraphPattern.class.isAssignableFrom(gp2.getClass()));
    bgp = (BasicGraphPattern) gp2;

    triplePatterns = bgp.getTriplePatterns();
    Assert.assertTrue(triplePatterns.size() == 1);
    Assert.assertTrue(triplePatterns.contains(
        new SimpleTriplePattern(var1, new UriRef(prefix2Uri + predicate2),
        var3)));
  }
View Full Code Here

        GraphPattern gp = (GraphPattern) ggp.getGraphPatterns().toArray()[0];
        Assert.assertTrue(OptionalGraphPattern.class.isAssignableFrom(gp.getClass()));
        OptionalGraphPattern ogp = (OptionalGraphPattern) gp;
        Assert.assertTrue(BasicGraphPattern.class.isAssignableFrom(
                ogp.getMainGraphPattern().getClass()));
        BasicGraphPattern bgp = (BasicGraphPattern) ogp.getMainGraphPattern();

        Set<TriplePattern> triplePatterns = bgp.getTriplePatterns();
        Assert.assertTrue(triplePatterns.size() == 1);
        Assert.assertTrue(triplePatterns.contains(
                new SimpleTriplePattern(var1, new UriRef(prefix1Uri + predicate1),
                var2)));

        GraphPattern gp2 = (GraphPattern) ogp.getOptionalGraphPattern()
                .getGraphPatterns().toArray()[0];
        Assert.assertTrue(BasicGraphPattern.class.isAssignableFrom(gp2.getClass()));
        bgp = (BasicGraphPattern) gp2;

        triplePatterns = bgp.getTriplePatterns();
        Assert.assertTrue(triplePatterns.size() == 1);
        Assert.assertTrue(triplePatterns.contains(
                new SimpleTriplePattern(var1, new UriRef(prefix2Uri + predicate2),
                var3)));
    }
View Full Code Here

                .equals(new UriRef(defaultGraph)));

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

        Set<TriplePattern> triplePatterns = bgp.getTriplePatterns();
        Assert.assertTrue(triplePatterns.size()==1);

        ResourceOrVariable s = new ResourceOrVariable(new UriRef(subject));
        UriRefOrVariable p = new UriRefOrVariable(new UriRef(predicate));
        ResourceOrVariable o = new ResourceOrVariable(new Variable(variable));
View Full Code Here

                "SELECT * WHERE {?a ?x 'tiger' . ?a ?x 'lion'@en . }");

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

        Set<TriplePattern> triplePatterns = bgp.getTriplePatterns();
        Assert.assertTrue(triplePatterns.size()==2);

        Assert.assertTrue(triplePatterns.contains(new SimpleTriplePattern(
                new Variable("a"), new Variable("x"),
                new PlainLiteralImpl("tiger"))));
View Full Code Here

                new SimpleTriplePattern(s, p, o)));

        GraphPattern gp = (GraphPattern) constructQuery.getQueryPattern()
                .getGraphPatterns().toArray()[0];
        Assert.assertTrue(BasicGraphPattern.class.isAssignableFrom(gp.getClass()));
        BasicGraphPattern bgp = (BasicGraphPattern) gp;
        triplePatterns = bgp.getTriplePatterns();
        Assert.assertTrue(triplePatterns.size()==1);

        s = new ResourceOrVariable(new Variable(variable2));
        p = new UriRefOrVariable(new UriRef(predicate2));
View Full Code Here

TOP

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

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.