On 30/04/17 18:40, tina sani wrote:
Hi Dave, if we have a rule like
if Person publications less than 10, Person is JuniorResearcher
if Person publications greater than 10, Person is SeniorResearcher
If person publication is first less than 10, rules will assign him to
JuniorResearcher class but when it exceeds 10, becomes SeniorResearcher but
the JuniorResearcher also be there as rules does not replace the existed
value with new one.
Depends how you set the publications. If you remove the old (<10) value
and replace it with a new (>10) value then the rules will retract the
JuniorResearcher assertion and assert the SeniorResearch assertion.
This was my query if we put the inferred model to a new model, will the
rules then be able to replace the previous data?
Sorry, I still have no idea what architecture you have in mind. I
suggest trying a minimal example. If it doesn't do what you expect then
that will give you something concrete to ask questions about.
Dave
On Sun, Apr 30, 2017 at 4:38 PM, Dave Reynolds <[email protected]>
wrote:
On 30/04/17 10:30, tina sani wrote:
I have a model Model1 with all data, having Jena rules. How can I put it
in
another model Model2 which may or may not have any data?
The way to add triples from one model to another is to use the
unsurprisingly named "add" as any glance at the javadoc would tell you.
model2.add( model1 )
If model1 is actually an InfModel with forward rules then what will get
added to model2 is the base triples plus all inferred triples.
Second, after putting the model in another model, would we able to replace
previous values/data with new one, generated using Jena rules?
Question is unclear.
Once you have a model you and add or remove triples from it.
You can use rules to generate triples.
How you connect whatever bit of your code is using rules to whatever bit
of your code is holding the data is up to you. There are no out-of-the-box
rule builtins to allow you to fire a rule in one model and assert results
into another model if that's what you mean.
Dave