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

AssertRetract2

From RIF
Jump to: navigation, search




Test TypePositiveEntailmentTest
ContributorAdrian Paschke
StatusApproved
RecordFebruary 16, 2010 telecon
DialectPRD
PurposeRetract + Assert Action of RIF PRD
DescriptionDemonstrates the combination of the assert and retract action in RIF PRD. The rule retracts one fact about the existing customer object and asserts a new fact with a new discount value of "0". Note, the combination of retract and assert in this example does behave like a modify action.
SeeAlsoAssertRetract, Assert, Retract, Modify, Modify_loop
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 ?X ( If ?X[ex:status -> "normal" ex:discount -> "10"] Then Do ( Retract (?X[ex:discount -> "10"]) Assert (?X[ex:discount -> "0"]) ) ) ex:john[ex:status -> "normal" ex:discount -> "10"] ) )
XMLview RIF/XML
Conclusion
Presentation Syntaxex:john[ex:status -> "normal" ex:discount -> "0"]
XMLview RIF/XML