Closed nqduy35 closed 5 years ago
Have you defined prefix mappings for both 'abc' and 'def'?
Can you post a detailed code fragment.
Thank @martinjoconnor for the answer. According to your instruction, I need to define "prefix mappings" on the code to use the my prefixes. It is not enough the declaration of the prefixes in the ontology file (.owl). I will try this solution and close the topic here.
Using SWRLAPI 2.0.6, OWLAPI 4.2.8 for this test. The code is simple as in this example except the ontology and the testing rule:
abc:Person(?person) -> abc:hasCar(?person,def:Car_Toyota_Black)
.I do three test cases:
Add this rule to the Ontology using protege swrlTab. Run Drools in swrlTab: GOOD
Add this rule to the Ontology using protege swrlTab. Run function ruleEngine.infer() of SWRLAPI: GOOD
Add this rule to the Ontology using SWRLAPI with the function createSWRLRuleEngine(ontology) as in the example. Run function ruleEngine.Infer() of SWRLAPI: error appear:
ERROR org.semanticweb.owlapi.rio.utils.RioUtils - Object URI was invalid: _:genid854 <http://www.w3.org/2003/11/swrl#argument1> <#person>.
What is the problem?