Skip to content
anqit edited this page Dec 5, 2017 · 2 revisions

Queries

Spanqit supports all of the query types described by the SPARQL 1.1 Query Spec as well as the SPARQL 1.1 Update Spec. The Queries class provides static methods to instantiate the various query objects. For example:

SelectQuery select = Queries.SELECT();
ConstructQuery construct = Queries.CONSTRUCT();

Query objects provide methods to set or add the various elements appropriate for the type of query:

Prefix ex;
Variable product;
TriplePattern personWroteBook, personAuthoredBook;

// ...

select.prefix(ex).select(product).where(product.isA(ex.iri("book"));
construct.prefix(ex).construct(personWroteBook).where(personAuthoredBook);

Creating Elements >