summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--sord/sord.h10
-rw-r--r--src/syntax.c12
-rw-r--r--wscript2
4 files changed, 24 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 719aad5..932ffb8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
sord (UNRELEASED) unstable; urgency=low
* Add function sord_contains for checking for a triple pattern
+ * Add function sord_write_iter for writing a queried range
* Fix Sord::Namespaces::qualify to no longer chop prefixes
* Add ability to build static library
diff --git a/sord/sord.h b/sord/sord.h
index f76bc0e..d380da2 100644
--- a/sord/sord.h
+++ b/sord/sord.h
@@ -462,6 +462,16 @@ sord_write(SordModel* model,
SordNode* graph);
/**
+ Write a range to a writer.
+
+ This increments @c iter to its end, then frees it.
+*/
+SORD_API
+bool
+sord_write_iter(SordIter* iter,
+ SerdWriter* writer);
+
+/**
@}
@}
*/
diff --git a/src/syntax.c b/src/syntax.c
index 93e1331..ac87ad4 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -181,6 +181,18 @@ sord_write(SordModel* model,
{
SordQuad pat = { 0, 0, 0, graph };
SordIter* iter = sord_find(model, pat);
+ return sord_write_iter(iter, writer);
+}
+
+bool
+sord_write_iter(SordIter* iter,
+ SerdWriter* writer)
+{
+ if (!iter) {
+ return false;
+ }
+
+ SordModel* model = (SordModel*)sord_iter_get_model(iter);
for (; !sord_iter_end(iter); sord_iter_next(iter)) {
SordQuad tup;
sord_iter_get(iter, tup);
diff --git a/wscript b/wscript
index ca5608b..7a1188d 100644
--- a/wscript
+++ b/wscript
@@ -6,7 +6,7 @@ from waflib.extras import autowaf as autowaf
import waflib.Logs as Logs, waflib.Options as Options
# Version of this package (even if built as a child)
-SORD_VERSION = '0.4.3'
+SORD_VERSION = '0.5.0'
SORD_MAJOR_VERSION = '0'
# Library version (UNIX style major, minor, micro)