Don't see any way anyone can help without at least seeing the rule that
doesn't fire!
[And I'm not offering off-list consultancy, please do not send me any
confidential data!]
However, if it runs after you've done a full inference closure then
presumably that's the issue. It suggests that your rule is relying on
some OWL inference and won't fire on the raw data. In which case you
either need to modify your rule to not require that inference or extend
your rule set to perform the required OWL inference (if possible, and
bearing in mind that forward rules won't see the results of backward
inference).
If that doesn't help then I suggest you cut both your data and rule down
a complete minimal example that is sufficiently abstract you can post it.
Dave
On 20/07/17 21:07, Ullah, Izhar wrote:
Hi all,
I am trying to reason over data using Jena rules (a separate txt file) and a
data file (which is an ontology file having instances). Just to give an idea of
how my simple code looks like, have a look at the piece of code given below:
public static void main(String[] args) throws MalformedURLException {
Model instances = ModelFactory.createDefaultModel();
instances.read ("/Users/Desktop/Ontology/IoT-Ontology-file.owl",
"TURTLE");
Reasoner reasoner = new
GenericRuleReasoner(Rule.rulesFromURL("/Users/Desktop/rules_iot.txt"));
reasoner.setDerivationLogging(true);
InfModel inf = ModelFactory.createInfModel(reasoner, instances);
Let me clearly say that the above code is not complete. I have run my code over
three Jena rules successfully and derived/inferred new facts from the data file
(ontology file) but it does not work for one rule. It does not give any error
but the rule seems to be not firing. Though, when I run the Ontology reasoner
(Pellet reasoner) over my ontology, it successfully fires and infers a new fact.
Can someone please help me out? I can't send my data file (ontology file) to
the group because of confidentiality and privacy issues but I can send it to a
particular individual at his/her email address who could help.
Should you require any further information please let me know.
Many thanks in advance.
Best regards,
Izhar