-
一些名词使用说明
普通类 -
- 支持
- 批判
- 提问
- 解释
- 补充
- 删除
-
-
1.名词说明
"Cls" is a class; 即Cls是class类
"Slot" is a property; Slot是属性
"Instance" is an instance (or individual); Instance是实例
a "Frame" can be one of the above. Frame是上面的如何一种。-
2.api新建类与属性
protege owl api可以新建rdf或者是owl的类和属性,其中类可以命名或者匿名。
如,为人建立一个类,人的属性有出生年月、性别等
编码可以如下:
-
3.protege owl api 读取本体方式
(1)FileRead方式:
BufferedReader br = new BufferedReader(new InputStreamReader(
new FileInputStream("D:\\learner.owl"), "UTF-8"));
OWLModel domainModel = ProtegeOWL.createJenaOWLModelFromReader(br);
(2)InputStream方式:
(3)URI方式:
-
4.删除类
OWLModel domainModel;
try {
BufferedReader br = new BufferedReader(new InputStreamReader(
new FileInputStream(fileUrl), "UTF-8"));
domainModel = ProtegeOWL.createJenaOWLModelFromReader(br);
RDFSNamedClass rdfsNamedClass = domainModel
.getRDFSNamedClass(className);
domainModel.deleteCls(rdfsNamedClass);
domainClassService.deleteClassByClassName(className);
FileOutputStream outFile = new FileOutputStream(fileUrl);
Writer out = new OutputStreamWriter(outFile, "UTF-8");
OWLModelWriter omw = new OWLModelWriter(domainModel, domainModel
.getTripleStoreModel().getActiveTripleStore(), out);
omw.write();
out.close();
} catch (Exception e) {
e.printStackTrace();
}
-
-
- 标签:
- 属性
- 一种
- instanceisaninstance
- slotisaproperty
- slot
- class
- 使用说明
- 默认
-
学习元评论 (0条)
聪明如你,不妨在这 发表你的看法与心得 ~