RDF Node classes
In Anzo 3.0, the RDF node classes used in the Glitter SPARQL query engine are now used throughout all of Anzo, including the Anzo.java client API.
The Anzo RDF node hierarchy include both RDF term types and SPARQL variables types, all steaming from a common TriplePatternComponent type.
Value and it's subclasses are the components of the Statement type, which represents both triples and quads:
new Statement(Resource subject, URI predicate, Value object); new Statement(Resource subject, URI predicate, Value object, URI namedGraphURI);
And Variable represents a SPARQL variable, e.g.:
Variable var = MemVariable.createVariable("s");
QueryResults results = client.executeServerQuery(..., "SELECT ?s WHERE { ?s rdf:type :SkiResort);
for(PatternSoluion solution : results.getSelectResult()) {
Value resort = solution.getBinding(var);
}
Creating Nodes and Statements
URI subj1 = MemURI.create("http://example.com/subject1");
URI pred1 = MemURI.create("http://example.com/predicate1");
TypedLiteral obj1 = MemTypedLiteral.create(3.14);
Statement stmt1 = new Statement(subj1, pred1, obj1);
Attachments
- node-types.png (27.5 kB) - added by jpbetz on 01/27/08 15:08:42.
Download in other formats:
Copyright © 2007 - 2008 OpenAnzo.org



