[Pellet-users] addInverseProperty() exception
Evren Sirin
evren at clarkparsia.com
Thu Apr 10 16:18:03 UTC 2008
You need to stick with KnowledgeBase class and use the functions
provided by it. If you simply do something like this
KnowledgeBase kb = new KnowledgeBase();
ATermAppl p1 = ATermUtils.makeTermAppl( "p1" );
ATermAppl p2 = ATermUtils.makeTermAppl( "p2" );
kb.addObjectProperty( p1 );
kb.addObjectProperty( p2 );
kb.addInverseProperty( p1, p2 );
everything should work fine. Note that, calling addObjectProperty does
more than setting Role.setType function you use (which is not supposed
to be public anyway).
Cheers,
Evren
On 4/7/08 2:59 PM, Tiziano Furlan wrote:
> Here is the code I'm using:
>
> kb.addProperty(ATermUtils.makeTermAppl(pName.toString()));
> Role r = kb.getRBox().getRole(ATermUtils.makeTermAppl(pName.toString()));
> r.setType(Role.OBJECT);
>
> done for both properties. After that I search for p1 and p2 ciclying
> on kb.getProperties() and then
>
> kb.addInverseProperty(p1, p2);
>
> that gives the exception.
>
> Evren Sirin ha scritto:
>> Can you provide a complete example that shows the problem? Looking at
>> the info provided all I can guess is one of the properties is
>> declared as a datatype propertyso it cannot have an inverse causing
>> the problem.
>>
>> Cheers,
>> Evren
>>
>> On 4/3/08 9:57 AM, Tiziano Furlan wrote:
>>> Hi,
>>>
>>> I'm receiving a NullPointerException when using the KnowledgeBase
>>> method addInverseProperty(p1, p2) on RBox.java at line 292.
>>>
>>> Both the properties I'm passing to the addInverseProperty() exists,
>>> but it seems that the roleS.getInverse() method on RBox.java returns
>>> null.
>>>
>>> I'm using the 1.5.1 release.
>>>
>>> Any idea on how to solve this problem?
>>>
>>> Thanks
>>>
>>> Tiziano
>>> _______________________________________________
>>> Pellet-users mailing list
>>> Pellet-users at lists.owldl.com
>>> http://lists.owldl.com/mailman/listinfo/pellet-users
>>> _______________________________________________
>>>
>>> Sponsored by Clark & Parsia, LLC http://clarkparsia.com/
>>>
>>
>>
>
More information about the Pellet-users
mailing list