[Pellet-users] Hierarchy of datatypes and enumeration datatypes
Christina Tziviskou
tzivisko at elet.polimi.it
Mon Feb 11 10:38:21 UTC 2008
Hi,
thank you a lot for the valuable answers.
Evren Sirin wrote:
> On 2/8/08 6:15 AM, Christina Tziviskou wrote:
>> Hi,
>>
>> I have two questions about the Pellet API and specifically the
>> methods of the KnowledgeBase and AtermUtils classes.
>>
>> 1. Is it possible to create hierarchy of datatypes in Pellet using
>> the above interfaces?
>>
>
> It is possible to define new user-defined datatypes by extending
> existing datatypes. It is not possible (in a straight-forward way) to
> assert subtype relation between two user-defined datatypes. This
> relation may be inferred based on the definition of datatypes but
> cannot be asserted explicitly. What kind of datatype hierarchy do you
> want to define?
I would like to define three datatypes: WineDescription, WineTaste e
WineColor
and define WineTaste as subClassOf WineDescription
and also WineColor as subClassOf WineDescription.
I also want to express the two hierarchies disjoint and complete.
thank you,
christina
>> 2. I create enumerations with the following code:
>>
>> ATermList enumeration = ATermUtils.makeList( new ATermAppl[] {
>> ATermUtils.makeValue( red ),
>> ATermUtils.makeValue( green ),
>> ATermUtils.makeValue( blue ) } );
>> kb.addEquivalentClass( Color, ATermUtils.makeOr( enumeration ) );
>>
>>
>> Is it possible to create an enumeration datatype instead of an
>> enumeration class?
>>
>
> Yes, you can do it like this:
>
> // create set of literal values
> Set setOfLiterals = new HashSet();
> setOfLiterals.add( ATermUtils.makePlainLiteral( "a" ) );
> setOfLiterals.add( ATermUtils.makePlainLiteral( "b" ) );
> setOfLiterals.add( ATermUtils.makePlainLiteral( "c" ) );
> // create an enumerated datatype out of the list (this does not
> add the datatype)
> Datatype dataRange = kb.getDatatypeReasoner().enumeration(
> setOfLiterals );
> // add the datatype to the KB with a name
> kb.addDatatype( "abc", dataRange );
>
> Cheers,
> Evren
>
>> Thank you in advance,
>> christina
>>
>>
>>
>> _______________________________________________
>> 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