我有一个名为 Modelling.owl 的 OWL 文件,它是使用 Protege 4.2 创建的。但是后来我必须通过使用 Jena 注册一些新的 Individual 和它的属性来修改它。 例如我有类(class)模型,我必须为这个类(class)添加个人。任何人都知道如何,如果您能提供一些示例代码,那就太好了。我试图寻找教程,但不幸的是我没有找到全面的教程。
谢谢
最佳答案
JENA 教程 - http://jena.apache.org/documentation/ontology/index.html
// create the reasoning model using the base
OntModel inf = ModelFactory.createOntologyModel( OWL_MEM_MICRO_RULE_INF, base );
// create a dummy paper for this example
OntClass paper = base.getOntClass( NS + "Paper" );
Individual p1 = base.createIndividual( NS + "paper1", paper );
这是一个更大解释的摘录(大约一半)。
关于jena - 使用 Jena 在 owl 文件中添加个人,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14505131/