如何在netbeans中使用OWL API将其连接到proteje和SWRL以读取OWL文件?

时间:2017-04-06 18:47:14

标签: netbeans owl protege swrl

我可以在我的netbeans库中添加OWL API,现在我想与proteje建立连接并能够在本地计算机中读取owl文件。 你有一些与之相关的源代码示例吗?

THX

1 个答案:

答案 0 :(得分:0)

一个简单的例子是这样的:

public class Book implements BookService {

private String name;
private String rating;
private boolean isAvailable;

private final boolean DEFAULT_AVAILABILITY = true;
private final String DEFAULT_NAME = "default_name";

public Book(String name, String rating, boolean isAvailable) {
    this.name = name;
    this.rating = rating;
    this.isAvailable = isAvailable;
}

public Book() {    
    this.name = DEFAULT_NAME;
    this.rating = DEFAULT_RATING;
    this.isAvailable = DEFAULT_AVAILABILITY;
}

public boolean validateAvailability(){
    return isAvailable;
}
}

public interface BookService{

public static final String ONE_STAR = "*";
public static final String TWO_STARS = "**";
public static final String THREE_STARS = "***";
public static final String FOUR_STARS = "****";
public static final String FIVE_STARS = "*****";
public static final String DEFAULT_RATING = ONE_STAR;
public abstract boolean validateAvailability();  

}

有关更多示例,请查看OWLAPI wiki