Oh yes! My example showed only what I was able to do... Some datatype properties has a range specified in their definition but others don't, so owl:onDataRange gives this assertion in class restriction.
Rodrigo C. Antonialli ====================================== Rio Claro - SP - Brasil LinkedIn: http://www.linkedin.com/in/rcantonialli Contato: (19) 98136-2347 [email protected] Skype: rc_antonialli On Mon, Feb 24, 2014 at 3:05 PM, Joshua TAYLOR <[email protected]>wrote: > Oh, I'd missed at first that you were working with datatype > properties. You should note, of course, that adding the onDataRange > here doesn't actually add anything for you. If you've already > declared that the range of the property is xsd:string, then the class > expression (p min 1 xsd:string) doesn't say anything that (p min 1) > didn't already, since _every_ object of p already has to be an > xsd:string. > > > On Mon, Feb 24, 2014 at 12:55 PM, Rodrigo Antonialli > <[email protected]> wrote: > > Hi Joshua, > > > > Thanks! > > > > I did this: > > > > DatatypeProperty dataproperty = this.ontmodel.createDatatypeProperty(NS > + > > propname); > > > > Restriction rest = this.ontmodel.createRestriction(dataproperty); > > > > MinCardinalityRestriction minCardRestriction; > > > > minCardRestriction = rest.convertToMinCardinalityRestriction(1); > > > > minCardRestriction.addSubClass(myClass); > > minCardRestriction.addProperty(this.ontmodel.getProperty(" > http://www.w3.org/2002/07/owl#onDataRange"), > > dataproperty.getRange()); > > > > []s > > > > Rodrigo C. Antonialli > > ====================================== > > Rio Claro - SP - Brasil > > LinkedIn: http://www.linkedin.com/in/rcantonialli > > Contato: (19) 98136-2347 > > [email protected] > > Skype: rc_antonialli > > > > > > On Mon, Feb 24, 2014 at 2:12 PM, Joshua TAYLOR <[email protected]> > > wrote: > >> > >> On Mon, Feb 24, 2014 at 9:54 AM, Rodrigo Antonialli > >> <[email protected]> wrote: > >> > Sorry, I know jena does not support OWL2, the intention was to know > some > >> > work in progress about it. I should have asked directly... > >> > > >> > Thanks for your help! I'll try to create the RDF statements! > >> > >> There's an example of creating such restrictions on Stack Overflow, > >> How to add qualified cardinality in JENA [1]. > >> > >> [1] http://stackoverflow.com/q/20562107/1281433 > >> > >> -- > >> Joshua Taylor, http://www.cs.rpi.edu/~tayloj/ > > > > > > > > -- > Joshua Taylor, http://www.cs.rpi.edu/~tayloj/ >
