summaryrefslogtreecommitdiffstats
path: root/src/serialisation
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-05-29 00:44:49 +0000
committerDavid Robillard <d@drobilla.net>2009-05-29 00:44:49 +0000
commit085f5e9c5eec12171596c47c0b70f6634dbc1402 (patch)
tree16df3f452c174bbd1f1099936dc592939a59967e /src/serialisation
parentb3c31c94eb572063ec97f24a89e5f7f98d5eae41 (diff)
downloadingen-085f5e9c5eec12171596c47c0b70f6634dbc1402.tar.gz
ingen-085f5e9c5eec12171596c47c0b70f6634dbc1402.tar.bz2
ingen-085f5e9c5eec12171596c47c0b70f6634dbc1402.zip
Node creation via HTTP.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2045 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/serialisation')
-rw-r--r--src/serialisation/Parser.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/serialisation/Parser.cpp b/src/serialisation/Parser.cpp
index e01adc1f..50e00439 100644
--- a/src/serialisation/Parser.cpp
+++ b/src/serialisation/Parser.cpp
@@ -167,7 +167,7 @@ Parser::parse_update(
target->del(object.to_string());
}
- // Variable settings
+ // Properties
query = Redland::Query(*world->rdf_world,
"SELECT DISTINCT ?s ?p ?o WHERE {\n"
"?s ?p ?o .\n"
@@ -177,17 +177,19 @@ Parser::parse_update(
for (Redland::Query::Results::iterator i = results.begin(); i != results.end(); ++i) {
Glib::Mutex::Lock lock(world->rdf_world->mutex());
- const string obj_uri((*i)["s"].to_string());
+ string obj_uri((*i)["s"].to_string());
const string key(world->rdf_world->qualify((*i)["p"].to_string()));
const Redland::Node& val_node((*i)["o"]);
const Atom a(AtomRDF::node_to_atom(val_node));
+ if (obj_uri.find(":") == string::npos)
+ obj_uri = "path:" + obj_uri;
if (key != "")
target->set_property(obj_uri, key, a);
}
// Connections
- parse_connections(world, target, model, base_uri, "/");
+ //parse_connections(world, target, model, base_uri, "/");
// Port values
query = Redland::Query(*world->rdf_world,
@@ -286,7 +288,7 @@ Parser::parse(
} else if (rdf_class == node_class) {
ret = parse_node(world, target, model, subject, path, data);
} else if (rdf_class == in_port_class || rdf_class == out_port_class) {
- cerr << "PARSE PORT" << endl;
+ parse_properties(world, target, model, subject, string("path:") + path, data);
}
if (!ret) {
@@ -298,8 +300,12 @@ Parser::parse(
root_path = ret;
} else if (is_plugin) {
- if (URI::is_valid(subject.to_string()))
- parse_properties(world, target, model, subject, subject.to_string());
+ string subject_str = subject.to_string();
+ if (URI::is_valid(subject_str)) {
+ if (subject == document_uri)
+ subject_str = Path::root_uri;
+ parse_properties(world, target, model, subject, subject_str);
+ }
}
}