Currently, the ontology only has two classes which are mutually distinct, two 
ObjectProperties, and two Individuals (of course, since they're ontologies, 
that pulls in all the OWL definitions). I've tried to duplicate this in a test 
case, but haven't succeeded in doing so.

-----Original Message-----
From: Dave Reynolds [mailto:[email protected]] 
Sent: Monday, January 20, 2014 10:59 AM
To: [email protected]
Subject: Re: Weird exception

On 20/01/14 15:40, Ed Swing wrote:
> What would the following exception be caused by?
>          Dataset dataset = TDBFactory.createDataset(directory);
>          dataset.begin(ReadWrite.WRITE);
>          Model m =dataset.getNamedModel("metadata");
>         OntModel model =
>              
> ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM_RULE_INF,
>                  m);
>         for (Iterator<Individual> indIter = model.listIndividuals(); indIter
>              .hasNext();) {
>              Individual ind = indIter.next();
>              System.out.println("INX: " + ind.getLocalName());
>          }
>
>
> Exception in thread "main" com.hp.hpl.jena.ontology.ConversionException: 
> Cannot convert node http://www.w3.org/2001/XMLSchema#dateTime to Individual
>         at 
> com.hp.hpl.jena.ontology.impl.IndividualImpl$1.wrap(IndividualImpl.java:61)
>         at 
> com.hp.hpl.jena.enhanced.Personality.newInstance(Personality.java:93)
>         at com.hp.hpl.jena.enhanced.EnhGraph.getNodeAs(EnhGraph.java:137)
>         at 
> com.hp.hpl.jena.ontology.impl.OntModelImpl$SubjectNodeAs.map1(OntModelImpl.java:3112)
>         at 
> com.hp.hpl.jena.ontology.impl.OntModelImpl$SubjectNodeAs.map1(OntModelImpl.java:1)
>         at 
> com.hp.hpl.jena.util.iterator.Map1Iterator.next(Map1Iterator.java:45)
>         at 
> com.hp.hpl.jena.util.iterator.WrappedIterator.next(WrappedIterator.java:94)
>         at 
> com.hp.hpl.jena.util.iterator.FilterIterator.hasNext(FilterIterator.java:55)
>         at tdb.TdbReadTest.main(TdbReadTest.java:60)
>
>
> This is in a step where I am simply trying to list the individuals within an 
> ontology after I retrieve it from TDB. I've created two individuals, linked 
> them with ObjectProperties, and wrote the TDB store. Neither of the 
> statements has anything to do with dateTime. The statements do appear when I 
> call listStatements(), and the ontology is valid and clean.
>
> Any suggestions where to look for what causes this would be appreciated.

At a guess then the RULE inference you have specified is adding concepts like 
the xsd data types to the model and this is confusing the OntAPI somehow (and 
OWL/full v.s. OWL/DL view of the world probably). Don't know why this appears 
here and hasn't been mentioned by others.

Suggestions:

    o If you don't need inference then just switch to OntModelSpec.OWL_MEM

    o If you do then try OWL_MEM_MICRO_RULE_INF or if you really really need it 
OWL_MEM_RULE_INF

    o Set the OntModel to non-strict

Dave

>
> Edward Swing
> Applied Research Technologist
> Vision Systems + Technology, Inc., a SAS Company
> 6021 University Boulevard * Suite 360 * Ellicott City * Maryland * 
> 21043
> Tel: 410.418.5555 Ext: 919 * Fax: 410.418.8580
> Email: [email protected]<mailto:[email protected]>
> Web: http://www.vsticorp.com<http://www.vsticorp.com/>
>
>



Reply via email to