summaryrefslogtreecommitdiffstats
path: root/src/serialisation
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-11-16 06:53:12 +0000
committerDavid Robillard <d@drobilla.net>2008-11-16 06:53:12 +0000
commitf1b0b3495340399bebb93b20ed9a264a3db4e5da (patch)
treec5c6af449c7f39846d5f0201fe16ea803784465b /src/serialisation
parent0bd203374d1bc3bb3f303705b37c7567e1ef673f (diff)
downloadingen-f1b0b3495340399bebb93b20ed9a264a3db4e5da.tar.gz
ingen-f1b0b3495340399bebb93b20ed9a264a3db4e5da.tar.bz2
ingen-f1b0b3495340399bebb93b20ed9a264a3db4e5da.zip
Control port value tracking via HTTP.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1725 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/serialisation')
-rw-r--r--src/serialisation/Parser.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/serialisation/Parser.cpp b/src/serialisation/Parser.cpp
index ac7332a7..2eb4eb75 100644
--- a/src/serialisation/Parser.cpp
+++ b/src/serialisation/Parser.cpp
@@ -123,6 +123,9 @@ Parser::parse(
Glib::ustring query_str;
if (object_uri && object_uri.get()[0] == '/')
object_uri = object_uri.get().substr(1);
+
+
+ /* **** First query out global information (top-level info) **** */
// Delete anything explicitly declared to not exist
query_str = Glib::ustring("SELECT DISTINCT ?o WHERE { ?o a owl:Nothing }");
@@ -148,14 +151,32 @@ Parser::parse(
const string obj_path = (*i)["path"].to_string();
const string key = world->rdf_world->prefixes().qualify((*i)["varkey"].to_string());
const Redland::Node& val_node = (*i)["varval"];
-
if (key != "")
target->set_variable(obj_path, key, AtomRDF::node_to_atom(val_node));
}
world->rdf_world->mutex().unlock();
+ // Connections
parse_connections(world, target, model, base_uri, "", "/");
+
+ // Port values
+ query = Redland::Query(*world->rdf_world,
+ "SELECT DISTINCT ?path ?value WHERE {\n"
+ "?path ingen:value ?value .\n"
+ "}");
+
+ results = Redland::Query::Results(query.run(*world->rdf_world, model, base_uri));
+ world->rdf_world->mutex().lock();
+ for (Redland::Query::Results::iterator i = results.begin(); i != results.end(); ++i) {
+ const string obj_path = (*i)["path"].to_string();
+ const Redland::Node& val_node = (*i)["value"];
+ target->set_port_value(obj_path, AtomRDF::node_to_atom(val_node));
+ }
+ world->rdf_world->mutex().unlock();
+
+ /* **** Now query out objects **** */
+
if (object_uri)
query_str = Glib::ustring("SELECT DISTINCT ?class WHERE { <") + object_uri.get() + "> a ?class . }";
else