From b8490799a71c0c914a87a4a86f7160fbcd0bacbe Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 28 Nov 2008 22:50:35 +0000 Subject: Store module locations on drop (fix ticket #281). Use existing rdf:instanceOf instead of ingen:plugin. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1816 a436a847-0d15-0410-975c-d299462d15a1 --- src/serialisation/Parser.cpp | 14 ++++++-------- src/serialisation/Serialiser.cpp | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) (limited to 'src/serialisation') diff --git a/src/serialisation/Parser.cpp b/src/serialisation/Parser.cpp index 4e886e43..9b165e03 100644 --- a/src/serialisation/Parser.cpp +++ b/src/serialisation/Parser.cpp @@ -293,10 +293,8 @@ Parser::parse( root_path = ret; } else if (is_plugin) { - if (path_str.length() > 0) { - const string uri = path_str.substr(1); - target->set_property(uri, "rdf:type", Atom(Atom::URI, rdf_class.to_c_string())); - } + if (path_str.length() > 0) + target->set_property(path_str, "rdf:type", Atom(Atom::URI, rdf_class.to_c_string())); } } @@ -381,7 +379,7 @@ Parser::parse_patch( "SELECT DISTINCT ?name ?plugin ?varkey ?varval ?poly WHERE {\n") + subject + " ingen:node ?node .\n" "?node lv2:symbol ?name ;\n" - " ingen:plugin ?plugin ;\n" + " rdf:instanceOf ?plugin ;\n" " ingen:polyphonic ?poly .\n" "OPTIONAL { ?node lv2var:variable ?variable .\n" " ?variable rdf:predicate ?varkey ;\n" @@ -568,18 +566,18 @@ Parser::parse_node( { /* Get plugin */ Redland::Query query(*world->rdf_world, Glib::ustring( - "SELECT DISTINCT ?plug WHERE { ") + subject + " ingen:plugin ?plug }"); + "SELECT DISTINCT ?plug WHERE { ") + subject + " rdf:instanceOf ?plug }"); Redland::Query::Results results = query.run(*world->rdf_world, model, base_uri); if (results.size() == 0) { - cerr << "[Parser] ERROR: Node missing mandatory ingen:plugin property" << endl; + cerr << "[Parser] ERROR: Node missing mandatory rdf:instanceOf property" << endl; return boost::optional(); } const Redland::Node& plugin_node = (*results.begin())["plug"]; if (plugin_node.type() != Redland::Node::RESOURCE) { - cerr << "[Parser] ERROR: node's ingen:plugin property is not a resource" << endl; + cerr << "[Parser] ERROR: node's rdf:instanceOf property is not a resource" << endl; return boost::optional(); } diff --git a/src/serialisation/Serialiser.cpp b/src/serialisation/Serialiser.cpp index 0704247e..b9eff1f2 100644 --- a/src/serialisation/Serialiser.cpp +++ b/src/serialisation/Serialiser.cpp @@ -403,7 +403,7 @@ Serialiser::serialise_node(SharedPtr node, const Redland::Node& no _model->add_statement( node_id, - "ingen:plugin", + "rdf:instanceOf", plugin_id); _model->add_statement( -- cgit v1.2.1