From 5ce531b66dc6f14c594dfdf551b65360e5b6f700 Mon Sep 17 00:00:00 2001 From: ccamel Date: Thu, 10 Aug 2023 18:56:02 +0200 Subject: [PATCH] refactor(cognitarium)!: make delete triples optional and enforce where clause Previously, delete triples was mandatory and the where clause optional. It was incorrect with regards to the W3C specification of the SPARQL DELETE query. --- contracts/okp4-cognitarium/src/msg.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/contracts/okp4-cognitarium/src/msg.rs b/contracts/okp4-cognitarium/src/msg.rs index 40625120..50e617be 100644 --- a/contracts/okp4-cognitarium/src/msg.rs +++ b/contracts/okp4-cognitarium/src/msg.rs @@ -67,11 +67,12 @@ pub enum ExecuteMsg { DeleteData { /// The prefixes used in the operation. prefixes: Vec, - /// The items to delete. + /// Specifies the specific triple patterns to delete. + /// If nothing is provided, the patterns from the `where` clause are used for deletion. delete: Vec, - /// The WHERE clause to apply. - /// If not provided, all the RDF triples are considered. - r#where: Option, + /// Defines the patterns that data (RDF triples) should match in order for it to be + /// considered for deletion. + r#where: WhereClause, }, } @@ -431,7 +432,7 @@ pub struct ConstructQuery { } /// # Prefix -/// Represents a prefix in a [SelectQuery]. A prefix is a shortcut for a namespace used in the query. +/// Represents a prefix, i.e. a shortcut for a namespace used in a query. #[cw_serde] pub struct Prefix { /// The prefix.