Document( Prefix(stores ) Prefix(cpt ) Prefix(ord ) Prefix(func ) Prefix(pred ) Prefix(xs ) Prefix(owl ) Prefix(dc ) Group ( (* _rule1[dc:name -> "rule 1" dc:publisher -> "http://www.w3.org/"^^rif:iri dc:date -> "2008-04-04Z"^^xs:date dc:description -> "if an item is perishable and it is delivered to a store more than ten days after the scheduled delivery date then the item will be rejected by the store" owl:versionInfo -> "0.1"^^xs:decimal] *) Forall ?item ?store ?deliverydate ?scheduledate ?diffduration ?diffdays ( cpt:reject(?store ?item) :- And(cpt:perishable(?item) cpt:delivered(?item ?deliverydate ?store) cpt:scheduled(?item ?scheduledate) External(pred:is-literal-dateTime(?deliverydate)) External(pred:is-literal-dateTime(?scheduledate)) ?diffduration = External(func:subtract-dateTimes(?deliverydate ?scheduledate)) ?diffdays = External(func:days-from-duration(?diffduration)) External(pred:numeric-greater-than(?diffdays 10))) ) cpt:perishable(ord:Order14) cpt:delivered(ord:Order14 "2008-07-22Z"^^xs:date stores:Store9) cpt:scheduled(ord:Order14 "2008-07-11Z"^^xs:date) ) )