简体   繁体   English

如何使用OWL-API创建OWL 2批注

[英]How can one create an OWL 2 annotation with the OWL-API

I want to create the following 我要创建以下内容

  s p xlt .
  _:x rdf:type owl:Axiom .
  _:x owl:annotatedSource s .
  _:x owl:annotatedProperty p .
  _:x owl:annotatedTarget xlt 

I saw somehwere the code for doing so in Jena, I would like to know if there is a way to do using the OWL-API? 我在耶拿(Jena)看到了执行此操作的代码,我想知道是否可以使用OWL-API? The statement does not have to exist in the actual ontology. 该语句在实际的本体中不必存在。 It is meant more to represent provenance. 它意味着更多地代表出处。

An annotated axiom in an ontology is still an axiom in the ontology. 本体中带注释的公理仍然是本体中的公理。 If you really want something for provenance, you're going to have to do something a bit different, I think. 我认为,如果您确实想要某种出处,则必须做一些不同的事情。

In your case, though, it looks like you just want an ObjectPropertyAssertionAxiom that has some annotations. 但是,就您而言,您似乎只需要具有一些注释的ObjectPropertyAssertionAxiom。 You'll just want to use the OWLDataFactory method getOWLObjectPropertyAssertionAxiom which takes a property, individual, object, and a set of OWLAnnotations . 您只需要使用OWLDataFactory方法getOWLObjectPropertyAssertionAxiom ,该方法接受一个属性,一个对象,一个对象和一组OWLAnnotations

The OWLAPI documentation also includes a large number of examples, including one that shows how to create and read annotations , which may or may not be instructive in your case. OWLAPI文档还包含大量示例,其中包括一个显示如何创建和读取注释的示例,这些注释可能对您有帮助,也可能没有指导意义。

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

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