summaryrefslogtreecommitdiffstats
path: root/src/serialisation
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-01-18 06:25:36 +0000
committerDavid Robillard <d@drobilla.net>2014-01-18 06:25:36 +0000
commitec8939dd7ef5267b43bd8ae3590e783495f0cfc9 (patch)
treece151c34851e8a275f35aedb67ea6b4a25676baf /src/serialisation
parent59492c673f5de893e8b91ca50a945a697ddfa404 (diff)
downloadingen-ec8939dd7ef5267b43bd8ae3590e783495f0cfc9.tar.gz
ingen-ec8939dd7ef5267b43bd8ae3590e783495f0cfc9.tar.bz2
ingen-ec8939dd7ef5267b43bd8ae3590e783495f0cfc9.zip
Consolidate URIs.
Add missing definition to ontology. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5317 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/serialisation')
-rw-r--r--src/serialisation/Parser.cpp21
-rw-r--r--src/serialisation/Serialiser.cpp3
2 files changed, 9 insertions, 15 deletions
diff --git a/src/serialisation/Parser.cpp b/src/serialisation/Parser.cpp
index c0f8cf3a..3d8ba96d 100644
--- a/src/serialisation/Parser.cpp
+++ b/src/serialisation/Parser.cpp
@@ -83,12 +83,12 @@ get_basename(const std::string& uri)
}
static bool
-skip_property(const Sord::Node& predicate)
+skip_property(Ingen::URIs& uris, const Sord::Node& predicate)
{
- return (predicate.to_string() == "http://drobilla.net/ns/ingen#node"
- || predicate.to_string() == "http://drobilla.net/ns/ingen#edge"
- || predicate.to_string() == "http://drobilla.net/ns/ingen#arc"
- || predicate.to_string() == LV2_CORE__port);
+ return (predicate.to_string() == INGEN__file ||
+ predicate.to_string() == uris.ingen_arc ||
+ predicate.to_string() == uris.ingen_block ||
+ predicate.to_string() == uris.lv2_port);
}
static Resource::Properties
@@ -108,7 +108,7 @@ get_properties(Ingen::World* world,
const Sord::Node nil;
Resource::Properties props;
for (Sord::Iter i = model.find(subject, nil, nil); !i.end(); ++i) {
- if (!skip_property(i.get_predicate())) {
+ if (!skip_property(world->uris(), i.get_predicate())) {
out.len = 0;
sratom_read(sratom, &forge, world->rdf_world()->c_obj(),
model.c_obj(), i.get_object().c_obj());
@@ -453,13 +453,6 @@ parse_arcs(Ingen::World* world,
parse_arc(world, target, model, i.get_object(), graph);
}
- // Backwards compatibility, support ingen:edge predicate
- const Sord::URI ingen_edge(*world->rdf_world(),
- "http://drobilla.net/ns/ingen#edge");
- for (Sord::Iter i = model.find(subject, ingen_edge, nil); !i.end(); ++i) {
- parse_arc(world, target, model, i.get_object(), graph);
- }
-
return true;
}
@@ -605,7 +598,7 @@ Parser::parse_file(Ingen::World* world,
if (parsed_path) {
target->set_property(Node::path_to_uri(*parsed_path),
- Raul::URI("http://drobilla.net/ns/ingen#document"),
+ Raul::URI(INGEN__file),
world->forge().alloc_uri(uri));
} else {
world->log().warn("Document URI lost\n");
diff --git a/src/serialisation/Serialiser.cpp b/src/serialisation/Serialiser.cpp
index bbc23081..a8140c23 100644
--- a/src/serialisation/Serialiser.cpp
+++ b/src/serialisation/Serialiser.cpp
@@ -525,7 +525,8 @@ Serialiser::Impl::serialise_arc(const Sord::Node& parent,
static bool
skip_property(Ingen::URIs& uris, const Sord::Node& predicate)
{
- return (predicate.to_string() == "http://drobilla.net/ns/ingen#document" ||
+ return (predicate.to_string() == INGEN__file ||
+ predicate.to_string() == uris.ingen_arc ||
predicate.to_string() == uris.ingen_block ||
predicate.to_string() == uris.lv2_port);
}