jenabean


A library for persisting java beans to RDF

jenabean uses Jena's flexible RDF/OWL api to persist java beans. It takes an unconventional approach to binding that is driven by the java object model rather than an OWL or RDF schema. jenabean is annotation based and does not place any interface or extension requirements on your java object model. By default jenabean uses typical java bean conventions to derive RDF property URI’s, for example, the java bean property “name” would become RDF property “:name”. jenabean allows for explicit binding between an object property and a particular RDF property. (See Book.java for an example of binding arbitrary bean properties to the Dublin Core schema.)

Code Examples

To get a quick idea of how using jenabean might look see the junit test class. There is also a very simple stripes application that provides an example of using jenabean within an app.

``` package test; import thewebsemantic.Id;

public class KeepItSimple { @Id private String id; private int value; public int getValue() {return value;} public void setValue(int i) {value = i;} public String getId() {return id;} public void setId(String id) {this.id = id;}
} ```

``` @prefix : http://test.bean/ .

http://thewebsemantic.com/javaclass a owl:AnnotationProperty .

http://test.bean/KeepItSimple/kisv1.1 a :KeepItSimple ; :id "kisv1.1"^^xsd:string ; :value "444"^^xsd:int .

:KeepItSimple a rdfs:Class ; http://thewebsemantic.com/javaclass "test.bean.KeepItSimple" .

:id a rdf:Property .

:value a rdf:Property . ```

Project Information

Labels:
RDF javabeans Jena semanticweb Java OWL annotations binding