ある日立ち往生しています。誰か親切に助けてくれますか? SWEET(Semantic Web for Earth and Environmental Ontology)をインポートしたオントロジーをロードしました。私はいくつかの SPARQL クエリを実行しましたが、次のような回答が得られました。(SWEETで確認したhasLowerBoundは、SWEETのデータ型オントロジーです)
どうすればこの問題を解決できますか?
これが私が書いたコードと私が得たエラーです、あなたの助けに感謝します~
public class load {
public static void main(String[] args) throws OWLOntologyCreationException {
// Get hold of an ontology manager
OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
File file = new File("G:/Protege/owlfiles/Before_Gather.owl");
// Load the local copy
OWLOntology loadMODIS = manager.loadOntologyFromOntologyDocument(file);
PelletReasoner reasoner =
PelletReasonerFactory.getInstance().createNonBufferingReasoner( loadMODIS
);
KnowledgeBase kb = reasoner.getKB();
PelletInfGraph graph = new
org.mindswap.pellet.jena.PelletReasoner().bind( kb );
InfModel model = ModelFactory.createInfModel( graph );
String PREFIX = "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-
ns#>" +
"PREFIX owl: <http://www.w3.org/2002/07/owl#>" +
"PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>" +
"PREFIX seaice: <http://www.semanticweb.org/SeaIceOntology#>" +
"PREFIX repr: <http://sweet.jpl.nasa.gov/2.3/reprDataFormat.owl#>" +
"PREFIX realmCryo: <http://sweet.jpl.nasa.gov/2.3/realmCryo.owl#>" +
"PREFIX relaMath: <http://sweet.jpl.nasa.gov/2.3/relaMath.owl#>";
String SELECT = "select ?dataset ";
String WHERE = "where {" +
"?dataset relaMath:hasLowerBound " + "\"0\"^^xsd:integer" +
"}" ;
QueryExecution qe = SparqlDLExecutionFactory.create(QueryFactory.create(PREFIX + SELECT + WHERE), model);
ResultSet rs = qe.execSelect();
ResultSetFormatter.out(System.out,rs);
rs = null; qe.close();
reasoner.dispose();
//OWLReasonerSPARQLEngine sparqlEngine=new OWLReasonerSPARQLEngine(new MinimalPrintingMonitor());
//sparqlEngine.execQuery(str.toString(),dataset);
System.out.println("Loaded ontology: " + loadMODIS);
}
}
スレッド "main" org.mindswap.pellet.exceptions.InternalReasonerException での例外: オブジェクト プロパティ hasLowerBound は、値がリテラルである hasValue 制限と共に使用されます: "0"^^integer at org.mindswap.pellet.tableau.completion.rule .SomeValuesRule.applySomeValuesRule(SomeValuesRule.java:204) at org.mindswap.pellet.tableau.completion.rule.SomeValuesRule.apply(SomeValuesRule.java:64) at org.mindswap.pellet.tableau.completion.rule.AbstractTableauRule.apply (AbstractTableauRule.java:64) org.mindswap.pellet.tableau.completion.SROIQStrategy.complete(SROIQStrategy.java:157) で org.mindswap.pellet.ABox.isConsistent(ABox.java:1423) で org.mindswap. org.mindswap.pellet.KnowledgeBase.consistency(KnowledgeBase.java:1987) で org.mindswap.pellet.KnowledgeBase.isConsistent(KnowledgeBase.java:2061) at org.mindswap.pellet.jena.PelletInfGraph.prepare(PelletInfGraph.java:258) at org.mindswap.pellet.jena.PelletInfGraph.prepare(PelletInfGraph.java:241) at com .clarkparsia.pellet.sparqldl.jena.SparqlDLExecutionFactory.create(SparqlDLExecutionFactory.java:113) at com.clarkparsia.pellet.sparqldl.jena.SparqlDLExecutionFactory.create(SparqlDLExecutionFactory.java:261) at com.clarkparsia.pellet.sparqldl.jena .SparqlDLExecutionFactory.create(SparqlDLExecutionFactory.java:226) at loadMODIS.load.main(load.java:78)create(SparqlDLExecutionFactory.java:113) com.clarkparsia.pellet.sparqldl.jena.SparqlDLExecutionFactory.create(SparqlDLExecutionFactory.java:261) com.clarkparsia.pellet.sparqldl.jena.SparqlDLExecutionFactory.create(SparqlDLExecutionFactory.java:226) loadMODIS.load.main(load.java:78) でcreate(SparqlDLExecutionFactory.java:113) com.clarkparsia.pellet.sparqldl.jena.SparqlDLExecutionFactory.create(SparqlDLExecutionFactory.java:261) com.clarkparsia.pellet.sparqldl.jena.SparqlDLExecutionFactory.create(SparqlDLExecutionFactory.java:226) loadMODIS.load.main(load.java:78) で