diff options
Diffstat (limited to 'src/Serialiser.cpp')
-rw-r--r-- | src/Serialiser.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/Serialiser.cpp b/src/Serialiser.cpp index d5e54f3d..4ef8eaed 100644 --- a/src/Serialiser.cpp +++ b/src/Serialiser.cpp @@ -516,10 +516,22 @@ Serialiser::Impl::serialise_properties(Sord::Node id, for (const auto& p : props) { const Sord::URI key(_model->world(), p.first); if (!skip_property(_world.uris(), key)) { - sratom_write(_sratom, unmap, 0, - sord_node_to_serd_node(id.c_obj()), - sord_node_to_serd_node(key.c_obj()), - p.second.type(), p.second.size(), p.second.get_body()); + if (p.second.type() == _world.uris().atom_URI && + !strncmp((const char*)p.second.get_body(), "ingen:/", 7)) { + /* Value is an ingen:/ URI, relative to the running engine. + Chop the prefix and save the path relative to the bundle. + This allows saving references to bundle resources. */ + sratom_write(_sratom, unmap, 0, + sord_node_to_serd_node(id.c_obj()), + sord_node_to_serd_node(key.c_obj()), + p.second.type(), p.second.size(), + (const char*)p.second.get_body() + 7); + } else { + sratom_write(_sratom, unmap, 0, + sord_node_to_serd_node(id.c_obj()), + sord_node_to_serd_node(key.c_obj()), + p.second.type(), p.second.size(), p.second.get_body()); + } } } |