Re: [rules-users] Pass Parameter to drools file dynamically

2013-03-15 Thread Richa
I created a fact type in my code but I am getting exceptions: 

declare Airline
 name:String
end

and this is the java code that I am using.

DroolsXPathEvaluatorFactory evaluatorFactory=new
DroolsXPathEvaluatorFactory();

evaluatorFactory.setPackageStream(TestMain.class.getResourceAsStream(rule1.drl));

KnowledgeBase kbase=KnowledgeBaseFactory.newKnowledgeBase();
FactType airlineType=kbase.getFactType(droolshelloworld, Airline);
Object ob=airlineType.newInstance();
airlineType.set(ob, name, //Airline);
StatefulSession
ksession=evaluatorFactory.getRuleBase().newStatefulSession(true);
ksession.insert(ob);
ksession.fireAllRules();

XPathEvaluator evaluator=evaluatorFactory.create();
evaluator.evaluate(TestMain.class.getResourceAsStream(test.xml));

This is giving me exception. Please tell me what am I doing wrong here?




--
View this message in context: 
http://drools.46999.n3.nabble.com/Pass-Parameter-to-drools-file-dynamically-tp4022820p4022832.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Pass Parameter to drools file dynamically

2013-03-15 Thread rjr201
I'm a bit confused as to how this relates to your previous post. Where are
you getting the exception?

Something like this would work: 

 File dsl = new File(Path of your rule);
 KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
 kbuilder.add(ResourceFactory.newFileResource(dsl), ResourceType.DRL); 
 
 KnowledgeBase kbase = kbuilder.newKnowledgeBase();
 StatefulKnowledgeSession session = kbase.newStatefulKnowledgeSession();

 FactType airlineType = kbase.getFactType(droolshelloworld, Airline); 
 Object ob = airlineType.newInstance(); 
 airlineType.set(ob, name, //Airline); 

 session.insert(ob); 
 session.fireAllRules(); 

And your rule looks like this: 

declare Airline 
 name:String 
end 

ruleTest
 
when 
message:Airline(name==//Airline) 
then 
System.out.println(Hello Richa.); 
end

As I said in my previous post. You really need to read some tutorials on
this. 



--
View this message in context: 
http://drools.46999.n3.nabble.com/Pass-Parameter-to-drools-file-dynamically-tp4022820p4022835.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Importing existing drl into Guvnor

2013-03-15 Thread droolist
Have you tried...
New Package... Import from DRL file?
What errors are you seeing?



--
View this message in context: 
http://drools.46999.n3.nabble.com/Importing-existing-drl-into-Guvnor-tp4022836p4022837.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Expert Systems and Functional programming?

2013-03-15 Thread Mauricio Salatino
I usually try to attend RuleML meet ups and Intellifest (ex October Rules
Fest) there you meet all the Expert System community.
Cheers


On Fri, Mar 15, 2013 at 5:43 PM, Grant Rettke gret...@acm.org wrote:

 Who are the primary researchers of expert-systems today?

 On Tue, Mar 12, 2013 at 8:21 PM, Mark Proctor mproc...@codehaus.org
 wrote:
  Actually Pamela is one of the papers I've been trying to track down,
 can't get it on the internet any more. As I first saw it referenced in
 Production matching for large learning systems.
 
  You don't by chance have the paper still?
  Barachini, F. (1991) The evolution of PAMELA. Expert Systems, 8(2):87-98
 
  I'm building up a collection of relevant research papers, over at
 mendelay. That is one of my missing papers, that I've been unable to track:
  http://www.mendeley.com/groups/2918061/rule-systems/papers/
 
  Mark
  On 12 Mar 2013, at 18:28, Wolfgang Laun wolfgang.l...@gmail.com wrote:
 
  Mark,
 
  no, the system I'm talking about is PAMELA, developed here in Vienna.
  You may find references to papers citing PAMELA, authored by
  F.Barachini and N.Theuretzbacher (one is referenced in the thesis you
  quoted, see [13]), but I doubt that you'l find one of the papers on
  the web. It was pre-internet days way back then :-)
 
  If you could produce an RBS ranking based on rules fired in
  production, I think that PAMELA would be in an excellent position.
  There's a three-digit number of installations by now, but they're
  running 24/7.
 
  -W
 
 
  On 12/03/2013, Mark Proctor mproc...@codehaus.org wrote:
  OPS83?
 
 http://repository.cmu.edu/cgi/viewcontent.cgi?article=2478context=compsci
 
 
  or YES/L1? (seems information on this is out of print and not online
  either)
  http://www.amazon.com/dp/B00070YQSU/ref=r_soa_w_d
  YES/L1: Integrating expert systems technology with traditional
 programming
  languages (Research Report RC. International Business Machines Inc.
 Research
  Division)
 
 
  I definitely find linq interesting, as it's straight out of the
 research
  pages from these projects - I wonder if the linq/database propel know
 about
  these... The first time I saw it was in this paper procedural match
 augments
  data-driven match
  http://www.aaai.org/Papers/AAAI/1986/AAAI86-037.pdf
 
  They move the lhs logic into the consequence block, using the actual
  when part as a simple goal trigger - allowing the 'lhs' to be used
  procedurally, like linq. This allows them to control when a rule is
  evaluated and that it's evaluation is atomic, and can have cleanup work
  done.
 
  Mark
 
  On 12 Mar 2013, at 06:04, Wolfgang Laun wolfgang.l...@gmail.com
 wrote:
 
  Indeed, this thesis mentions a few features of the system I was
  talking about :-)
  ([13])
  -W
 
  On 11/03/2013, Mark Proctor mproc...@codehaus.org wrote:
  There were a number of research efforts that looked at combining
  procedural
  and rule base programming.
  This one is quite interesting:
  Combining Rule-Based and Procedural Programming in the XC and XE
  Programming
  Lanaugages
 
 http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.9.1106rep=rep1type=pdf
 
  Mark
 
 
  On 11 Mar 2013, at 18:03, Wolfgang Laun wolfgang.l...@gmail.com
 wrote:
 
  On 11 March 2013 16:19, Mark Proctor mproc...@codehaus.org wrote:
  So thinking really long term here. Can we build a java layer that
  provide all the rule functionality we need - but fit ontop of the
 java
  language neatly. We'd probably need to allow rule keyword and
 have it
  in
  Classes, at the method level. All class members and methods would be
  available to the rules in that class.
 
  There is this production rule system where you can write your rules
  embedded in compiling units, and alongside the legacy program
 units, of
  a
  procedural, modular, strongly type HLL, and where you use
 expressions
  in
  the language's own syntax in constraints...
 
  We've been using it ever since 1986. Rabbi Akiva was right, wasn't
 he
  ;-)
 
  -W
 
  ___
  rules-users mailing list
  rules-users@lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users
 
 
  ___
  rules-users mailing list
  rules-users@lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users
 
 
  ___
  rules-users mailing list
  rules-users@lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users
 
 
  ___
  rules-users mailing list
  rules-users@lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users
 
 
  ___
  rules-users mailing list
  rules-users@lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users



 --
 Grant Rettke | ACM, AMA, COG, IEEE
 gret...@acm.org | http://www.wisdomandwonder.com/
 Wisdom begins in wonder.
 ((λ (x) (x x)) (λ (x) (x x)))

 

Re: [rules-users] Expert Systems and Functional programming?

2013-03-15 Thread Mark Proctor
There hasn't been a lot of expert system engine research since 1995:
http://blog.athico.com/2012/05/drools-54-artificial-intelligence.html

In general academics have focused more on the logic programming side, referred 
to as knowledge representation and reasoning. Developing formalised semantics 
to represent the world around us, and mappings between those representations. 
The mapping/layered aspect was a key aspect of he RIF standard. Examples of 
formalised representations would be Defeasible Logic, 
http://en.wikipedia.org/wiki/Defeasible_logic, and Description Logic, 
http://en.wikipedia.org/wiki/Description_logic. The engine which implements 
this is just a side note, and typically they target prolog. Take a look at the 
last 5 years of RuleML published papers, and you'll get a good idea.

Academic engines of interest:
Flora-2/XSB, jDrew, silk, opencyc, jess, openrdf, jena.

I inlcude Jess in the above, which is actually still more popular than Drools 
in Academia - although it's not open source (only free for non-commercial use).

OWL and semantic ontologies drives a lot of the engine implementation research 
these days.

Mark

On 15 Mar 2013, at 20:43, Grant Rettke gret...@acm.org wrote:

 Who are the primary researchers of expert-systems today?
 
 On Tue, Mar 12, 2013 at 8:21 PM, Mark Proctor mproc...@codehaus.org wrote:
 Actually Pamela is one of the papers I've been trying to track down, can't 
 get it on the internet any more. As I first saw it referenced in Production 
 matching for large learning systems.
 
 You don't by chance have the paper still?
 Barachini, F. (1991) The evolution of PAMELA. Expert Systems, 8(2):87-98
 
 I'm building up a collection of relevant research papers, over at mendelay. 
 That is one of my missing papers, that I've been unable to track:
 http://www.mendeley.com/groups/2918061/rule-systems/papers/
 
 Mark
 On 12 Mar 2013, at 18:28, Wolfgang Laun wolfgang.l...@gmail.com wrote:
 
 Mark,
 
 no, the system I'm talking about is PAMELA, developed here in Vienna.
 You may find references to papers citing PAMELA, authored by
 F.Barachini and N.Theuretzbacher (one is referenced in the thesis you
 quoted, see [13]), but I doubt that you'l find one of the papers on
 the web. It was pre-internet days way back then :-)
 
 If you could produce an RBS ranking based on rules fired in
 production, I think that PAMELA would be in an excellent position.
 There's a three-digit number of installations by now, but they're
 running 24/7.
 
 -W
 
 
 On 12/03/2013, Mark Proctor mproc...@codehaus.org wrote:
 OPS83?
 http://repository.cmu.edu/cgi/viewcontent.cgi?article=2478context=compsci
 
 
 or YES/L1? (seems information on this is out of print and not online
 either)
 http://www.amazon.com/dp/B00070YQSU/ref=r_soa_w_d
 YES/L1: Integrating expert systems technology with traditional programming
 languages (Research Report RC. International Business Machines Inc. 
 Research
 Division)
 
 
 I definitely find linq interesting, as it's straight out of the research
 pages from these projects - I wonder if the linq/database propel know about
 these… The first time I saw it was in this paper procedural match augments
 data-driven match
 http://www.aaai.org/Papers/AAAI/1986/AAAI86-037.pdf
 
 They move the lhs logic into the consequence block, using the actual
 when part as a simple goal trigger - allowing the 'lhs' to be used
 procedurally, like linq. This allows them to control when a rule is
 evaluated and that it's evaluation is atomic, and can have cleanup work
 done.
 
 Mark
 
 On 12 Mar 2013, at 06:04, Wolfgang Laun wolfgang.l...@gmail.com wrote:
 
 Indeed, this thesis mentions a few features of the system I was
 talking about :-)
 ([13])
 -W
 
 On 11/03/2013, Mark Proctor mproc...@codehaus.org wrote:
 There were a number of research efforts that looked at combining
 procedural
 and rule base programming.
 This one is quite interesting:
 Combining Rule-Based and Procedural Programming in the XC and XE
 Programming
 Lanaugages
 http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.9.1106rep=rep1type=pdf
 
 Mark
 
 
 On 11 Mar 2013, at 18:03, Wolfgang Laun wolfgang.l...@gmail.com wrote:
 
 On 11 March 2013 16:19, Mark Proctor mproc...@codehaus.org wrote:
 So thinking really long term here. Can we build a java layer that
 provide all the rule functionality we need - but fit ontop of the java
 language neatly. We'd probably need to allow rule keyword and have it
 in
 Classes, at the method level. All class members and methods would be
 available to the rules in that class.
 
 There is this production rule system where you can write your rules
 embedded in compiling units, and alongside the legacy program units, of
 a
 procedural, modular, strongly type HLL, and where you use expressions
 in
 the language's own syntax in constraints...
 
 We've been using it ever since 1986. Rabbi Akiva was right, wasn't he
 ;-)
 
 -W
 
 ___
 rules-users mailing