我試圖用Sparql更新1.1將個人插入到我的文件貓頭鷹中,但它不起作用。如果有人有一個例子,請不要猶豫,給我一個答案。插入一個Induvidual到file.owl
public static void main(String[] args) {
// TODO Auto-generated method stub
String ont="http://localhost:8080/webdav/elearning";
OntModel model=ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC);
model.read(ont+".owl");
String requete="PREFIX table: <http://www.owl-ontologies.com/Ontology1239120737.owl#>\r\n" +
"INSERT DATA { table:etud1 :APourNom 'Saleh' ." +
" table:etud1 :APourLogin 'saleh' ." +
" table:etud1 :APourPWD 'saleh' . }";
GraphStore graphstore=GraphStoreFactory.create();
graphstore.setDefaultGraph(model.getGraph());
UpdateRequest updaterequest=UpdateFactory.create(requete);
updaterequest.exec(graphstore);
System.out.println("OK");
}
當我運行我的程序,我得到一個消息,告訴我,一切正常,但是當我打開我的本體,我沒有找到插入的元素。請幫我解決這個問題。