summaryrefslogtreecommitdiffstats
path: root/src/query.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-11-07 06:35:31 +0000
committerDavid Robillard <d@drobilla.net>2010-11-07 06:35:31 +0000
commit2e52630e15faf3cfbf06583fa66c82dcd172627f (patch)
treea3862dafca2bcd8f92d5d701643723755f8ece9a /src/query.c
parent38416afb8e2d7fe432e0f8610a458e2429d17ece (diff)
downloadlilv-2e52630e15faf3cfbf06583fa66c82dcd172627f.tar.gz
lilv-2e52630e15faf3cfbf06583fa66c82dcd172627f.tar.bz2
lilv-2e52630e15faf3cfbf06583fa66c82dcd172627f.zip
Use librdf_model_find_statements instead of SPARQL for (most) simple 1-variable queries.
git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@2667 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/query.c')
-rw-r--r--src/query.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/query.c b/src/query.c
index 58e5f80..615eeaf 100644
--- a/src/query.c
+++ b/src/query.c
@@ -205,3 +205,15 @@ slv2_plugin_query_count(SLV2Plugin plugin,
return ret;
}
+librdf_stream*
+slv2_plugin_find_statements(SLV2Plugin plugin,
+ librdf_node* subject,
+ librdf_node* predicate,
+ librdf_node* object)
+{
+ librdf_statement* q = librdf_new_statement_from_nodes(
+ plugin->world->world, subject, predicate, object);
+ librdf_stream* results = librdf_model_find_statements(plugin->rdf, q);
+ librdf_free_statement(q);
+ return results;
+}