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

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


        final String queryString = "SELECT ?title ?price WHERE { " +
                "?x <http://purl.org/dc/elements/1.1/title> ?title . " +
                "OPTIONAL { ?x <http://example.org/ns#price> ?price . } " +
                "}";

        Variable title = new Variable("title");
        Variable price = new Variable("price");
        SimpleSelectQuery selectQuery = new SimpleSelectQuery();
        selectQuery.addSelection(title);
        selectQuery.addSelection(price);

        Variable x = new Variable("x");
        Set<TriplePattern> triplePatterns = new HashSet<TriplePattern>();
        triplePatterns.add(new SimpleTriplePattern(x,
                new UriRef("http://purl.org/dc/elements/1.1/title"), title));

        SimpleBasicGraphPattern bgp = new SimpleBasicGraphPattern(triplePatterns);
View Full Code Here


        final String queryString = "SELECT ?p WHERE { " +
                "<http://localhost/testitem> ?p ?x . " +
                "FILTER REGEX(?x,\".*uni.*\"^^<http://www.w3.org/2001/XMLSchema#string>) }";

        Variable p = new Variable("p");
        SimpleSelectQuery selectQuery = new SimpleSelectQuery();
        selectQuery.addSelection(p);

        Variable x = new Variable("x");
        Set<TriplePattern> triplePatterns = new HashSet<TriplePattern>();
        triplePatterns.add(new SimpleTriplePattern(
                new UriRef("http://localhost/testitem"), p, x));

        SimpleBasicGraphPattern bgp = new SimpleBasicGraphPattern(triplePatterns);
View Full Code Here

    Jena2TriaUtil convertor = new Jena2TriaUtil(new HashMap<Node,BNode>());
    public HashMapSolutionMapping(QuerySolution querySolution) {
        final Iterator<String> varNames = querySolution.varNames();
        while (varNames.hasNext()) {
            final String varName = varNames.next();
            put(new Variable(varName), toResource(querySolution.get(varName)));
        }
    }
View Full Code Here

            put(new Variable(varName), toResource(querySolution.get(varName)));
        }
    }
    @Override
    public Resource get(String name) {
        return get(new Variable(name));
    }
View Full Code Here

TOP

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

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.