Using RDF and RDF Schema to enable dinamic data model
by Jackson Cunha
This message is primarily directed to Davide and Salaboy.
My name is Jackson Cunha. I am brazilian and I am working in a project
using drools expert. In this project, we are trying to abstract the data
model to turn it a dinamic and easily replaced.
For do that, our idea is represent the data model using rdf and rdf schema,
applying rdf instances directly on drools knowledge sessions.
We believe that use of rdf instances will turn the rule writing more
difficult. To address this issue, we are planning buila a DSL using antrl.
Given that, I'd like your opinion about some questions:
- What is your opinion about using rdf instances as facts in knowledge
sessions?
- What do you think the idea of ??using dsl to facilitate rule writing
involving instances of RDF?
- You see any other alternative to make data model dynamic using or not
ontologies?
Thanks in advance.
----------------------------------------------------------------------------------------------------------------
Jackson Cunha Cassimiro (CereB)
Bacharel em Ciencia da Computação - UFPI
MSN: jackson.cereb(a)gmail.com
Telefone Móvel +55 86 9928 1251
Analista de Sistemas - Infoway - http://www.infoway-pi.com.br
Missão Infoway - "Influenciar a Gestão de Sistemas de Saúde através de
e-health"
("A vida é um combate que os fracos abate, aos bravos, aos fortes só pode
exaltar" - Canção do Tamoio, Gonçalves Dias)
----------------------------------------------------------------------------------------------------------------
14 years, 3 months
Unable to use MySQL JNDI datasource with Guvnor
by jvg123
Hi,
[Guvnor 5.4.0.Beta2 on Jboss AS 7.1.1.Final with MySQL]
When I configure Guvnor to use MySQL through a JNDI datasource I get
multiple exceptions:
java.sql.SQLException: You cannot set autocommit during a managed
transaction!
Stack trace attached below.
The exact same datasource works OK without JNDI.
A
http://mail-archives.apache.org/mod_mbox/jackrabbit-users/200812.mbox/%3C...
thread on the JackRabbit mailing list says this is a problem with XA
datasources:
But my datasource is not XA....
Any suggestions would be much appreciated!
Thanks,
Jelle
======================================
2012/03/25 04:00:43,787 ERROR
[org.apache.jackrabbit.core.util.db.ConnectionHelper]
(http--127.10.162.129-8080-3) Failed to execute SQL (stacktrace on DEBUG log
level): java.sql.SQLException: You cannot set autocommit during a managed
transaction!
at
org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.setJdbcAutoCommit(BaseWrapperManagedConnection.java:878)
at
org.jboss.jca.adapters.jdbc.WrappedConnection.setAutoCommit(WrappedConnection.java:715)
at
org.apache.jackrabbit.core.util.db.ConnectionHelper.getConnection(ConnectionHelper.java:395)
[jackrabbit-core-2.2.8.jar:2.2.8]
at
org.apache.jackrabbit.core.util.db.ConnectionHelper.reallyExec(ConnectionHelper.java:278)
[jackrabbit-core-2.2.8.jar:2.2.8]
at
org.apache.jackrabbit.core.util.db.ConnectionHelper$1.call(ConnectionHelper.java:267)
[jackrabbit-core-2.2.8.jar:2.2.8]
at
org.apache.jackrabbit.core.util.db.ConnectionHelper$1.call(ConnectionHelper.java:263)
[jackrabbit-core-2.2.8.jar:2.2.8]
at
org.apache.jackrabbit.core.util.db.ConnectionHelper$RetryManager.doTry(ConnectionHelper.java:458)
[jackrabbit-core-2.2.8.jar:2.2.8]
at
org.apache.jackrabbit.core.util.db.ConnectionHelper.exec(ConnectionHelper.java:263)
[jackrabbit-core-2.2.8.jar:2.2.8]
at
org.apache.jackrabbit.core.util.db.CheckSchemaOperation.run(CheckSchemaOperation.java:89)
[jackrabbit-core-2.2.8.jar:2.2.8]
at
org.apache.jackrabbit.core.fs.db.DatabaseFileSystem.init(DatabaseFileSystem.java:197)
[jackrabbit-core-2.2.8.jar:2.2.8]
at
org.apache.jackrabbit.core.config.RepositoryConfigurationParser$6.getFileSystem(RepositoryConfigurationParser.java:1057)
[jackrabbit-core-2.2.8.jar:2.2.8]
at
org.apache.jackrabbit.core.config.RepositoryConfig.getFileSystem(RepositoryConfig.java:911)
[jackrabbit-core-2.2.8.jar:2.2.8]
at org.apache.jackrabbit.core.RepositoryImpl.(RepositoryImpl.java:285)
[jackrabbit-core-2.2.8.jar:2.2.8]
at
org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:605)
[jackrabbit-core-2.2.8.jar:2.2.8]
at
org.apache.jackrabbit.core.TransientRepository$1.getRepository(TransientRepository.java:180)
[jackrabbit-core-2.2.8.jar:2.2.8]
at
org.apache.jackrabbit.core.TransientRepository.startRepository(TransientRepository.java:280)
[jackrabbit-core-2.2.8.jar:2.2.8]
at
org.apache.jackrabbit.core.TransientRepository.login(TransientRepository.java:376)
[jackrabbit-core-2.2.8.jar:2.2.8]
at
org.apache.jackrabbit.commons.AbstractRepository.login(AbstractRepository.java:123)
[jackrabbit-jcr-commons-2.2.8.jar:]
at
org.drools.repository.JCRRepositoryConfigurator.login(JCRRepositoryConfigurator.java:95)
[guvnor-repository-connector-jcr-5.4.0.Beta2.jar:5.4.0.Beta2]
at
org.drools.repository.RulesRepositoryConfigurator.login(RulesRepositoryConfigurator.java:85)
[guvnor-repository-5.4.0.Beta2.jar:5.4.0.Beta2]
at
org.drools.guvnor.server.repository.RepositoryStartupService.newSession(RepositoryStartupService.java:118)
[guvnor-webapp-core-5.4.0.Beta2.jar:5.4.0.Beta2]
at
org.drools.guvnor.server.repository.RepositoryStartupService.create(RepositoryStartupService.java:69)
[guvnor-webapp-core-5.4.0.Beta2.jar:5.4.0.Beta2]
--
View this message in context: http://drools.46999.n3.nabble.com/Unable-to-use-MySQL-JNDI-datasource-wit...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 3 months
Resuable Sub Process From Eclipse to Guvnor
by Amin Mohammed-Coleman
Hi
I tried pushing a bpmn definition from eclipse to Guvnor and it contained a resuable sub process. When I view the definition in Guvnor I don't see the resuable sub process. All I see are connections to but not connected to anything. Has anyone else experienced this?
Thanks
14 years, 3 months
Can I capture the result of an RMI call within a pattern?
by lhorton
5.2.0.Final
consider this simplified example, which has RMI calls to a service to
getLocation()
rule "example"
when
$p : Product( location != remoteService.getLocation("A") )
then
$p.setLocation( remoteService.getLocation("A") );
end
the above rule calls the remote method twice, once in the LHS to compare to
a current value, and again in the RHS to set the value. I would like to
capture the return value of the LHS call, to avoid making the call twice. I
haven't been able to figure out the syntax to do this within the pattern.
Here's one example of what I have tried:
rule "example"
when
$p : Product( location != $loc : remoteService.getLocation("A") )
then
$p.setLocation( $loc );
end
Does anyone know the correct syntax to accomplish this? Or am I trying to
do the impossible?
--
View this message in context: http://drools.46999.n3.nabble.com/Can-I-capture-the-result-of-an-RMI-call...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 3 months
Using planner to create an optimized changeset
by Anton Hughes
Im interested in using Drools Planner to set the salience of a changeset, or
possibly create a new changeset.
So, using the Traveling salesmen problem, but this time the goal is
to reduce
the cost of the trip, we have a collection of rules, like (will write in
english rather than MVEL)
when traveling during holiday period
when traveling to London avoid Heathrow
when traveling more than 8 hours upgrade to business class ( so the
salesperson
is fresh)
when flying into NYC stay at xyz hotel
Would it be possible - or can anyone suggest ways of - generating a
changeset
(using Planner) of rules from another changeset, where the salience is
set, and/or rules are added/removed?
Thanks for you help. And very interested to hear your feedback.
14 years, 3 months
Data comparing in CONDITION column decision table
by Sumeet Karawal
Hi,
Can we use a data value of another object in the condition column of a
Spreadsheet.
For example: I have two data types(POJOs) one com.bank.Customer and other
com.bank.Account
in the rules I want to check whether the value entered for a particular
field in Customer class is equal to the value entered for the corresponding
field in the Account class. eg Customer.accType = Account.accType()
How can we achieve this using Decision table (CONDITION Column). I have
tried this:
--------------------------------------------
|RuleTable
|Discount
--------------------------------------------
|CONDITION |CONDITION |
---------------+----------------------------|
|$a : Account |$c : Customer |
---------------+----------------------------|
| |type == "$param"
----------+---------------+----------------------------
| Discount | Account | Type |
| Rules | | |
|----------+---------------+----------------------------|
| 1 | | $a.getType() |
|----------+---------------+----------------------------|
| 2 | | $a.getType() |
|----------+---------------+----------------------------|
| 3 | | $a.getType() |
|----------+---------------+----------------------------|
| 4 | | $a.getType() |
|----------+---------------+----------------------------|
| 5 | | $a.getType() |
|----------+---------------+----------------------------|
| 6 | | $a.getType() |
|----------+---------------+----------------------------|
But it won't work. It would be great if somebody could help me on this.
Thanks & Regards,
Sumeet Karawal
Mailto: sumeet.karawal(a)tcs.com
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
14 years, 3 months
Guvnor and DB2
by Amin Mohammed-Coleman
Hi
I am trying to integrate Drools Guvnor and DB2 however I'm struggling to get it to work. After changing the repository XML I seem to firstly get:
DbUtility.java:logException failed to close statement Reason already closed.
Followed by nosuchnodetype exception packagenodetype
The db permissions are correct I've confirmed with a separate app.
Any advice would be appreciated.
Thanks
Amin
Sent from my iPhone
14 years, 3 months
List<String> wrongly coerced to Object
by aitchnyu
I want to compare two List<String>'s if they have elements in common. I made
the following rule (actually two of them):
*----rule----*
rule "hardConflictIsIn"
when
$hc : HardConstraint(
$attribute : attribute,
operator == "is in",
$values : strAttributeValue,
$period : period
)
$stp : SubjectTeacherPeriod(
period == $period,
//Collections.disjoint( $t.attributes["tags"], values_list)
eval( Collections.disjoint( *strAttributeMap.get($attribute)*,
$values) == false )
)
then
insertLogical(new IntConstraintOccurrence("hardConflictIsIn",
ConstraintType.NEGATIVE_HARD,1,
$hc,$stp));
end
*----rule----*
But I get the following error:
*----error----*
Exception in thread "main" java.lang.IllegalStateException: There are errors
in the scoreDrl's:
Rule Compilation error : [Rule name='hardConflictNotIn']
in/co/technovia/timetabler/domain/Rule_hardConflictNotIn_8b50378322e744d883618db9941a8e66.java
(9:1204) : The method disjoint(Collection<?>, Collection<?>) in the type
Collections is not applicable for the arguments (*Object*, List)
Rule Compilation error : [Rule name='hardConflictIsIn']
in/co/technovia/timetabler/domain/Rule_hardConflictIsIn_d7f4ca0884754cf894e7cbdb96cee30e.java
(9:1203) : The method disjoint(Collection<?>, Collection<?>) in the type
Collections is not applicable for the arguments (Object, List)
at
org.drools.planner.config.solver.SolverConfig.buildRuleBase(SolverConfig.java:238)
at
org.drools.planner.config.solver.SolverConfig.buildSolver(SolverConfig.java:170)
at
org.drools.planner.config.XmlSolverConfigurer.buildSolver(XmlSolverConfigurer.java:103)
at
in.co.technovia.timetabler.TimeTableApp.createSolver(TimeTableApp.java:61)
at in.co.technovia.timetabler.TimeTableApp.main(TimeTableApp.java:45)
*----error----*
So something get'ted from the map SubjectTeacherPeriod.strAttributeMap is
wrongly coerced to an Object? I defined my SubjectTeacherPeriod class this
way:
*----class snippet----*
public class SubjectTeacherPeriod{
...
private Map<String, Integer> num_attribute_map = new HashMap<String,
Integer>();
private Map<String,List<String>> str_attribute_map = new
HashMap<String,List<String>>();
...
public Map<String,List<String>> getStrAttributeMap(){
return this.str_attribute_map;
}
...
*----class snippet----*
How can I fix this?
--
View this message in context: http://drools.46999.n3.nabble.com/List-String-wrongly-coerced-to-Object-t...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 3 months