summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac3
-rw-r--r--data/Makefile.am4
-rw-r--r--data/lv2core.lv2/Makefile.am4
-rw-r--r--data/lv2core.lv2/lv2.ttl (renamed from data/lv2.ttl)0
-rw-r--r--data/lv2core.lv2/manifest.ttl7
-rw-r--r--src/world.c28
6 files changed, 30 insertions, 16 deletions
diff --git a/configure.ac b/configure.ac
index 90464af..956ddfe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,7 +16,7 @@ SLV2_API_CURRENT=2
SLV2_API_REVISION=0
SLV2_API_AGE=0
-AC_INIT([slv2],[0.0.2pre],[dave@drobilla.net])
+AC_INIT([slv2],[0.1.0],[dave@drobilla.net])
AC_CONFIG_AUX_DIR([config])
@@ -138,6 +138,7 @@ AC_CONFIG_FILES([utils/Makefile])
AC_CONFIG_FILES([hosts/Makefile])
AC_CONFIG_FILES([swig/Makefile])
AC_CONFIG_FILES([data/Makefile])
+AC_CONFIG_FILES([data/lv2core.lv2/Makefile])
AC_CONFIG_FILES([libslv2.pc])
AC_CONFIG_FILES([doc/Makefile])
AC_CONFIG_FILES([doc/reference.doxygen])
diff --git a/data/Makefile.am b/data/Makefile.am
index 2b7dd69..3eab75c 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,4 +1,2 @@
-EXTRA_DIST = lv2.ttl
+SUBDIRS = lv2core.lv2
-ontologydir = $(datadir)/slv2
-ontology_DATA = lv2.ttl
diff --git a/data/lv2core.lv2/Makefile.am b/data/lv2core.lv2/Makefile.am
new file mode 100644
index 0000000..f227629
--- /dev/null
+++ b/data/lv2core.lv2/Makefile.am
@@ -0,0 +1,4 @@
+EXTRA_DIST = manifest.ttl lv2.ttl
+
+bundledir = $(libdir)/lv2/lv2core.lv2
+bundle_DATA = manifest.ttl lv2.ttl
diff --git a/data/lv2.ttl b/data/lv2core.lv2/lv2.ttl
index c842489..c842489 100644
--- a/data/lv2.ttl
+++ b/data/lv2core.lv2/lv2.ttl
diff --git a/data/lv2core.lv2/manifest.ttl b/data/lv2core.lv2/manifest.ttl
new file mode 100644
index 0000000..fabe17e
--- /dev/null
+++ b/data/lv2core.lv2/manifest.ttl
@@ -0,0 +1,7 @@
+@prefix lv2: <http://lv2plug.in/ns/lv2core#>.
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
+
+<http://lv2plug.in/ns/lv2core>
+ a lv2:Specification ;
+ rdfs:seeAlso <lv2.ttl> .
+
diff --git a/src/world.c b/src/world.c
index 0c6ad77..11c233d 100644
--- a/src/world.c
+++ b/src/world.c
@@ -230,11 +230,21 @@ void
slv2_world_load_file(SLV2World world, librdf_uri* file_uri)
{
slv2_world_lock_if_necessary(world);
+
+ librdf_storage* storage = librdf_new_storage(world->world,
+ "memory", NULL, NULL);
+ librdf_model* model = librdf_new_model(world->world,
+ storage, NULL);
+ librdf_parser_parse_into_model(world->parser, file_uri, NULL,
+ model);
- //printf("LOADING FILE: %s\n", librdf_uri_as_string(file_uri));
-
- librdf_parser_parse_into_model(world->parser, file_uri, NULL, world->model);
+ librdf_stream* stream = librdf_model_as_stream(model);
+ librdf_model_add_statements(world->model, stream);
+ librdf_free_stream(stream);
+ librdf_free_model(model);
+ librdf_free_storage(storage);
+
slv2_world_unlock_if_necessary(world);
}
@@ -310,8 +320,6 @@ slv2_world_load_bundle(SLV2World world, const char* bundle_uri_str)
librdf_node* object = librdf_new_node_from_uri(world->world,
manifest_uri);
- //printf("SPEC: %s\n", librdf_uri_as_string(librdf_node_get_uri(subject)));
-
librdf_model_add(world->model, subject, predicate, object);
/* Add ?specification slv2:bundleURI <file://some/path> */
@@ -425,13 +433,11 @@ slv2_world_load_specifications(SLV2World world)
librdf_query_results* results = librdf_query_execute(q, world->model);
while (!librdf_query_results_finished(results)) {
- librdf_node* spec_node = librdf_query_results_get_binding_value(results, 0);
- librdf_uri* spec_uri = librdf_node_get_uri(spec_node);
+ librdf_node* spec_node = librdf_query_results_get_binding_value(results, 0);
+ //librdf_uri* spec_uri = librdf_node_get_uri(spec_node);
librdf_node* data_node = librdf_query_results_get_binding_value(results, 1);
librdf_uri* data_uri = librdf_node_get_uri(data_node);
- //printf("SPEC: %s / %s\n", librdf_uri_as_string(spec_uri), librdf_uri_as_string(data_uri));
-
slv2_world_load_file(world, data_uri);
librdf_free_node(spec_node);
@@ -458,7 +464,7 @@ slv2_world_load_plugin_classes(SLV2World world)
"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n"
"SELECT DISTINCT ?class ?parent ?label WHERE {\n"
//" ?plugin a ?class .\n"
- " ?class a :Class; rdfs:subClassOf ?parent; rdfs:label ?label\n"
+ " ?class a rdfs:Class; rdfs:subClassOf ?parent; rdfs:label ?label\n"
"} ORDER BY ?class\n";
librdf_query* q = librdf_new_query(world->world, "sparql",
@@ -474,8 +480,6 @@ slv2_world_load_plugin_classes(SLV2World world)
librdf_node* label_node = librdf_query_results_get_binding_value(results, 2);
const char* label = (const char*)librdf_node_get_literal_value(label_node);
- printf("CLASS: %s / %s\n", librdf_uri_as_string(parent_uri), librdf_uri_as_string(class_uri));
-
SLV2PluginClass plugin_class = slv2_plugin_class_new(world,
(const char*)librdf_uri_as_string(parent_uri),
(const char*)librdf_uri_as_string(class_uri),