How to generate RDFSBeans with RDFReactor
This page describes the procedure to generate RDFREactor classes for an rdfs ontology. This page puts particular emphasis on an ontology that is assembled by a set of separate ontologies (rdfs files) using Protégé.
1. Create a Protege project where all ontologies which are to be handled are bundled together, e.g., see http://dev.nepomuk.semanticdesktop.org/repos/trunk/ontologies/nie/outputunified_nepomuk_ontologies.pprj. The ontologies are "included" into the Protege project using the menu -> Project -> Include Project. Save the resulting Protege project.
2. Copy the Protege project in a separate project using the "save as" command, e.g., see http://dev.nepomuk.semanticdesktop.org/repos/trunk/ontologies/nie/outputunified_nepomuk_ontologies_merged.pprj. In this copy, the merging operation will be applied using the menu -> Project -> Merge Include Projects. Save the resulting Protege project.
3. A single rdfs file is the result of step 2. This file serves as input for RDFReactor.
4. Generate RDFReactor classes by calling CodeGenerator?.generate("C:/projects/NEPOMUKworkspace/org.semanticdesktop.nepomuk.comp.rdfsbeans.generator/data/unified_nepomuk_ontologies_merged.rdfs", "src_generated", "org.semanticdesktop.nepomuk.comp.rdfsbeans.rdfreactor",Reasoning.rdfs, true, true); This can be found in the java source of http://dev.nepomuk.semanticdesktop.org/repos/trunk/java/org.semanticdesktop.nepomuk.comp.rdfsbeans.generator/src/org/semanticdesktop/nepomuk/comp/rdfsbeans/generator/RDFReactorGenerator.java
5. Find the newly generated beans in the folder "src_generated". Copy these beans to http://dev.nepomuk.semanticdesktop.org/repos/trunk/java/org.semanticdesktop.nepomuk.comp.rdfsbeans/src.
When some of the ontologies are changed externaly, steps 2 and following have to be done for maintaining up do date RDFSBeans
issues
there are some issues remaining
- Manually add nao properties. E.g., from Tmo_NAODummy.java to Thing.java
- Rdfs label - the label is still upercase, this has to be changed to lowercase (in Thing.java)
- Add the following methods to Thing.java, these allow the handling of an label where we assume that there is only one
- public java.lang.String getLabel() {return (java.lang.String) Base.get(this.model, this.getResource(), RDFS_LABEL, java.lang.String.class);}
- public void setLabel(String label){Base.set(this.model, this.getResource(), RDFS_LABEL, label);}
