As it says in [1] you need to use at least the MINI reasoner
configuration, not MICRO, to get sameAs inference.
Dave
[1] http://jena.apache.org/documentation/inference/#OWLcoverage
On 24/10/12 18:37, Joseph Daryl Locsin wrote:
Hello Jena Users,
I am trying to link two individuals A and B using
*
*
* B.setSameAs(A) *OR* A.setSameAs(B)*
A has properties hasOne, hasTwo
B has a property hasThree
and I'm hoping that the property of B can be inferred as a property of A.
Unfortunately, when I list A's properties, hasThree doesn't appear
This is my setup:
OntModel onto =
ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM_MICRO_RULE_INF, null);
String NAMESPACE1 = "http://mynamespace.one#";
String NAMESPACE2 = "http://mynamespace.two#";
OntClass myClass = onto.createClass(NAMESPACE1 + "MyClass");
Individual a = onto.createIndividual(NAMESPACE1 + "A", myClass);
Individual b = onto.createIndividual(NAMESPACE2 + "B", myClass);
//NOTE: I used a different namespace for B to simulate a different
address, but in this setup it is using the same class type
OntProperty one = onto.createOntProperty(NAMESPACE1 + "hasOne");
OntProperty two = onto.createOntProperty(NAMESPACE1 + "hasTwo");
OntProperty three = onto.createOntProperty(NAMESPACE2 +
"hasThree"); //NOTE: the hasThree property is located in the same
address of B
a.setLiteral(one, true);
a.setLiteral(two, true);
b.setLiteral(three, true);
a.setSameAs(b); //THIS results in the RDF entry for A to
have a line <owl:sameAs rdf:resource:"http://mynamespace.two#B" />
//b.setSameAs(a); //I TRIED using this too, but it
didn't work either
// IN HERE I JUST SET AN ITERATOR TO SHOW ALL OF THE PROPERTIES
OF A
// UNFORTUNATELY, hasThree DOESN'T SHOW UP UNDER THE PROPERTIES
OF A
I would like to ask what am I doing wrong?
Regards,
Daryl