From d2d755b0db3b4779d581c7a70841609257250c12 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 8 Dec 2006 22:32:34 +0000 Subject: Fixed plugin type issues git-svn-id: http://svn.drobilla.net/lad/ingen@211 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/client/Serializer.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/libs/client/Serializer.cpp') diff --git a/src/libs/client/Serializer.cpp b/src/libs/client/Serializer.cpp index f40d8d67..3984a49a 100644 --- a/src/libs/client/Serializer.cpp +++ b/src/libs/client/Serializer.cpp @@ -198,9 +198,12 @@ Serializer::serialize_patch(SharedPtr patch, unsigned depth) { assert(_serializer); - const RdfId patch_id = (depth == 0) - ? RdfId(RdfId::RESOURCE, string("#") + patch->path().substr(1)) - : path_to_node_id(patch->path()); // anonymous + RdfId patch_id = path_to_node_id(patch->path()); // anonymous + + if (patch->path().length() < 2) + patch_id = RdfId(RdfId::RESOURCE, string("")); + else if (depth == 0) + patch_id = RdfId(RdfId::RESOURCE, string("#") + patch->path().substr(1)); _writer.write( patch_id, @@ -313,11 +316,11 @@ Serializer::serialize_connection(SharedPtr connection) throw (s path_to_node_id(connection->src_port_path()).to_string() + "-" + path_to_node_id(connection->dst_port_path()).to_string()); - /* - const string src_port_rel_path = connection->src_port_path().substr(connection->patch_path().length()); - const string dst_port_rel_path = connection->dst_port_path().substr(connection->patch_path().length()); -*/ - _writer.write(connection_id, NS_RDF("type"), NS_INGEN("Connection")); + _writer.write(path_to_node_id(connection->dst_port_path()), + NS_INGEN("connectedTo"), + path_to_node_id(connection->src_port_path())); + + /*_writer.write(connection_id, NS_RDF("type"), NS_INGEN("Connection")); _writer.write(connection_id, NS_INGEN("source"), @@ -326,6 +329,7 @@ Serializer::serialize_connection(SharedPtr connection) throw (s _writer.write(connection_id, NS_INGEN("destination"), path_to_node_id(connection->dst_port_path())); + */ } -- cgit v1.2.1