From ff3c6fc88657d2e94847ceb00adea7597894d897 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 30 Mar 2012 02:19:52 +0000 Subject: Add convenient sord_search(), sord_ask(), and sord_count(). Add sord_validate tool for validating data against RDF/OWL schemas. git-svn-id: http://svn.drobilla.net/sord/trunk@211 3d64ff67-21c5-427c-a301-fe4f08042e5a --- sord/sord.h | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'sord') diff --git a/sord/sord.h b/sord/sord.h index 9bd3f02..9c4baf8 100644 --- a/sord/sord.h +++ b/sord/sord.h @@ -367,13 +367,47 @@ SordIter* sord_begin(const SordModel* model); /** - Search for a triple pattern. + Search for statements by a quad pattern. @return an iterator to the first match, or NULL if no matches found. */ SORD_API SordIter* sord_find(SordModel* model, const SordQuad pat); +/** + Search for statements by nodes. + @return an iterator to the first match, or NULL if no matches found. +*/ +SORD_API +SordIter* +sord_search(SordModel* model, + const SordNode* s, + const SordNode* p, + const SordNode* o, + const SordNode* g); + +/** + Return true iff a statement exists. +*/ +SORD_API +bool +sord_ask(SordModel* model, + const SordNode* s, + const SordNode* p, + const SordNode* o, + const SordNode* g); + +/** + Return the number of matching statements. +*/ +SORD_API +uint64_t +sord_count(SordModel* model, + const SordNode* s, + const SordNode* p, + const SordNode* o, + const SordNode* g); + /** Check if @a model contains a triple pattern. */ -- cgit v1.2.1