On Fri, Oct 7, 2011 at 4:27 PM, Ian Dickinson <[email protected]> wrote:
> I think this is one of those cases where the DL worldview and the RDF
> worldview collide. RDF is an edge-labelled directed graph: there are no
> edges without labels. In other words, there are no triples with anonymous
> predicates, so no way of creating a Property object (or ObjectProperty, etc)
> without a URI.
>
> You'll have to generate skolem constants for the names of the inverse(P)
> properties.
Thanks for the quick response! I still have a little bit of confusion, though:
What would be used as skolem constants in this context? I'd though
that this was a situation for blank nodes, and was essentially what,
e.g., createClass() does for class names, i.e., creating a blank node
for the class when the class doesn't have a specific name. But I'm
not sure how to get a blank node reference to use for the property
expression (that I can convert to a property expression when I need
to). After I sent my initial message, I'd tried going along this
route via the following:
OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_DL_MEM );
OntClass c = m.createClass( "C" );
OntClass d = m.createClass( "D" );
OntProperty p = m.createObjectProperty( "p" );
OntProperty invP = m.createOntResource( null ).asObjectProperty();
invP.addInverseOf( p );
c.addSuperClass( m.createSomeValuesFromRestriction( null, invP, d ) );
but this throws an Exception
[java] Exception in thread "main"
com.hp.hpl.jena.ontology.ConversionException: Cannot convert node
-684af14a:132e028a5b2:-7ffc to ObjectProperty
[java] at
com.hp.hpl.jena.ontology.impl.ObjectPropertyImpl$1.wrap(ObjectPropertyImpl.java:70)
[java] at com.hp.hpl.jena.enhanced.EnhNode.convertTo(EnhNode.java:142)
[java] at com.hp.hpl.jena.enhanced.EnhNode.convertTo(EnhNode.java:22)
[java] at
com.hp.hpl.jena.enhanced.Polymorphic.asInternal(Polymorphic.java:54)
[java] at com.hp.hpl.jena.enhanced.EnhNode.as(EnhNode.java:97)
[java] at
com.hp.hpl.jena.ontology.impl.OntResourceImpl.asObjectProperty(OntResourceImpl.java:1062)
Now, for what it's worth, if I write an ontology outside of Jena
containing a class expression like
(inverse(P) some D)
and load the ontology into Jena, Jena will confirm that the class is a
Restriction, that it's a someValuesFromRestriction, but then gives me
the same sort of Exception when I try to getOnProperty(). So I guess
Jena's really not expecting to see blank nodes as properties. So:
1) What kind of entity is supposed to be used as a skolem constant?
2) I'm only constructing this model to eventually be used with a
Pellet reasoner, so would it be OK to add the subclass axiom by
skipping the OntModel altogether and just adding the appropriate RDF
representation of the axiom?
Thanks,
//JT
--
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/