Re: How do I write this N3 statement correctly

Very nice and greaterOrEqualTo can be done with math:notLessThan


Op vr 5 nov. 2021 14:12 schreef William Van Woensel <
william.vanwoensel@gmail.com>:

> Hi Joy
>
>
>
> I drafted the following code for your example:
> http://ppr.cs.dal.ca:3002/n3/editor/s/lycuLUp2 (currently Eye does not
> support greaterOrEqualTo so we have to make do..). I slightly refactored
> your example to make the solution a bit more elegant – essentially, the
> rules first check whether individual limits are met, and, subsequently,
> whether a given rule has all its limits met.
>
>
>
>
>
> William
>
>
>
> *From: *Joy lix <joylix4112@outlook.com>
> *Date: *Monday, November 1, 2021 at 2:48 PM
> *To: *William Van Woensel <william.vanwoensel@gmail.com>,
> public-n3-dev@w3.org <public-n3-dev@w3.org>
> *Subject: *回复: How do I write this N3 statement correctly
>
> Dear Willian,
>
>       Thank you very much!  The output options you added to the N3 Editor
> make the reasoning result look much more convenient.  Your example of N3 on
> general conditional reasoning also inspired me a lot.   Although It doesn't
> give us the final result we need, but there may be a way to do it.
>
> please have a Look at this general example:
>
> *@prefix : <#> .*
>
> *:decisionSystem :hasRule :rule1, :rule2, :rule3;*
>
> *          :isAbout :PropertyA .*
>
> *:rule1 :range [:lowerLimit :Low ;          *
>
> *                    :lowerInclusive "True" ;*
>
> *                    :upperLimit :High ;          *
>
> *                    :upperInclusive "False" ];      *
>
> *       :conclusion "suitable".    *
>
>
>
> *:rule2 :range [:upperLimit :Low ;          *
>
> *                       :upperInclusive "False" ] ;*
>
> *         :conclusion "tooLow".*
>
>
>
> *:rule3 :range [:lowerLimit :High ;*
>
> *                      :lowerInclusive "True" ] ;  *
>
> *        :conclusion "tooHigh".*
>
>      Let's say PropertyA is the temperature of the room, :Low=18,
> :High=28, so When entering the actual temperature of the room, the system
> should be able to deduce the current comfort level.  This is a practical
> example of how I want to use plain RDF to store simple conditional
> data,  This data can then be reconstituted into N3 for inference. This
> general example is useful for solving many practical problems in
> engineering.
>
> In this example, I'm still a little confused about how to handle whether
> the boundary is inclusive or not.
>
>     In addition, Ryan mentioned that you can store conditional data in
> strings, but I don't know how to handle this in N3.
>
>
>
> Kind regards,
>
> Joylix
>
>
>
>
>
>
>
>
>
> ------------------------------
>
> *发**件人**:* William Van Woensel <william.vanwoensel@gmail.com>
> *发**送**时间**:* 2021年10月31日 1:44
> *收件人**:* Joy lix <joylix4112@outlook.com>; public-n3-dev@w3.org <
> public-n3-dev@w3.org>
> *主**题**:* Re: How do I write this N3 statement correctly
>
>
>
> Hi Joy
>
>
>
> In addition to what Jos shares with you, you can try out the following
> “pure” N3 code (not relying on Eye-specific builtins) to arbitrarily
> combine logical conditions: http://ppr.cs.dal.ca:3002/n3/editor/s/mEWJDvxb
> (It relies on N3’s ability to write rules that themselves generate new
> rules, and embed variables directly in the data, for instance.)
>
>
>
> Unfortunately, it only infers whether the condition of the subject
> “tempTest” is met (conditionMet = true), and not which resources led to it
> being true (e.g., temperature1 or temperature2). So, I don’t know whether
> it fully meets your needs. At any rate, maybe the plugin code can give you
> some other ideas :-)
>
>
>
>
>
> William
>
>
>
>
> *From: *Joy lix <joylix4112@outlook.com>
> *Date: *Saturday, October 23, 2021 at 5:27 AM
> *To: *"public-n3-dev@w3.org" <public-n3-dev@w3.org>
> *Subject: *How do I write this N3 statement correctly
> *Resent-From: *<public-n3-dev@w3.org>
> *Resent-Date: *Sat, 23 Oct 2021 08:27:46 +0000
>
>
>
> Dear, all,
>
> I wrote a N3 statement as follows:
>
> *PREFIX math: <http://www.w3.org/2000/10/swap/math#
> <http://www.w3.org/2000/10/swap/math#>>*
>
>
>
> *:temperature1 :value -20.*
>
> *:temperature2 :value 42.*
>
>
>
> *{?temperature :value ?value. ?value math:lessThan -10} *
>
> * =>*
>
> *{?temperature :value :abnormal }.*
>
>
>
> *{?temperature :value ?value . ?value math:greaterThan 40}*
>
> *=>*
>
> *{?temperature :value :abnormal }.*
>
>
>
> Is there any way to  use "or" to simplify it into a single inference
> statement? And how do I use "else" to indicate that temperature values
> outside these ranges are "normal"?
>
> In addition, I use http://ppr.cs.dal.ca:3002/n3/editor/, in the deductive
> information of "eye", can I show only the inferred results alone?
>
>       Thanks for helping.
>
>
>
> Joylix
>
>
>

Received on Friday, 5 November 2021 16:19:42 UTC