如何使用对齐API创建对齐对象 [英] How to create Alignment Object using alignment API
本文介绍了如何使用对齐API创建对齐对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个本地alignment.rdf
文件,并使用对齐API库此处我要创建Alignment
对象并将其转换为.owl文件.
I have a local alignment.rdf
file and using alignment API library here I want to create Alignment
object and convert it to .owl file.
我的代码在这里:
AlignmentParser aparser = new AlignmentParser(0);
Alignment result = aparser.parse( new File( "Ontologies/alcomo-alignment.rdf" ).toURI() );
File merged1 = new File( "Ontologies/final_alignment.owl");
PrintWriter writer1 = new PrintWriter ( new FileWriter( merged1, false ), true );
AlignmentVisitor renderer1 = new OWLAxiomsRendererVisitor(writer1);
result.render(renderer1);
writer1.flush();
writer1.close();
但是我遇到这个错误:
OWLAxiomsRenderer: cannot render simple alignment. Need an ObjectAlignment
推荐答案
替换:
result.render(renderer1);
作者
ObjectAlignment oresult = ObjectAlignment.toObjectAlignment(result);
oresult.render(renderer1);
讨论于: http://alignapi.gforge.inria.fr/builtin.html
请注意,为此,初始文件中本体的URI必须是可取消引用的.
Note that for this purpose, the URI of the ontologies in the initial file must be dereferenceable.
这篇关于如何使用对齐API创建对齐对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文