AtomGraph / Core-PHP

Generic Jena-compatible PHP Linked Data management library. Apache license.
https://atomgraph.com
26 stars 4 forks source link

Create a QueryBuilder class #23

Open seporaitis opened 12 years ago

seporaitis commented 12 years ago

Example code interface should be something like:

$query = QueryBuilder::newInstance()->construct($model)->where($whatToSelect)->build();
$model = $repository->query($query);
$query = QueryBuilder::newInstance()->insert($model)->graph($someUri)->build();
$repository->insert($query);

Discussion is needed about how to implement complex queries (queries inside queries, selection form multiple graphs, etc.).

seporaitis commented 12 years ago

This is related: https://github.com/Graphity/graphity-core/issues/9 in the sense that QueryBuilder should generate a SPIN model, that would be serialized to RDF/XML and transformed to SPARQL using XSLT.

namedgraph commented 12 years ago

http://openjena.org/wiki/ARQ/Manipulating_SPARQL_using_ARQ