From 2e52630e15faf3cfbf06583fa66c82dcd172627f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 7 Nov 2010 06:35:31 +0000 Subject: 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 --- src/query.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/query.c') 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; +} -- cgit v1.2.1