- From: tim duval <tim.duval11@gmail.com>
- Date: Mon, 3 Oct 2022 12:47:28 -0400
- To: Jos De Roo <josderoo@gmail.com>
- Cc: public-n3-dev@w3.org
- Message-ID: <CAA8RyBha05UMnTcEwrj5MPTHFZXV9mAnZK=MoaUvG3ge5DAofw@mail.gmail.com>
Corrections below: On Mon, Oct 3, 2022 at 12:43 PM tim duval <tim.duval11@gmail.com> wrote: > Thanks Jos! I will definitely check out the time samples > > *Regarding regular expressions:* > I find that string:matches() returns a boolean whether or not the string > matches the regular expression, > I am looking to extract the number from the string based on the regular > expression. > For example, I would like to assign the result of re.match('13.4 kV', > '\d+\\.*\\d*') to a variable, the result being 13.4 > > *Regarding coalesce:* > Coalesce returns the first non-null value from a list/collection. > > I believe there is no concept of null in rdf, I see that *rdf:nil* > available to represent NULL, so I am thinking this would be translated into > returning the first item from a list/collection that is not empty rdf:nil > (i'm checking R2RML spec to see how nulls are handled when converting dbms > to rdf) > > https://www.ibm.com/docs/en/informix-servers/14.10?topic=expressions-coalesce-function > > > On Mon, Oct 3, 2022 at 11:11 AM Jos De Roo <josderoo@gmail.com> wrote: > >> Indeed and for reasoning with time we have https://www.w3.org/TR/rif-dtb/ >> implemented in eye see >> https://github.com/josd/eye/blob/master/reasoning/rif/rifP.n3 >> >> dunno what coalesce is, maybe something like in >> >> https://github.com/phochste/Notation3-By-Example/blob/main/string/concatenation.n3 >> ? >> >> Jos >> >> -- https://josd.github.io >> >> >> On Mon, Oct 3, 2022 at 5:02 PM tim duval <tim.duval11@gmail.com> wrote: >> >>> I found that string:matches() looks like it can satisfy handling regular >>> expressions >>> >>> Just the other two that I could use some help. >>> >>> >>> >>> On Mon, Oct 3, 2022 at 10:24 AM, tim duval <tim.duval11@gmail.com> >>> wrote: >>> >>>> Hi! >>>> >>>> We are on the verge of implementing N3 for a product I am helping a >>>> client develop and in their due diligence, they are providing me with >>>> challenges to identify what the N3 equivalent is, e.g., Let's see if N3 can >>>> handle this!! (suffice to say there is a little skepticism).... >>>> >>>> Most of the list is easy to handle, though a few of them stuck out to >>>> me that it would be best to ask the community how these might be >>>> represented in N3 (built-in wise): >>>> >>>> *Coalesce:* >>>> Coalesce(@StatusCode,'123') >>>> >>>> *Regex expressions:* >>>> how can regular expressions be used?? >>>> e.g., substring('13.4 kv', '(([0-9]+.*)*[0-9]+)') as decimal --> >>>> returns 13.4 >>>> >>>> *Convert time to current/provided timezone:* >>>> >>>> session-created-date-utc = "2022-08-15 18:57:40" >>>> >>>> current-timezone = 'CDT' >>>> >>>> result is: "2022-08-15 12:57:40" >>>> >>>> >>>> Any help is appreciated >>>> >>>> >>>> Thanks! >>>> >>>> >>>> Tim Duval >>>> >>>> >>>>
Received on Monday, 3 October 2022 16:47:52 UTC