diff options
Diffstat (limited to 'src/statement.c')
-rw-r--r-- | src/statement.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/statement.c b/src/statement.c index f3034566..d6571c6c 100644 --- a/src/statement.c +++ b/src/statement.c @@ -17,6 +17,7 @@ #include "statement.h" #include "caret.h" +#include "node.h" #include <assert.h> #include <stdbool.h> @@ -132,3 +133,16 @@ serd_statement_equals(const SerdStatement* const a, serd_node_equals(a->nodes[2], b->nodes[2]) && serd_node_equals(a->nodes[3], b->nodes[3]))); } + +bool +serd_statement_matches(const SerdStatement* const statement, + const SerdNode* const subject, + const SerdNode* const predicate, + const SerdNode* const object, + const SerdNode* const graph) +{ + return (serd_node_pattern_match(statement->nodes[0], subject) && + serd_node_pattern_match(statement->nodes[1], predicate) && + serd_node_pattern_match(statement->nodes[2], object) && + serd_node_pattern_match(statement->nodes[3], graph)); +} |