[Pellet-Users] user-defined datatypes

Evren Sirin evren at clarkparsia.com
Wed Nov 29 15:07:27 EST 2006


On 11/27/2006 12:06 PM, Dimitris Skoutas wrote:
> Hi,
>
> I am trying to create an ontology containing user-defined datatypes, 
> using the inline syntax of OWL 1.1, and then use Pellet to perform 
> reasoning. Could someone point to me how to create user-defined 
> datatypes programmatically, 
It depends on which API (Jena or OWL-API) you are using. Jena has no 
support for OWL 1.1 so you would just generate the corresponding triples 
in Jena API. You may find OWL_1_1 that I created in 
org.mindswap.pellet.jena useful as it defines the new keywords defined 
in OWL 1.1. Something like the following should do the job:

        OntResource LessThan10 = model.createOntResource( ns + 
"LessThan10");
        LessThan10.addRDFType( OWL_1_1.DataRangeRestriction );
        LessThan10.addProperty( OWL_1_1.onDataRange, 
XSD.nonNegativeInteger);
        LessThan10.addProperty( OWL_1_1.maxExclusive, 10);
       
If you will use the bleeding-edge OWL-API version that supports OWL 1.1 
(which we got from their sourceforge SVN [1]) OWLDataFactory provides 
functions like

public OWLRestrictedDataRange getOWLRestrictedDataRange(OWLDataRange 
dataRange, OWLRestrictedDataRange.Facet facet,
                                                            OWLDataValue 
facetValue)

that let you create these constructs directly. Note that this is not in 
a releases version yet so you either need to build the javadocs yourself 
or browse the code to see which other functions are available.

Hope this helps,
Evren

[1] http://owlapi.svn.sourceforge.net/viewvc/owlapi/owl/branches/

> e.g. something like:
>
> <owl:DataRangeRestriction rdf:about="#LessThan10">
>    <owl:onDataRange 
> rdf:resource="http://www.w3.org/2001/XMLSchema#nonNegativeInteger"/>
>    <owl:maxExclusive>10</owl:maxExclusive>
> </owl:DataRangeRestriction>
>
> Thank you in advance.
>
> Dimitris
> _______________________________________________
> Pellet-Users mailing list
> Pellet-Users at lists.mindswap.org
> http://lists.mindswap.org/mailman/listinfo/pellet-users
>
>   



More information about the Pellet-Users mailing list