diff options
author | David Robillard <d@drobilla.net> | 2007-04-12 01:50:59 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-04-12 01:50:59 +0000 |
commit | 533402f16f6a7e6a9aa6df4186055690bce8e3ac (patch) | |
tree | 8b5f9cc0fb349929476344f3502dadb262fbe56f /src/libs/client | |
parent | 099e01628ef57f07efa69954893b0873bbb7f367 (diff) | |
download | ingen-533402f16f6a7e6a9aa6df4186055690bce8e3ac.tar.gz ingen-533402f16f6a7e6a9aa6df4186055690bce8e3ac.tar.bz2 ingen-533402f16f6a7e6a9aa6df4186055690bce8e3ac.zip |
Updated Raptor dependency to 1.4.14 (for Turtle serialization).
Made patches serialize to Turtle instead of RDF/XML because a) it's pretty and b) I said so.
Loading of patches directly from the 'net in Ingenuity (File->Import Location).
git-svn-id: http://svn.drobilla.net/lad/ingen@444 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/client')
-rw-r--r-- | src/libs/client/Loader.cpp | 16 | ||||
-rw-r--r-- | src/libs/client/Loader.h | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/libs/client/Loader.cpp b/src/libs/client/Loader.cpp index 09724d6c..ed8d4497 100644 --- a/src/libs/client/Loader.cpp +++ b/src/libs/client/Loader.cpp @@ -44,12 +44,12 @@ Loader::Loader(SharedPtr<ModelEngineInterface> engine, SharedPtr<Namespaces> nam /** Load (create) all objects from an RDF into the engine. * - * @param filename Filename to load objects from. + * @param document_uri URI of file to load objects from. * @param parent Path of parent under which to load objects. * @return whether or not load was successful. */ bool -Loader::load(const Glib::ustring& filename, +Loader::load(const Glib::ustring& document_uri, boost::optional<Path> parent, string patch_name, Glib::ustring patch_uri, @@ -60,8 +60,8 @@ Loader::load(const Glib::ustring& filename, std::map<Path, bool> created; // FIXME: kluge - unsigned char* document_uri_str = raptor_uri_filename_to_uri_string(filename.c_str()); - Glib::ustring document_uri = (const char*)document_uri_str; + //unsigned char* document_uri_str = raptor_uri_filename_to_uri_string(filename.c_str()); + //Glib::ustring document_uri = (const char*)document_uri_str; //Glib::ustring document_uri = "file:///home/dave/code/drobillanet/ingen/src/progs/ingenuity/test2.ingen.ttl"; patch_uri = string("<") + patch_uri + ">"; @@ -90,9 +90,9 @@ Loader::load(const Glib::ustring& filename, /* Get name (if available/necessary) */ if (patch_name == "") { - patch_name = string(filename.substr(filename.find_last_of("/")+1)); - if (patch_name.substr(patch_name.length()-6) == ".ingen") - patch_name = patch_name.substr(0, patch_name.length()-6); + patch_name = string(document_uri.substr(document_uri.find_last_of("/")+1)); + if (patch_name.substr(patch_name.length()-10) == ".ingen.ttl") + patch_name = patch_name.substr(0, patch_name.length()-10); query = RDFQuery(*_namespaces, Glib::ustring( "SELECT DISTINCT ?name FROM <") + document_uri + "> WHERE {\n" + @@ -165,7 +165,7 @@ Loader::load(const Glib::ustring& filename, const Path subpatch_path = patch_path.base() + (string)name; if (created.find(subpatch_path) == created.end()) { - load(filename, patch_path, name, patch); + load(document_uri, patch_path, name, patch); created[subpatch_path] = true; } } diff --git a/src/libs/client/Loader.h b/src/libs/client/Loader.h index 9afbace6..76a3e60c 100644 --- a/src/libs/client/Loader.h +++ b/src/libs/client/Loader.h @@ -39,7 +39,7 @@ class Loader { public: Loader(SharedPtr<ModelEngineInterface> engine, SharedPtr<Namespaces> = SharedPtr<Namespaces>()); - bool load(const Glib::ustring& filename, + bool load(const Glib::ustring& uri, boost::optional<Path> parent, string patch_name, Glib::ustring patch_uri = "", |