On Sat, Oct 8, 2011 at 10:27 AM, Dave Reynolds <[email protected]> wrote: > On Fri, 2011-10-07 at 18:00 -0400, Joshua TAYLOR wrote: > > I've not followed this entire thread but the following jumped out at > me ... > >> At any rate, what I think I'm supposed to take away from this is that >> RDF triples have to have URIs as their predicate, but Restrictions >> only have to have rdfs:Properties as their owl:onProperty, and there >> can be rdfs:Properties that aren't URIs (e.g., blank nodes). However, >> the only rdfs:Properties that can be used as *Jena* Properties are >> URIs. Does this sound right? > > Not quite. It's more complicated than that. > > OWL DL (and its many variants) impose a lot more syntactic constraints > than simply the rdfs:range of owl:onProperty implies. In particular, > there are a lot of restrictions on where you can use bNodes.
Ah, good point. I spoke too loosely indeed. A better version would be: while the object of owl:onProperty is typically a URIreference, but in certain circumstances, viz., describing an inverse object property, owl:onProperty may have a blank node as its object. > So in OWL 2 DL there is a syntactic allowance for declaring anonymous > inverses but it's a special case. You can't just go sticking arbitrary > bNodes anywhere you see a rdf:Property and expect it to still be DL. Right. > The Jena OntAPI currently only supports OWL 1. If it gets extended to > OWL 2 then it will need some way to handle anonymous inverses. > > In the meantime you can create anonymous inverses manually for use in > restrictions: > > ont.setStrictMode(false); > ObjectProperty p = ont.createObjectProperty(NS + "p"); > ObjectProperty ip = > ont.createResource() > .addProperty(OWL.inverseOf, p) > .as(ObjectProperty.class); Many thanks for this! This is *far* nicer than the RDF-based way I did this. Now, the question still remains, although the Jena OntModel is only for OWL 1, if I create an object property in this manner (where the underlying RDF describes OWL 2 constructs), and use a Pellet Reasoner, will the Pellet Reasoner see the OWL 2 constructs as it ought to? My guess is "yes" (based on the assumption that Pellet gets to see all the underlying triples and knows how to interpret the OWL constructs therein), but I'll find out for sure soon enough through experimentation. Thanks! //JT -- Joshua Taylor, http://www.cs.rpi.edu/~tayloj/
