diff options
author | David Robillard <d@drobilla.net> | 2007-05-01 04:01:04 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-05-01 04:01:04 +0000 |
commit | c5eb1148b99cf88555c0a516e1218bdb74ab0080 (patch) | |
tree | 4f72d46c43ff7fe39ebce3bd39911c3b09952868 /raul/RDFQuery.h | |
parent | a5ce2e3af283f3ffeb2d30a34546ceab0a84d702 (diff) | |
download | raul-c5eb1148b99cf88555c0a516e1218bdb74ab0080.tar.gz raul-c5eb1148b99cf88555c0a516e1218bdb74ab0080.tar.bz2 raul-c5eb1148b99cf88555c0a516e1218bdb74ab0080.zip |
Converted Raul (and thus Ingen and Machina) to use Redland over Raptor/Rasqal independently.
Fixed patch loading for Ingen (local only, still something wrong with remote...).
git-svn-id: http://svn.drobilla.net/lad/raul@486 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'raul/RDFQuery.h')
-rw-r--r-- | raul/RDFQuery.h | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/raul/RDFQuery.h b/raul/RDFQuery.h index 1aa1cad..eef52bd 100644 --- a/raul/RDFQuery.h +++ b/raul/RDFQuery.h @@ -21,25 +21,30 @@ #include <map> #include <list> #include <glibmm/ustring.h> +#include "raul/RDFWorld.h" #include "raul/Namespaces.h" namespace Raul { +namespace RDF { + +class World; +class Model; /** Pretty wrapper for a SPARQL query. * - * Automatically handles things like prepending prefixes, etc. Raul specific. + * Automatically handles things like prepending prefixes, etc. */ -class RDFQuery { +class Query { public: - typedef std::map<Glib::ustring, Glib::ustring> Bindings; - typedef std::list<Bindings> Results; + typedef std::map<std::string, Node> Bindings; // FIXME: order? better to use int + typedef std::list<Bindings> Results; - RDFQuery(const Namespaces& prefixes, Glib::ustring query) + Query(const World& world, Glib::ustring query) { // Prepend prefix header - for (Namespaces::const_iterator i = prefixes.begin(); - i != prefixes.end(); ++i) { + for (Namespaces::const_iterator i = world.prefixes().begin(); + i != world.prefixes().end(); ++i) { _query += "PREFIX "; _query += i->first + ": <" + i->second + ">\n"; } @@ -47,16 +52,16 @@ public: _query += query; } - Results run(const Glib::ustring base_uri) const; + Results run(World& world, Model& model, const Glib::ustring base_uri="") const; Glib::ustring string() const { return _query; }; private: - Glib::ustring _query; }; +} // namespace RDF } // namespace Raul #endif // RAUL_RDFQUERY_H |