[Pellet-users] datatype and object properties

Christina Tziviskou tzivisko at elet.polimi.it
Tue May 27 15:52:00 UTC 2008


hi,

i wanna create a data property having a user-defined datatype as type.
I'm using the Pellet API:

// Creation of the data property
kb.addDatatypeProperty(ATermUtils.makeTermAppl(datatypeProperty));

// Creation of the datatype
kb.addDatatype("http://schema.omg.org/spec/UML/2.0/uml.xml#String",
XSDString.instance);

// Creation of the domain class
kb.addClass(domainClass);

// Retrieval of the datatype
rangeDatatype = kb.getDatatypeReasoner().getDatatype((ATermAppl)
ATermUtils.term("http://schema.omg.org/spec/UML/2.0/uml.xml#String"));

// Creation of its type
kb.addEquivalentClass(domainClass, ATermUtils.makeSomeValues(
datatypeProperty, (ATermAppl) rangeDatatype.getName()));

Is this the right way?
Because later, I cannot retrieve the property of a given type (datatype).

thanks a lot,
christina



More information about the Pellet-users mailing list