FAQ Database Discussion Community


Strange behavior in Jess

ontology,rules,jess
I would like to find Bob children in the family ontology using Jess. The following rule should do it: (defrule FindBobChildren (object (is-a https://wiki.csc.calpoly.edu/OntologyTutorial/family_example.owl#Person) (OBJECT ?oi) (https://wiki.csc.calpoly.edu/OntologyTutorial/family_example.owl#hasParent ?b&:(eq (instance-name ?b) (instance-name https://wiki.csc.calpoly.edu/OntologyTutorial/family_example.owl#Bob))) ) => (printout t "Bob children:" (instance-name ?oi) crlf) ) But, unfortunately it only prints out children who...

Trouble formatting and displaying

html,css,rules
I'm still pretty new to coding so bear with me...I have read that different browsers display horizontal rules differently. I can't seem to get it right in Firefox or Chrome (only two I've checked so far). Here is what my hr's look like in Firefox: http://postimg.org/image/g2vn1cm3b/ The highest rule is...

yii2 disable the rules if a checkbox is selected

yii2,rules,active-form
In the active form, I have 3 textinput and one checkbox. All the 3 textinputs have rules that says cannot be empty. What I want is if the checkbox is clicked, It will disable the rules and will save the empty record in the database. here is screen shot of...

SgmlLinkExtractor in scrapy

web-crawler,scrapy,rules,extractor
i need some enlightenment about SgmlLinkExtractor in scrapy. For the link: example.com/YYYY/MM/DD/title i would write: Rule(SgmlLinkExtractor(allow=[r'\d{4}/\d{2}/\d{2}/\w+']), callback='parse_example')] For the link: example.com/news/economic/title should i write: r'\news\category\w+'or r'\news\w+/\w+' ? (category changes but the url contains always news) For the link: example.com/article/title should i write: r'\article\w+' ? (the url contains always article)...

Prolog - Lotto Machine

list,random,prolog,rules
This is my first post. I have been teaching myself Prolog for a university project and I am tasked with generating a program that simulates the lotto and compares the random numbers (6 in this case) with the numbers that the user has. If they all match then you are...

Yii2 - How to add custom error messages on input fields

validation,label,message,yii2,rules
In my database I named 'password' as 'password_hash' so automatically I'd get 'password_hash' in my error message, even tho I changed the label to 'Current password'. Example: What I want is: ...

Using Rules Engine

ruby-on-rails,ruby,rules,rule-engine
I have the following situation - I have Company and I have Incident. A Company offers many services (Service) and hence - has_and_belongs_to_many :services. An Incident needs some services (Service) and hence - has_and_belongs_to_many :services Now for a given incident I need to find all the companies that offer the...

Drools 6.2 How to use ArrayList in declared types?

collections,types,drools,rules,declare
Here is what I have in my DLR file: package mytypes; declare Person firstName : String lastName : String address : java.util.ArrayList end declare Address city : String state : String end rule "city" when p : Person() Address(city == "Dallas") from p.address then System.out.println("city rule fired"); end I use...

How to remove validation Rule from Ideal Forms JQuery

javascript,jquery,validation,rules,idealforms
Trying to remove validation rule from Ideal Forms and cannot get rid of it!. When value is less then 3 I am adding Rules to validate 4 extra fields but when I enter value more then 3 I want this validation be removed. I have been trying to add inside...

Prolog rules structure and its difference

prolog,rules
I'm confused about the structure of how my Prolog rules should be written. Lets say, I want to state that only birds can fly. Should my rule be written as fly(X):- bird(X). or bird(X):-fly(X). What is the difference in meaning between them? Furthermore, do I need to explicitly state that...

How to give validation rules in Yii to upload all file other then (.php, aspx, .cs etc)

php,yii,rules
return array( array('speech', 'required'), array('speech,document,speech_on,created_on, updated_on,inactive','safe') array('document','file','restrict','types'=>'.php,.aspx,.cs', 'maxSize'=>1024*1024*2,'tooLarge'=>'Size should be less then 2MB','on'=>'upload'), ); How can restrict these file to upload,...

How to handle Account Condition Properties Rules in Outlook VBA

vba,outlook,account,rules
I am trying to add a "from account" condition to a set of Outlook Rules, which are created by VBA. The DisplayName of the account is: [email protected], AccountType is: 0 and Class is: 105. Dim oAccountRuleConditionSubscribe As Outlook.AccountRuleCondition Dim oRuleNew As Outlook.Rule Set oAccountRuleConditionSubscribe = oRuleNew.Conditions.Account With oAccountRuleConditionSubscribe .Enabled =...

Magento Shopping Cart “alert ##” rules are somehow being automatically generated

magento,alert,shopping-cart,rules
Over the past couple of months, we seem to be getting all these automatically generated shopping cart rules being created. They have the name of "Alert #691", "Alert #697" etc. The incrementation appears to be a bit random (but always increases). We get about 2-5 of these rules per day....

Rule in a Table

sql,sql-server,rules
I need to put a rule in a table's column. Is a date's column. And i need a rule that only accepts an update only if the day is saturday or sunday. And between march to november. I'm doing this, but doesn't work: ALTER TABLE MyTable WITH CHECK ADD CONSTRAINT...

R. How to identify rules

r,associations,identity,rules
Does anyone know how to identify rules that show which treatments are typically used for which diseases. I have this data. First column - patient, second - disease, third - medicine. P1 D1 M1 P1 D2 M1 P2 D3 M2 M3 P2 D4 M4 P2 D1 M5 P2 D2 M6...

Use Jess rules in Java: Asserted instances cannot be used for further reasoning

java,rules,protege,jess
I am using JessTab API for manipulating ontologies in Java through Jess rules. A simple ontology with a class Person is used as an example. I ran the following code from Java to assert new instance for class Person: private final Rete r = new Rete(); Random randomGenerator = new...

Yii2 temporary validation variable for model rules

php,validation,model,yii2,rules
I want to validate that title_clean is unique and can be used as an identifier for URL's. But it is just an temporary instance of the real public variable that is given through the input (REST here). So I tried it with the following: public $title; public $title_clean // not...

Yii2 adjusting rules

php,yii2,rules
I have been playing with Yii2 and I am stuck at rules. The functionality I am trying to achieve: User is presented with a form where he can add points to different statistics. However, he has only limited amount of points he can add. Same like in almost any role-playing...

How do I give read/write access to all nodes with Firebase rules?

firebase,rules
Default setting gives full access: { "rules": { ".read": true, ".write": true } } For the sake of testing my understanding of rule-writing from the Firebase guide and documentation, I'm (now retreating to) trying to achieve the same results by writing rules for the 4 parent nodes. If it makes...

Cloudflare Conflicting Page-Rules?

caching,subdomain,rules,cloudflare
I have a website, say example.com. Couldflare is set to cache everything on *example.com/* If I add another rule: *nope.example.com/* And set it to bypass cache, what will cloudflare do with the conflicting page rules?...

Perplexed by how this code is processed by Haskell's Layout facility

haskell,layout,rules
Whilst browsing https://wiki.haskell.org/IO_inside, I encountered the following commentary and code ... "Moreover, Haskell layout rules allow us to use the following layout: main = do a <- readLn if (a>=0) then return () else do print "a is negative" ... that may be useful for escaping from the middle of...

Finding the best 3 elements in a collection in Drools

drools,boolean-logic,rules
Let's say I have some numbers in the working memory, and in a rule I need to check that the 3 higher numbers have a property (that they are all odd for example), how would you write that in pure Drools? I could collect all the numbers in a list...

Logic OR in a DSL

drools,dsl,rules
I have a question around how to do an or in a DSLR, I have this rule: rule "Test" when There is AThing - with attribute1 is equal to something1 - attribute2 is higher than or equal to somethingelse1 There is AThing - with attribute1 is equal to something2 -...