简体   繁体   中英

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? 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. You'll just want to use the OWLDataFactory method getOWLObjectPropertyAssertionAxiom which takes a property, individual, object, and a set of 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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