1

我需要一些帮助,我想在我的本体中插入一个实例

$ 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).

谢谢你的帮助。

4

1 回答 1

0

personClass.getRDFIndividual(String Book);

非法Java。使用 IDE(例如 Eclipse)。

于 2012-09-25T09:10:33.460 回答