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

Examples of org.apache.clerezza.rdf.core.sparql.query.impl.SimpleConstructQuery


    UriRefOrVariable p = new UriRefOrVariable(
        new UriRef("http://www.w3.org/2001/vcard-rdf/3.0#FN"));
    ResourceOrVariable o = new ResourceOrVariable(new Variable("name"));
    Set<TriplePattern> constructTriplePatterns = new HashSet<TriplePattern>();
    constructTriplePatterns.add(new SimpleTriplePattern(s, p, o));
    SimpleConstructQuery constructQuery = new SimpleConstructQuery(constructTriplePatterns);

    s = new ResourceOrVariable(new Variable("x"));
    p = new UriRefOrVariable(new UriRef("http://xmlns.com/foaf/0.1/name"));
    Set<TriplePattern> triplePatterns = new HashSet<TriplePattern>();
    triplePatterns.add(new SimpleTriplePattern(s, p, o));

    SimpleBasicGraphPattern bgp = new SimpleBasicGraphPattern(triplePatterns);
    SimpleGroupGraphPattern queryPattern = new SimpleGroupGraphPattern();
    queryPattern.addGraphPattern(bgp);
    constructQuery.setQueryPattern(queryPattern);

    Assert.assertTrue(constructQuery.toString()
        .replaceAll("( |\n)+", " ").trim().equals(queryString));
  }
View Full Code Here


            ClerezzaSparqlObject clerezzaSparqlObject = (ClerezzaSparqlObject) adaptRuleAtomTo(ruleAtom, type);
            triplePatterns.add((TriplePattern) clerezzaSparqlObject.getClerezzaObject());

        }

        SimpleConstructQuery constructQuery = new SimpleConstructQuery(triplePatterns);
        constructQuery.setQueryPattern(groupGraphPattern);

        return (T) constructQuery;
    }
View Full Code Here

        UriRefOrVariable p = new UriRefOrVariable(
                new UriRef("http://www.w3.org/2001/vcard-rdf/3.0#FN"));
        ResourceOrVariable o = new ResourceOrVariable(new Variable("name"));
        Set<TriplePattern> constructTriplePatterns = new HashSet<TriplePattern>();
        constructTriplePatterns.add(new SimpleTriplePattern(s, p, o));
        SimpleConstructQuery constructQuery = new SimpleConstructQuery(constructTriplePatterns);

        s = new ResourceOrVariable(new Variable("x"));
        p = new UriRefOrVariable(new UriRef("http://xmlns.com/foaf/0.1/name"));
        Set<TriplePattern> triplePatterns = new HashSet<TriplePattern>();
        triplePatterns.add(new SimpleTriplePattern(s, p, o));

        SimpleBasicGraphPattern bgp = new SimpleBasicGraphPattern(triplePatterns);
        SimpleGroupGraphPattern queryPattern = new SimpleGroupGraphPattern();
        queryPattern.addGraphPattern(bgp);
        constructQuery.setQueryPattern(queryPattern);

        Assert.assertTrue(constructQuery.toString()
                .replaceAll("( |\n)+", " ").trim().equals(queryString));
    }
View Full Code Here

TOP

Related Classes of org.apache.clerezza.rdf.core.sparql.query.impl.SimpleConstructQuery

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.