Search Mailing List Archives
[protege-owl] Coding Practices for Factory Methods and Classes for creating OWL Projects
john at globalholdings.org
Sun Mar 22 23:29:15 PDT 2009
I have written code to construct an OWL Model from scratch in Java
against an existing Protege OWL Project with a database back-end
connecting to a Protege RMI server hosting the project.
Right now it is an inelegant class called BuildOntology.java that, in
order, creates the OWL Classes for Objects and Properties.
I was comparing the approach I took for the sake of expediency and
compared it to the Factory Class and Individual Classes auto-generated
using the Protege Java Code Generator.
I am looking to solicit feedback on coding practices for Creating OWL
Projects and respective Classes (Not Individuals).
Would it make sense to:
1) add createClass() methods to the Factory (and Associated Individual
2) to create a separate Factory and Classes for the creation of OWL
Right now, to create a new OWL Class, I use
OWLNamedIndividual myClass = owlModel.CreateOWLNamedClass("MyClass");
The Protege Generated Java Classes create OWLIndividual based Objects.
My Code has create, load and delete methods.
The create method has three steps:
1) Generate OWL Classes
2) Generate OWL Properties (Annotations, Data, Object Relationships)
3) Configure / Associate Classes and Properties (e.g. set Parents,
inverse, range, domain, values, etc. as required)
Thanks in advance
P.S. If any one is curious as to why I am doing this, it is because I
need to import data from an external data-set, and need to auto-
generate the Classes and Individuals as appropriate to map this
More information about the protege-owl