Warning:
This wiki has been archived and is now read-only.

NotAssertRetract

From RIF
Jump to: navigation, search




Test TypePositiveEntailmentTest
ContributorAdrian Paschke
StatusObsolete
Record
DialectPRD
PurposeRetract + Assert Action of RIF PRD
DescriptionDemonstrates the combination of the assert and retract action together with negation in RIF PRD. The first rule retracts the existing customer object and asserts a new one with a new discount value of "0". Note, if the combination of retract and assert is semantically not like an atomic modify action, the second rule will be triggered due to the retraction of the customer object in the first rule. The second rule will then assert a new customer object with unknown status.
SeeAlsoAssert, Retract, AssertRetract, Modify
SpecRefhttp://www.w3.org/2005/rules/wiki/PRD
Premises
Presentation SyntaxDocument( Prefix(ex <http://example.org/example#>) Prefix(xs <http://www.w3.org/2001/XMLSchema#>) Group ( Forall ?Name ( If ex:customer[ex:status -> "normal" ex:name -> ?Name] Then Do ( Retract (ex:customer[ex:name -> ?Name]) Assert (ex:customer[ex:status -> "normal" ex:discount -> "0" ex:name -> ?Name]) ) Forall ?Name ( If Not( ex:customer[ex:name -> ?Name] ) Then Do ( Assert (ex:customer[ex:status -> "unknown" ex:discount -> "0" ex:name -> ?Name]) ) ex:customer[ex:status -> "normal" ex:discount -> "10" ex:name -> "John Doe"] ) )
XMLview RIF/XML
Conclusion
Presentation Syntaxex:customer[ex:status -> "normal" ex:discount -> "0" ex:name -> "John Doe"]
XMLview RIF/XML