我需要一些帮助,我想在我的本体中插入一个实例
$ public static JenaOWLModel owlModel;
public static void main( String[] args ) {
try{
owlModel = ProtegeOWL.createJenaOWLModelFromURI("file:///C:/Project/Krs1.owl");
} catch (Exception e) {
e.printStackTrace();}
RDFSNamedClass personClass = owlModel.getRDFSNamedClass("Concept");
RDFProperty ageProperty = owlModel.getRDFProperty("hasnameactivite");
RDFIndividual individual = personClass.getRDFIndividual(String Book);
individual.setPropertyValue(ageProperty,new Integer(11).toString());
Collection errors = new ArrayList();
owlModel.save(URI.create("file:///C:/Project/Krs1.owl"), FileUtils.langXMLAbbrev, errors);
System.out.println("File saved with " + errors.size() + " errors.");
}
}
结果是
$ Exception in thread "main" java.lang.Error: Unresolved compilation problems:
String cannot be resolved
Syntax error on token "Book", delete this token
at conn.AEssaie2.main(AEssaie2.java:24).
谢谢你的帮助。