summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/engine/HTTPClientSender.cpp6
-rw-r--r--src/serialisation/Parser.cpp23
2 files changed, 27 insertions, 2 deletions
diff --git a/src/engine/HTTPClientSender.cpp b/src/engine/HTTPClientSender.cpp
index bcbf8dd8..0cbd1100 100644
--- a/src/engine/HTTPClientSender.cpp
+++ b/src/engine/HTTPClientSender.cpp
@@ -158,7 +158,11 @@ HTTPClientSender::set_voice_value(const std::string& port_path, uint32_t voice,
void
HTTPClientSender::activity(const std::string& path)
{
- //lo_send(_address, "/ingen/activity", "s", port_path.c_str(), LO_ARGS_END);
+ string msg = string(
+ "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n"
+ "@prefix ingen: <http://drobilla.net/ns/ingen#> .\n\n<").append(
+ path).append("> ingen:activity true .\n");
+ send_chunk(msg);
}
static void null_deleter(const Shared::GraphObject*) {}
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