简体   繁体   English

为什么我不能创建一个本体?

[英]Why I cant create an ontology?

I am currently getting started with OWL. 我目前正开始使用OWL。 I believe that I have setted up the correct .jar for the OWL API. 我相信我已经为OWL API设置了正确的.jar。 However, when I compile the code I get an error on the line: 但是,当我编译代码时,在行上出现错误:

OWLOntologyManager manager = OWLManager.createOWLOntologyManager();

The error says : 错误说:

cannot access com.google.inject.Provider 
class file for com.google.inject.Provider not found

Any ideas on what might be causing the issue? 关于什么可能导致问题的任何想法?

If you use pom, be sure you use correct dependency as is written here . 如果使用pom,请确保按照此处的说明使用正确的依赖关系。

<dependency>
    <groupId>net.sourceforge.owlapi</groupId>
    <artifactId>owlapi-distribution</artifactId>
    <version>5.1.0</version>
</dependency>

If you use jar file, as you exactly wrote, so be sure, you added it correct as is written here 如果您使用的是jar文件(如您确切编写的那样),那么请确保您按此处编写的方式正确添加了它

Afterwards, be sure, you imported the correct package in your Class. 之后,请确保您在类中导入了正确的包。 And also, be sure you downloaded all you need, like that 而且,请确保您下载的所有需要,就像

For start line in your question, you need that imports 对于您问题中的开始线,您需要导入

import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.model.OWLOntologyManager;

And better, try to use maven as was written here 更好的是,尝试使用此处编写的maven

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM