jena - Pellet reasoning over XML Literals -
i using pellet reasoner jena. inserted data tdb store. have schema ontology in file , jena rules well. layered generic rule reasoner , pellet. however, getting inconsistent ontology error due literal datatypes, yet inserted data has same datatype schema definition. data:
<rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:resource="http://www.cs.kaist.ac.kr/medication/resource#" xmlns:time="http://www.w3.org/2006/time#" xmlns:medication="http://www.cs.kaist.ac.kr/medication/ontology#" xmlns:xsd="http://www.w3.org/2001/xmlschema#" > ....... <rdf:description rdf:about="http://www.cs.kaist.ac.kr/medication/resource#timedesc300"> <rdf:type rdf:resource="http://www.w3.org/2006/time#timedescription"/> <time:hour rdf:datatype="http://www.w3.org/2001/xmlschema#integer">3</time:hour> <time:year rdf:datatype="http://www.w3.org/2001/xmlschema#integer">2014</time:year> <time:month rdf:datatype="http://www.w3.org/2001/xmlschema#integer">8</time:month> <time:day rdf:datatype="http://www.w3.org/2001/xmlschema#integer">26</time:day> <time:minute rdf:datatype="http://www.w3.org/2001/xmlschema#integer">0</time:minute> <time:second rdf:datatype="http://www.w3.org/2001/xmlschema#decimal">0</time:second> </rdf:description> .......
the reasoner:
....... tdbconnection connection = new tdbconnection(); connection.getdataset().begin(readwrite.write); model datatdb = connection.getdataset().getdefaultmodel(); /*ontmodel ontology = modelfactory.createontologymodel(); ontology.read("data//medtimeonto.owl");*/ model ontmedical = filemanager.get().loadmodel("data//medtimeonto.owl"); ontmedical.add(filemanager.get().loadmodel("data//myowntimefinal.owl")); ontmodel ontology = modelfactory.createontologymodel(pelletreasonerfactory.the_spec, ontmedical ); //reasoner owlreasoner = (reasoner) reasonerregistry.getowlreasoner(); //infmodel owlinfmodel = modelfactory.createinfmodel(owlreasoner, ontology, datatdb); list <rule> rules= rule.rulesfromurl("data//testrule.rules"); genericrulereasoner rulereasoner = new genericrulereasoner(rules); infmodel ruleinfmodel = modelfactory.createinfmodel(rulereasoner, ontology,datatdb); reasoner pelletreasoner = pelletreasonerfactory.theinstance().create(); infmodel pelletinfmodel = modelfactory.createinfmodel(pelletreasoner, ruleinfmodel); extendediterator<statement> stmts = pelletinfmodel.liststatements(). filterdrop( new filter<statement>() { public boolean accept(statement o) { return ontology.add(datatdb).contains( o ); } }); model deductions = modelfactory.createdefaultmodel().add( new stmtiteratorimpl( stmts )); deductions.write( system.out);
the error getting:
............ realizing finished in 00:00 exception in thread "main" org.mindswap.pellet.exceptions.inconsistentontologyexception: cannot reasoning inconsistent ontologies! reason inconsistency: literal value "2014"^^integer not belong datatype integer @ org.mindswap.pellet.knowledgebase.ensureconsistency(knowledgebase.java:2076) @ org.mindswap.pellet.knowledgebase.issameas(knowledgebase.java:2973) @ rg.mindswap.pellet.jena.graph.query.graphqueryhandler$94.contains (graphqueryhandler.java:1457) @ org.mindswap.pellet.jena.graph.query.graphqueryhandler.containstriple (graphqueryhandler.java:1554) @ org.mindswap.pellet.jena.pelletinfgraph.containstriple(pelletinfgraph.java:472) @ org.mindswap.pellet.jena.pelletinfgraph.graphbasecontains(pelletinfgraph.java:319) @ com.hp.hpl.jena.graph.impl.graphbase.contains(graphbase.java:301) @ com.hp.hpl.jena.rdf.model.impl.modelcom.contains(modelcom.java:1207) @ com.kaist.medserver.myreasoner$1.accept(myreasoner.java:63) @ com.kaist.medserver.myreasoner$1.accept(myreasoner.java:1) @ com.hp.hpl.jena.util.iterator.filterdropiterator.accept(filterdropiterator.java:33) @ com.hp.hpl.jena.util.iterator.filteriterator.hasnext(filteriterator.java:55) @ com.hp.hpl.jena.util.iterator.wrappediterator.hasnext(wrappediterator.java:90) @ com.hp.hpl.jena.util.iterator.map1iterator.hasnext(map1iterator.java:48) @ com.hp.hpl.jena.util.iteratorcollection.iteratortolist(iteratorcollection.java:63) @ com.hp.hpl.jena.graph.graphutil.add(graphutil.java:165) @ com.hp.hpl.jena.rdf.model.impl.modelcom.add(modelcom.java:197) @ com.kaist.medserver.myreasoner.main(myreasoner.java:66)
time:year xsd:gyear? not xsd:intger (or derived type).
and time:month gmonth, time:day gday
Comments
Post a Comment