geeknet
geeknet

Reputation: 77

Declaration of object property using java OWL API

It's easy to create a declaration of OWL class i.e.

Declaration(Class(:ComponentIT))

using java OWL API v5:

OWLClass A = df.getOWLClass(IOR + "#ComponentIT");
OWLDeclarationAxiom da = df.getOWLDeclarationAxiom(A);

The question is how to create a declaration of object property (an axiom for inserting into the OWLOntology object) using OWL API, i.e.

Declaration(ObjectProperty(:hasValue))

Upvotes: 1

Views: 390

Answers (1)

geeknet
geeknet

Reputation: 77

The getOWLDeclarationAxiom() method works for the properties the same way as for the classes, i.e.

OWLObjectProperty hasValue = df.getOWLObjectProperty(IOR + "#hasValue");
OWLDeclarationAxiom d_hasValue = df.getOWLDeclarationAxiom(hasValue);

Upvotes: 1

Related Questions