Skip to content
Ankit Prakash edited this page Nov 10, 2014 · 2 revisions

Queries

Spanqit currently supports SELECT and CONSTRUCT queries. The Queries class provides static methods to instantiate SelectQuery and ConstructQuery objects:

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 >

Clone this wiki locally