I am using ACL to write a simple rule to compare the date from the knowledge base(KB) with the current time...
The date of format in KB is in this format 19:00:00+08:00 but however when i called the triples in ACL it return in this format 280515645427456.However i convert this using lisp UPI which return in this format -59958190799137. I also found a problem when tried to compare this with the current time as it return universal format 3618891473.I hope you can help to solve the problem.This is the sample rule that i wrote ...hope you guys can help me
Code: Select all
(<-- (FindAction ?mac ?tnow ?tnow1 ?t1 ?tt1 ?action ?graph)
(q ?dataS !DS:hasMacAddress ?mac ?graph)
(q ?dataS !DS:hasLuminance ?LumX ?graph)
(lisp ?tnow (get-universal-time))
;(lisp ?tnow1 (upi->value ?tnow))
;(lisp ?timX (date-string-to-upi ?tnow))
(q ?cc !IOT:hasParameter ?ccp)
(not (q ?ccp !IOT:hasMotion ?Mot))
(q ?ccp !IOT:hasLuminance ?Lum)
(q ?Lum !IOT:hasMinLum ?Lum1)
(lispp (<= (upi->value ?Lum1) (upi->value ?LumX)))
(q ?Lum !IOT:hasMaxLum ?Lum2)
(lispp (<= (upi->value ?LumX) (upi->value ?Lum2)))
(q ?ccp !IOT:hasTime ?time)
(q ?time !IOT:hasMinTime ?t1)
(lisp ?tt1 (upi->value ?t1))
;(lisp ?tt2 (ut-to-date-time ?tt1))
(lisp (<= ?t1 ?tnow))
;(lispp (<= ?tt1 ?tnow))
(q ?time !IOT:hasMaxTime ?t2)
;(lisp ?tt2 (upi->value ?t2))
(lisp (<= ?tnow ?t2))
;(lispp (<= ?tnow ?tt2))
(q ?ccp !IOT:hasAction ?action)
)