<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Cyberborean Chronicles &#187; Java</title>
	<atom:link href="http://blog.cyberborean.org/tag/java/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.cyberborean.org</link>
	<description>by Alex Alishevskikh</description>
	<lastBuildDate>Wed, 18 Jan 2012 07:52:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>RDFBeans 2.0</title>
		<link>http://blog.cyberborean.org/2011/04/07/rdfbeans-2-0</link>
		<comments>http://blog.cyberborean.org/2011/04/07/rdfbeans-2-0#comments</comments>
		<pubDate>Thu, 07 Apr 2011 05:46:56 +0000</pubDate>
		<dc:creator>Alex Alishevskikh</dc:creator>
				<category><![CDATA[Howtos]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[RDF]]></category>
		<category><![CDATA[RDFBeans]]></category>
		<category><![CDATA[Semantic Web]]></category>

		<guid isPermaLink="false">http://blog.cyberborean.org/?p=695</guid>
		<description><![CDATA[The second edition of RDFBeans Java-to-RDF databinding framework is finally out. In 2.0 version the library underwent major refactoring to clean and enhance the API and provide new databinding techniques. RDFBeans is an open-source object-RDF databinding and persistence library for the Semantic Web development with Java language. It provides a framework for mapping an object-oriented [...]]]></description>
			<content:encoded><![CDATA[<p>The second edition of <a href="http://rdfbeans.sourceforge.net">RDFBeans</a> Java-to-RDF databinding framework is finally out. In 2.0 version the library underwent major refactoring to clean and enhance the API and provide new databinding techniques.</p>
<div class="excerpt fullwidth">
RDFBeans is an open-source object-RDF databinding and persistence library for the Semantic Web development with Java language. It provides a framework for mapping an object-oriented domain model to RDF resource descriptions. </p>
<p>For more information, see:</p>
<ul>
<li><a href="http://rdfbeans.sf.net">The project web-site</a></li>
<li><a href="http://rdfbeans.sourceforge.net/apidocs/index.html">Javadocs</a></li>
<li><a href="http://rdfbeans.sourceforge.net/download.html">How to get the sourcecode or configure Maven dependency</a></li>
</ul>
</div>
<p><span id="more-695"></span></p>
<h2>RDFBean interfaces and dynamic proxying</h2>
<p>Along with <a href="http://rdfbeans.sourceforge.net/usage.html#Working_with_RDFBean_classes">traditional JavaBean-like persisting technique</a> using RDFBean classes, the version 2.0 introduces new approach to object-RDF mapping: <a href="http://rdfbeans.sourceforge.net/usage.html#Working_with_RDFBean_interfaces">RDFBean interfaces</a>.</p>
<p>It works simply: you define an interface of your domain model object and annotate it just like an RDFBean class:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">@RDFNamespaces<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;foaf = http://xmlns.com/foaf/0.1/&quot;</span><span style="color: #009900;">&#41;</span>
@RDFBean<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;foaf:Person&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">interface</span> IPerson <span style="color: #009900;">&#123;</span>
&nbsp;
    @RDFSubject
    <span style="color: #003399;">String</span> getId<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    @RDF<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;foaf:name&quot;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #003399;">String</span> getName<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">void</span> setName<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> name<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    @RDF<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;foaf:mbox&quot;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #003399;">String</span> getEmail<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">void</span> setEmail<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> email<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Then you instantiate the <code>RDFBeanManager</code> (was <code>RDFBinding</code> in RDFBeans 1.x) upon an RDF2Go Model and create a <em>dynamic proxy object</em> with your interface:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">ModelFactory modelFactory <span style="color: #339933;">=</span> RDF2Go.<span style="color: #006633;">getModelFactory</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
Model model <span style="color: #339933;">=</span> modelFactory.<span style="color: #006633;">createModel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
model.<span style="color: #006633;">open</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>        
RDFBeanManager manager <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> RDFBeanManager<span style="color: #009900;">&#40;</span>model<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
IPerson person <span style="color: #339933;">=</span> manager.<span style="color: #006633;">create</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://example.com/persons/jdoe&quot;</span>, IPerson.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>The methods of this proxy object are directed immediately to the underlying RDF triples, so that</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">person.<span style="color: #006633;">setName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;John Doe&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
person.<span style="color: #006633;">setEmail</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;john@example.com&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>will cause adding the statements to the model:</p>
<pre>
&lt;http://example.com/persons/jdoe&gt; a &lt;http://xmlns.com/foaf/0.1/Person&gt; ;
	&lt;http://xmlns.com/foaf/0.1/name&gt; "John Doe" ;
	&lt;http://xmlns.com/foaf/0.1/mbox&gt; "john@example.com" ;
</pre>
<p>Similarly, the getter methods will return values retrieved directly from these statements.</p>
<h2>RDFBean annotations</h2>
<p>The <a href="http://rdfbeans.sourceforge.net/rdfbean.html">annotations scheme</a> has changed, so the old classes will be incompatible with RDFBeans 2.0. As you can see in the example above, <code>@RDF</code> annotation is now applied to the getter methods but not to the field declaration like in the previous versions.</p>
<p>You also can notice new annotation, <code>@RDFNamespaces</code>, which defines a list of URI prefixes to be used in other RDFBean annotations declared in a given class or interface. This includes class and property URIs, as well as RDFBean identifiers:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">@RDFNamespaces<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> 
	<span style="color: #0000ff;">&quot;foaf = http://xmlns.com/foaf/0.1/&quot;</span>,
	<span style="color: #0000ff;">&quot;persons = http://example.com/persons/&quot;</span> 
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
@RDFBean<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;foaf:Person&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">interface</span> IPerson <span style="color: #009900;">&#123;</span>
&nbsp;
	@RDFSubject<span style="color: #009900;">&#40;</span>prefix <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;persons:&quot;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #003399;">String</span> getId<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
...</pre></div></div>

<p>Annotations are now inherited from superclasses and interfaces that makes the RDFBeans markup compatible with complex domain-specific object models. See how the <code>Thing</code>, <code>Agent</code> and <code>Person</code> classes of the <a href="http://rdfbeans.svn.sourceforge.net/viewvc/rdfbeans/tags/2.0/src/test/java/com/viceversatech/rdfbeans/test/foafexample/entities/">FOAF example</a> are organized to mimic the <code>owl:Thing → foaf:Agent → foaf:Person</code> subclassing in RDF-Schema.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cyberborean.org/2011/04/07/rdfbeans-2-0/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RDFBeans: Now on Sourceforge</title>
		<link>http://blog.cyberborean.org/2009/08/04/rdfbeans-now-on-sourceforge</link>
		<comments>http://blog.cyberborean.org/2009/08/04/rdfbeans-now-on-sourceforge#comments</comments>
		<pubDate>Tue, 04 Aug 2009 10:44:07 +0000</pubDate>
		<dc:creator>Alex Alishevskikh</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[RDF]]></category>
		<category><![CDATA[RDFBeans]]></category>
		<category><![CDATA[Semantic Web]]></category>

		<guid isPermaLink="false">http://blog.cyberborean.org/?p=471</guid>
		<description><![CDATA[RDFBeans framework (see &#8220;Simple RDF data binding&#8220;) is a Sourceforge project now: http://rdfbeans.sourceforge.net]]></description>
			<content:encoded><![CDATA[<p>RDFBeans framework (see &#8220;<a rel="bookmark" href="../2009/02/06/simple-rdf-data-binding">Simple RDF data binding</a>&#8220;) is a Sourceforge project now:</p>
<p class="hand"><a href="http://rdfbeans.sourceforge.net">http://rdfbeans.sourceforge.net</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cyberborean.org/2009/08/04/rdfbeans-now-on-sourceforge/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple RDF data binding</title>
		<link>http://blog.cyberborean.org/2009/02/06/simple-rdf-data-binding</link>
		<comments>http://blog.cyberborean.org/2009/02/06/simple-rdf-data-binding#comments</comments>
		<pubDate>Fri, 06 Feb 2009 19:52:45 +0000</pubDate>
		<dc:creator>Alex Alishevskikh</dc:creator>
				<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[RDF]]></category>
		<category><![CDATA[RDFBeans]]></category>
		<category><![CDATA[Semantic Web]]></category>

		<guid isPermaLink="false">http://blog.cyberborean.org/?p=315</guid>
		<description><![CDATA[A large part of SW development is representing the information as RDF for persistence and interoperability. It&#8217;s usually done with lots of the glue code to map the programming object model to RDF triples and vice versa. Update: RDFBeans is an open-source object-RDF databinding and persistence library for the Semantic Web development with Java language. [...]]]></description>
			<content:encoded><![CDATA[<p>A large part of SW development is representing the information as RDF for persistence and interoperability. It&#8217;s usually done with lots of the glue code to map the programming object model to RDF triples and vice versa.</p>
<p><span id="more-315"></span></p>
<div class="excerpt">
<p><span class="upd"><strong>Update:</strong></span> RDFBeans is an open-source object-RDF databinding and persistence library for the Semantic Web development with Java language. It provides a framework for mapping an object-oriented domain model to RDF resource descriptions. </p>
<p>Information on this page is likely outdated. Please refer to:</p>
<ul>
<li><a href="http://rdfbeans.sf.net">The project web-site</a></li>
<li><a href="http://rdfbeans.sourceforge.net/apidocs/index.html">Javadocs</a></li>
<li><a href="http://rdfbeans.sourceforge.net/download.html">How to get the sourcecode or configure Maven dependency</a></li>
</ul>
<p>All posts about RDFBeans framework are <a href="/tag/rdfbeans">here</a>.
</div>
<p>Working on my current project, I had to deal with a rich object model  which is persisted into a RDF triple-store, so quickly I stuck in writing the object-triples translation code. I thought it would be a good idea to automate this by providing a simple data binding framework for transparent mapping of the Java objects to RDF (like <a href="http://www.hibernate.org/">Hibernate</a> and other tools does so for SQL or XML) with the following requirements in mind:</p>
<ul>
<li>It should be easy to make existing classes compatible with the framework with minimum modifications. This should not affect the business object model (no special interfaces and superclasses) and should not interfere with common <a class="zem_slink" title="JavaBean" rel="wikipedia" href="http://en.wikipedia.org/wiki/JavaBean">JavaBeans</a>-oriented frameworks (like Spring, etc.). Any <a class="zem_slink" title="JavaBean" rel="wikipedia" href="http://en.wikipedia.org/wiki/JavaBean">JavaBean</a>-like <a class="zem_slink" title="Plain Old Java Object" rel="wikipedia" href="http://en.wikipedia.org/wiki/Plain_Old_Java_Object">POJO</a> class can be  RDF-serializable just with few <a class="zem_slink" title="Java annotation" rel="wikipedia" href="http://en.wikipedia.org/wiki/Java_annotation">Java annotations</a> added.</li>
<li>No predefined ontologies and RDF-schemas are required.</li>
<li>Class information is stored in the RDF model for transparent instantiation of the objects.</li>
<li>Cascade binding for related objects should be supported.</li>
<li>Basic Java Collection types should be supported.</li>
</ul>
<p>This framework is implemented using Java annotations and Reflection APIs and works with major RDF triple-stores  (via <a href="http://semanticweb.org/wiki/RDF2Go">RDF2GO</a> abstraction layer).</p>
<h2>RDF Beans</h2>
<p>In order to be mapped to an RDF resource, a Java class must obey certain conventions:</p>
<ul>
<li>The class must have a public default (no-argument) constructor.</li>
<li>The class declaration must have a <code>@RDFBean</code> annotation to associate it with appropriate <a class="zem_slink" title="RDF Schema" rel="wikipedia" href="http://en.wikipedia.org/wiki/RDF_Schema">RDFS</a> class:

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;">@RDFBean<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://xmlns.com/foaf/0.1/Person&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Person <span style="color: #009900;">&#123;</span> ...</pre></div></div>

</li>
</ul>
<p>See also: <a href="http://cyberborean.org/files/rdfbeans/1.0/examples/Person.java">A RDFBean class example</a>.</p>
<h3>Properties</h3>
<p>The class properties must be accessible using standard getter and setter methods. The properties are mapped to their RDF counterparts with <code>@RDF</code> annotations:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">@RDF<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://xmlns.com/foaf/0.1/name&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #003399;">String</span> name<span style="color: #339933;">;</span>
&nbsp;
@RDF<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://xmlns.com/foaf/0.1/mbox&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #003399;">String</span> email<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> getName<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">return</span> name<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setName<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> name<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">name</span> <span style="color: #339933;">=</span> name<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> getEmail<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">return</span> email<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setEmail<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> email<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">email</span> <span style="color: #339933;">=</span> email<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span></pre></div></div>

<p>The argument of <code>@RDF</code> is a valid URI of a RDF property (predicate) in a domain of the specified RDFS class.  The following types of properties are permitted:</p>
<ul>
<li>A Literal (<code>String, Boolean, Date, Integer, Float, Double, Long, Short, Byte, java.net.URI</code>)</li>
<li>Another RDFBean class</li>
<li>A Java Collection (List or Set) of Literals or RDFBeans</li>
</ul>
<p>Literal values are represented in RDF with corresponding <a class="zem_slink" title="XML schema" rel="wikipedia" href="http://en.wikipedia.org/wiki/XML_schema">XML-Schema</a> datatypes and Collections with RDF Containers (<a href="http://www.w3.org/TR/rdf-schema/#ch_bag">rdf:Bag</a> or <a href="http://www.w3.org/TR/rdf-schema/#ch_seq">rdf:Seq</a> depending on a Collection type). References to other RDFBean objects will be kept as RDF object properties and the values will be represented as separate RDF resources.</p>
<h3>RDF subject</h3>
<p>There must be a special String property to hold an unique URI value to identify the RDF resource (the subject URI). It must be accessible with getter and setter methods and be marked with <code>@RDFSubject</code> annotation:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">@RDFSubject
<span style="color: #003399;">String</span> id<span style="color: #339933;">;</span></pre></div></div>

<p>The property value must be a valid absolute URI, otherwise you can use the <code>prefix</code> argument for a common prefix to construct URIs from arbitrary String identifiers:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">@RDFSubject<span style="color: #009900;">&#40;</span>prefix<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://example.com/persons#&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #003399;">String</span> id<span style="color: #339933;">;</span></pre></div></div>

<h2>Data Binding</h2>
<p>RDFBeans data binding framework is based on <a href="http://semanticweb.org/wiki/RDF2Go">RDF2Go API</a> which creates an abstraction layer above physical RDF storages. It makes an RDF model independent from specific RDF frameworks (such as <a class="zem_slink" title="Sesame (framework)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Sesame_%28framework%29">Sesame</a> and <a class="zem_slink" title="Jena (framework)" rel="homepage" href="http://jena.sourceforge.net/">Jena</a>), thus it can work with any, if a RDF2Go adapter is implemented.  The data binding is performed using single <code>RDFBinding</code> class, which is initialized with existing RDF2Go model:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.cyberborean.rdfbeans.RDFBinding</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.ontoware.rdf2go.RDF2Go</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.ontoware.rdf2go.model.Model</span><span style="color: #339933;">;</span>
...
<span style="color: #006633;">Model</span> model <span style="color: #339933;">=</span> RDF2Go.<span style="color: #006633;">getModelFactory</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">createModel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
model.<span style="color: #006633;">open</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
RDFBinding binding <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> RDFBinding<span style="color: #009900;">&#40;</span>model<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The <code>marshal</code> method converts a Java object into a RDF resource in the model:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">Person person <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Person<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
person.<span style="color: #006633;">setId</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://example.com/staff#johndoe&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
person.<span style="color: #006633;">setName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;John Doe&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
person.<span style="color: #006633;">setEmail</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;johndoe@example.com&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
...
<span style="color: #006633;">binding</span>.<span style="color: #006633;">marshal</span><span style="color: #009900;">&#40;</span>person<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This code will create a set of RDF statements representing the properties of the given object in the model:</p>

<div class="wp_syntax"><div class="code"><pre class="" style="font-family:monospace;">&lt;http://example.com/staff#johndoe&gt; &lt;http://www.w3.org/<span style="">1999</span>/02/<span style="">22</span>-rdf-syntax-ns#type&gt; &lt;http://xmlns.com/foaf/<span style="">0.1</span>/Person&gt; .
&lt;http://example.com/staff#johndoe&gt; &lt;http://xmlns.com/foaf/<span style="">0.1</span>/name&gt; &quot;John Doe&quot;^^&lt;http://www.w3.org/<span style="">2001</span>/XMLSchema#string&gt; .
&lt;http://example.com/staff#johndoe&gt; &lt;http://xmlns.com/foaf/<span style="">0.1</span>/mbox&gt; &quot;johndoe@example.com&quot;^^&lt;http://www.w3.org/<span style="">2001</span>/XMLSchema#string&gt; .</pre></div></div>

<p>Additionally, it adds a special statement to associate the RDFS class with Java:</p>

<div class="wp_syntax"><div class="code"><pre class="" style="font-family:monospace;">&lt;http://xmlns.com/foaf/<span style="">0.1</span>/Person&gt; &lt;http://cyberborean.org/rdfbeans/<span style="">1.0</span>/bindingClass&gt; &quot;com.example.Person&quot; .</pre></div></div>

<p>The <code>marshal</code> method inspects the properties which link the object with other RDFBeans and initiates their cascade binding to the RDF model, thus simplifying the development and ensuring referential integrity of the RDFBeans.</p>
<p>To reconstruct a Java object from RDF model, there is <code>unmarshal</code> method:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.ontoware.rdf2go.model.node.URI</span><span style="color: #339933;">;</span>
...
<span style="color: #006633;">URI</span> subject <span style="color: #339933;">=</span> model.<span style="color: #006633;">createURI</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://example.com/staff#johndoe&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
Person person <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>Person<span style="color: #009900;">&#41;</span> binding.<span style="color: #006633;">unmarshal</span><span style="color: #009900;">&#40;</span>subject<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The method creates new instance of the Java class (defined by <code>http://cyberborean.org/rdfbeans/1.0/bindingClass</code> property) and fill the properties with data from the RDF model. If a property holds a reference to another RDFBean, it results into cascade unmarshalling of related objects, thus restoring the original object model.</p>
<h2>Code</h2>
<ul>
<li><a href="http://cyberborean.org/files/rdfbeans/1.0/">RDFBeans JAR and source code</a></li>
<li><a href="http://cyberborean.org/files/rdfbeans/1.0/apidocs/">Javadocs</a></li>
</ul>
<p><strong>[Update: 2009-08-04]</strong></p>
<p>RDFBeans framework is released on SourceForge: <a href="http://rdfbeans.sourceforge.net/">http://rdfbeans.sourceforge.net</a>. The API has been changed, please check the <a href="http://rdfbeans.sourceforge.net/usage.html">documentation</a> and <a href="http://rdfbeans.sourceforge.net/apidocs/index.html">Javadocs</a> for details.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cyberborean.org/2009/02/06/simple-rdf-data-binding/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SCAN Version 1.3 released</title>
		<link>http://blog.cyberborean.org/2008/05/12/scan-version-13-released</link>
		<comments>http://blog.cyberborean.org/2008/05/12/scan-version-13-released#comments</comments>
		<pubDate>Mon, 12 May 2008 19:41:24 +0000</pubDate>
		<dc:creator>Alex Alishevskikh</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[Information Retrieval]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[SCAN]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[tagging]]></category>

		<guid isPermaLink="false">http://cyberborean.wordpress.com/?p=258</guid>
		<description><![CDATA[What&#8217;s new in 1.3 version »]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-259" src="http://cyberborean.org/blog/wp-content/uploads/2008/05/scan.png" alt="" width="64" height="64" /><a href="http://scan.sourceforge.net/?page_id=30">What&#8217;s new in 1.3 version »</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cyberborean.org/2008/05/12/scan-version-13-released/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SCAN FAQ updated</title>
		<link>http://blog.cyberborean.org/2008/02/11/scan-faq-updated</link>
		<comments>http://blog.cyberborean.org/2008/02/11/scan-faq-updated#comments</comments>
		<pubDate>Mon, 11 Feb 2008 13:31:05 +0000</pubDate>
		<dc:creator>Alex Alishevskikh</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[Information Retrieval]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[SCAN]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[tagging]]></category>

		<guid isPermaLink="false">http://cyberborean.wordpress.com/?p=249</guid>
		<description><![CDATA[New version of SCAN Frequently Asked Questions page is available. &#8220;How does SCAN help me?&#8221;, &#8220;Why should I use it?&#8221;, &#8220;Who are the users?&#8221;, &#8220;Why it is smart?&#8221;, &#8220;Can it replace a &#8230;?&#8221;, &#8220;What is autotagging?&#8221;, technical tips-n-tricks, development questions and a lot of other things you would want to know about Smart Content Aggregation [...]]]></description>
			<content:encoded><![CDATA[<p>New version of <a href="http://scan.sourceforge.net/?page_id=20">SCAN Frequently Asked Questions</a> page is available.</p>
<p>&#8220;How does SCAN help me?&#8221;, &#8220;Why should I use it?&#8221;, &#8220;Who are the users?&#8221;, &#8220;Why it is smart?&#8221;, &#8220;Can it replace a &#8230;?&#8221;, &#8220;What is autotagging?&#8221;, technical tips-n-tricks, development questions and a lot of other things you would want to know about Smart Content Aggregation &amp; Navigation technology.</p>
<p><a href="http://scan.sourceforge.net/?page_id=20">Read SCAN FAQ »</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cyberborean.org/2008/02/11/scan-faq-updated/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SCAN 1.2 released</title>
		<link>http://blog.cyberborean.org/2008/01/08/scan-12-released</link>
		<comments>http://blog.cyberborean.org/2008/01/08/scan-12-released#comments</comments>
		<pubDate>Tue, 08 Jan 2008 08:58:33 +0000</pubDate>
		<dc:creator>Alex Alishevskikh</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[Information Retrieval]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[SCAN]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[tagging]]></category>

		<guid isPermaLink="false">http://cyberborean.wordpress.com/2008/01/08/scan-12-released/</guid>
		<description><![CDATA[Along with lots of minor bugfixes and performance tweaks, SCAN 1.2 introduces few essential improvements, mainly in search experience and plugins management&#8230; (Read more on SCAN website)]]></description>
			<content:encoded><![CDATA[<p>Along with lots of minor bugfixes and performance tweaks, SCAN 1.2 introduces few essential improvements, mainly in search experience and plugins management&#8230;</p>
<p><a href="http://scan.sourceforge.net/?page_id=28">(Read more on SCAN website)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cyberborean.org/2008/01/08/scan-12-released/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java AntiPatterns blog</title>
		<link>http://blog.cyberborean.org/2007/11/22/java-antipatterns-blog</link>
		<comments>http://blog.cyberborean.org/2007/11/22/java-antipatterns-blog#comments</comments>
		<pubDate>Thu, 22 Nov 2007 22:43:53 +0000</pubDate>
		<dc:creator>Alex Alishevskikh</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[antipattern]]></category>
		<category><![CDATA[bad practice]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://cyberborean.wordpress.com/2007/11/22/java-antipatterns-blog/</guid>
		<description><![CDATA[I started another blog here on WordPress.com: Java AntiPatterns. It is created to be a &#8220;collection of bad practices&#8221; and short tips how to avoid them in everyday Java coding. The antipatterns are organized both by categories and by tags and some initial set is already on there. If I meet or remember another antipattern, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://javaantipatterns.wordpress.com/"><img src="http://cyberborean.org/blog/wp-content/uploads/2007/11/jap.jpg" border="0" alt="jap.jpg" hspace="0" vspace="0" align="right" /></a>I started another blog here on WordPress.com: <a href="http://javaantipatterns.wordpress.com/">Java AntiPatterns</a>. It is created to be a &#8220;collection of bad practices&#8221; and short tips how to avoid them in everyday Java coding. The antipatterns are organized both by categories and by tags and some initial set is already on there. If I meet or remember another antipattern, I will post it to that blog.</p>
<p>I&#8217;m not thinking about it as of my personal stuff and welcome everyone to <a href="http://javaantipatterns.wordpress.com/suggest-yours/">suggest new </a> antipatterns and their solutions. if you want to post to that blog yourself, please <a href="http://cyberborean.wordpress.com/feedback/">contact me</a> (you have to be a <a href="http://wordpress.com/signup/">registered</a> WordPress user).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cyberborean.org/2007/11/22/java-antipatterns-blog/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SCAN Mail plugin</title>
		<link>http://blog.cyberborean.org/2007/11/14/scan-mail-plugin</link>
		<comments>http://blog.cyberborean.org/2007/11/14/scan-mail-plugin#comments</comments>
		<pubDate>Wed, 14 Nov 2007 14:06:54 +0000</pubDate>
		<dc:creator>Alex Alishevskikh</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[Information Retrieval]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[javamail]]></category>
		<category><![CDATA[SCAN]]></category>
		<category><![CDATA[search]]></category>

		<guid isPermaLink="false">http://cyberborean.wordpress.com/2007/11/14/scan-mail-plugin/</guid>
		<description><![CDATA[I&#8217;d like to announce that SCAN now is able to work with your email. The mail plugin released yesterday introduces new type of the locations for SCAN repository &#8211; mailbox locations. The plugin purpose is to crawl the specified local email folders and aggregate the email messages as the documents in SCAN repository. It also [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;d like to announce that SCAN now is able to work with your email. The <a href="http://scan.sourceforge.net/?page_id=27">mail plugin</a> released yesterday introduces new type of the locations for SCAN repository &#8211; mailbox locations.</p>
<p><span id="more-188"></span></p>
<p>The plugin purpose is to crawl the specified local email folders and aggregate the email messages as the documents in SCAN repository. It also introduces new document type &#8220;<code>message/rfc822</code>&#8221; for emails and uses the email message headers for setting document metadata. Attached files are extracted from messages and processed as the separate documents with appropriate parsers depending on its content type.</p>
<p>As there are no common convention on how to identify a separate message for opening it with an external application, mail plugin implements its own message viewer UI to open the messages by default. The messages are identified with &#8220;<code>mid:</code>&#8221; URI scheme which <a href="http://www.ietf.org/rfc/rfc2392.txt">is a standard</a> but unfortunately, seems to not supported by known MUA&#8217;s so far. However, it is implemented in the hope of that the future MUA&#8217;s will support this standard scheme to open the specific messages with their command line (something like &#8220;<code>thunderbird mid:<em>message-id</em></code>&#8220;).</p>
<p>Mail plugin uses <a href="http://www.gnu.org/software/classpathx/javamail/javamail.html">GNU JavaMail</a> implementation because it includes JavaMail providers for local mail stores &#8211; <a href="http://www.qmail.org/man/man5/mbox.html">mboxes</a> and <a href="http://www.qmail.org/qmail-manual-html/man5/maildir.html">maildirs</a>. In addition, Outlook Express mail is also supported via the separate JavaMail provider made by <a href="http://sourceforge.net/projects/jmbox">jmbox project</a>. Thus, the mail plugin supports a wide range of popular MUA&#8217;s, including mbox-based (Mozilla family), maildir-based, mixed mbox/maildir (KMail and Evolution) and Outlook Express.</p>
<p>The plugin has been tested on Linux with Mozilla Thunderbird 1.5 and KMail 1.9.6 (in maildir mode) and Windows XP with Mozilla Thunderbird 1.5 and MS Outlook Express 5.0.</p>
<h3>Problems?</h3>
<p>Yep, they are. The issues with mail plugin go both from GNU JavaMail limitations and from the side of the concrete MUA&#8217;s which seem to be easy with interpreting mbox/maildir principles for their convenience. For instance, Thunderbird uses the non-standard &#8220;.sbd&#8221; directories to keep the mail subfolders, which the mbox provider is unaware of. So, recursive crawling the Thunderbird mail folders does not work. The only solution for those problems is to develop the MUA-specific JavaMail providers which would know how to deal with a concrete mbox or maildir implementation with all its peculiarities.</p>
<p>Outlook Express provider, as an example of such MUA-specific implementation works rather good, however we noticed a bug with localized MSOE versions where the translated folder names (&#8220;Inbox&#8221;, &#8220;Sent&#8221;, &#8220;Trash&#8221; etc) with non-latin letters had not been processed.</p>
<p>The reports on testing the mail plugin with other MUA&#8217;s/platforms are more than welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cyberborean.org/2007/11/14/scan-mail-plugin/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SCAN 1.1 released</title>
		<link>http://blog.cyberborean.org/2007/10/22/scan-11-released</link>
		<comments>http://blog.cyberborean.org/2007/10/22/scan-11-released#comments</comments>
		<pubDate>Mon, 22 Oct 2007 02:03:09 +0000</pubDate>
		<dc:creator>Alex Alishevskikh</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[Information Retrieval]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[SCAN]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[tagging]]></category>

		<guid isPermaLink="false">http://cyberborean.wordpress.com/2007/10/22/scan-11-released/</guid>
		<description><![CDATA[See what&#8217;s new in 1.1 version.]]></description>
			<content:encoded><![CDATA[<p>See <a href="http://scan.sourceforge.net/?page_id=26">what&#8217;s new in 1.1 version</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cyberborean.org/2007/10/22/scan-11-released/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SCAN project announce</title>
		<link>http://blog.cyberborean.org/2007/09/14/scan-project-announce</link>
		<comments>http://blog.cyberborean.org/2007/09/14/scan-project-announce#comments</comments>
		<pubDate>Fri, 14 Sep 2007 12:36:54 +0000</pubDate>
		<dc:creator>Alex Alishevskikh</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[IA]]></category>
		<category><![CDATA[Information Retrieval]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[metadata]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[SCAN]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[tagging]]></category>
		<category><![CDATA[taxonomy]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://cyberborean.wordpress.com/2007/09/14/scan-project-announce/</guid>
		<description><![CDATA[ViceVersa Technologies presents the first public release of SCAN (Smart Content Aggregation and Navigation) platform. SCAN is a personal Information Retrieval framework, combining search, text analysis, tagging and metadata functions to provide new user experience of desktop navigation and document management. About SCAN &#8220;&#8230; the abundance of information will be such that either you have [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://scan.sourceforge.net"><img src='http://cyberborean.org/blog/wp-content/uploads/2007/09/scan100i.png' alt='SCAN' align='left' hspace='5'></a><em>ViceVersa Technologies presents the first public release of <a href="http://scan.sourceforge.net">SCAN (Smart Content Aggregation and Navigation)</a> platform. SCAN  is a personal        Information Retrieval framework, combining search, text analysis,        tagging and metadata functions to provide new user experience of desktop        navigation and document management.</em></p>
<p><span id="more-179"></span></p>
<h3>About SCAN</h3>
<blockquote><p>&#8220;&#8230; the abundance of information will be such that either you have        reached such a level of maturity that you are able to be your own        filter, or you will desperately need a filter&#8230; some professional        filter.&#8221;<br />
<em>Umberto Eco: A Conversation on Information<br />
(<a href="http://carbon.cudenver.edu/~mryder/itc_data/eco/eco.html">an interview  by Patrick Coppock</a>, February, 1995)</em></p></blockquote>
<p style="margin-top:0;">       SCAN is aiming for a solution of major problems of content organization        and findability in information overload era.</p>
<p style="margin-top:0;"><a href='http://scan.sourceforge.net/uploads/images/browse.png' title='Browse documents'><img src='http://scan.sourceforge.net/uploads/images/browse_tmb.png' alt='Browse documents' align='left' hspace='5' vspace='5' /></a>SCAN aggregates content from different sources into a single documents        collection. This repository may keep records on thousands of documents        independently of their original locations and formats. Every document        record contains a number of metadata properties (such as title,        description, author, creation date, etc) which can be either set        automatically or edited manually.</p>
<p style="margin-top:0;">       Adding documents to the repository is an automated operation. A user        only need to point SCAN to a location and the application will find and        add every document from there. Added document locations will be        monitored for changes (new, modified or deleted documents) to keep the        repository up-to-date.</p>
<p style="margin-top:0;">       The documents content is indexed for search and text analysis. You can        search the documents either by simple text queries, or by using special        forms to make complex queries for searching on document text and        properties. The queries can be saved for repeatable use.</p>
<p style="margin-top:0;"> <a href='http://scan.sourceforge.net/uploads/images/tags.png' title='Tags panel'><img src='http://scan.sourceforge.net/uploads/images/tags_tmb.png' alt='Tags panel' align='left' hspace='5' vspace='5' /></a>      The documents collection is structured with a system of tags, similar to        the services like <a href="http://del.icio.us/">del.icio.us</a> or <a href="http://flickr.com/">Flickr</a>.        Tags are keywords or labels attached to the items to identify them for        quick navigation and finding. All tags together form a t<em>axonomy</em>        representing the semantics of the documents collection. The taxonomy can        be viewed as a &#8220;tags cloud&#8221; for navigating through the documents        repository.</p>
<p style="margin-top:0;">       SCAN text analysis mechanism simplifies the process of tagging. It        analyzes a document content and suggests the most relevant words as to-be tags. It makes manual tagging as simple as selecting the tags from        the proposed candidates. It also can undertake the whole manual process        of tagging, either by automated assigning the tags to the documents, or        by finding the documents, relevant to a specific tag. Another text        analysis application is searching the documents similar to a specific        one (search by pattern).</p>
<p style="margin-top:0;">       SCAN is a component-based software using a number of plugins for        specific features. The basic SCAN platform can be easily extended with        plugins for new document formats, document locations (RSS feeds,        web-sites, e-mail, etc) and language analyzers. Whole new areas of        functionality can be added with user interface extensions. An example of        such extensions is the plugin to browse the repository with a calendar        (grouping the documents by their creation dates).</p>
<p style="margin-top:0;">       SCAN is a <a href="http://java.sun.com/">Java</a> application, so it        works on any Java-enabled platform. SCAN is a free open source software,        distributed under <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache        License, Version 2.0</a></p>
<h3>See also:</h3>
<ul>
<li><a href="http://scan.sourceforge.net/?page_id=19">List of current features</a></li>
<li><a href="http://sourceforge.net/project/showfiles.php?group_id=189359">Download SCAN</a></li>
<li><a href="http://scan.sourceforge.net/?page_id=7">How to obtain SCAN sources from SVN repository</a></li>
<li><a href="http://scan.sourceforge.net/?page_id=4">User&#8217;s Manual</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.cyberborean.org/2007/09/14/scan-project-announce/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

