seeking hint / suggestion re: persisting dates with persistent modules in ergo lite

10 views
Skip to first unread message

Johann Bestowrous

unread,
Oct 20, 2020, 2:24:40 AM10/20/20
to ErgoAI, Flora-2, and XSB Users Forum
I have been having a lot of fun working with ergo-lite and hit a bit of a riddle that I am curious about.

The general experiment was that on a given day, I would 'reify' an intuition I had about some related topics of interest.

Something like:

?- insert{\#1:intuition[of-> ${principleOfExcludedMiddle[orbits-> enaction] \and enaction[launches-> sense[of->legitimacy]]},
                         on-> "2020-09-19"^^\date]@intuitionsOfThought}.

When I query this on a normal module, the \date (as associated with the on-> key name) value works as expected. When I make the module persistent, the 'round trip' of the datom results in the date showing up as:

datatype(date(1,2020,9,19,1,0,0,(751738, 0))@\prolog,date)@\prolog.

Which, as you might guess, doesn't unify with a date literal. As a person familiar with lisp, I took this to be the equivalent of a quoted s-expr, and I explored around to find the equivalent of 'eval' that would get me something that would allow me to query for 'intuitions' on a given day (as a \date literal).

I searched around the codebase and my best effort per budgeted time was something like 
?_:intuition[on-> ?X]@intuitionsOfThought, flora_parse_datatype(?X,_,?Z,_)@\plg(flrdatatype).

But, alas, no dice.

Is what I am curious to do possible? Feel free to correct any misuses of jargon or anything of that sort.

Til then I found that just using a string in the place of a date could get me that minimum of what I wanted tonight--but then I am curious how I could 'lift' the string representing the day into the date type.

Thanks a lot for sharing this project. It is a joy to explore.

Best,
JMSB

Michael Kifer

unread,
Oct 21, 2020, 2:21:23 AM10/21/20
to ErgoAI-Flor...@coherentknowledge.com

thanks for the report.

It seems that saving terms in a DB strips the backslash somehow.

But if you do not need to do date arithmetic then you can use numbers like 20200919 to represent dates.

--

       --- michael


 

--
You received this message because you are subscribed to the Google Groups "ErgoAI, Flora-2, and XSB Users Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ErgoAI-Flora2-XSB...@coherentknowledge.com.
To view this discussion on the web visit https://groups.google.com/a/coherentknowledge.com/d/msgid/ErgoAI-Flora2-XSB-forum/7a5ba9c5-6451-4aaf-85c8-4593b83ae2c6n%40coherentknowledge.com.

Johann Bestowrous

unread,
Oct 24, 2020, 1:53:29 AM10/24/20
to ErgoAI, Flora-2, and XSB Users Forum, Michael Kifer
Appreciate the response!

I had some time to revisit this today and wanted to relay that I was able to 'lift' the string representation to the date type in a query via something like:

    ?-  ?_:intuition[on-> ?X, of->?Y]@intuitionsOfThought, \date[toType(?X) -> ?Z]@\basetype, ?Z[equals("2020-09-19"^^\date)]@\basetype.

But now am seeing that fields that have reified values do not seem to be persisted. As time permits I will re-examine the documentation if there are any workarounds.
Reply all
Reply to author
Forward
0 new messages