Clean remove for Bean with array ?

3 views
Skip to first unread message

barraq

unread,
Jun 15, 2010, 2:54:21 AM6/15/10
to jenabean-dev
Hi there,

I posted an issue on the Jenabean google's project but it don't seems
to be active.
Well i'm wondering if someone could help me on this ?

Problem:
When creating a bean with Array-like attribute, it is correctly saved
to the model but cannot be properly removed. The statement containing
the array is not eliminated and the model is let with:
<rdf:Description rdf:nodeID="A0">
<rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-
ns#Seq"/>
</rdf:Description>


What steps will reproduce the problem?
1. Create a simple bean like the following:
public class Relation {
Entity[] members;

public Entity[] getMembers() {
return members;
}

public void setMembers(Entity[] members) {
this.members = members;
}
}
Where Entity is a random JenaBean.

2. Create entities and link them with relation

Model m = ModelFactory.createDefaultModel();
MyBean2RDF writer = new MyBean2RDF(m);

Entity e1 = Entity();
Entity e2 = Entity();

Relation r1 = Relation();
r1.setMembers(new Entity[]{e1,e2});

// save
writer.save(e1);
writer.save(e2);
writer.save(r1);
m.write(System.out);

// delete
writer.delete(e1);
writer.delete(e2);
writer.delete(r1);
m.write(System.out);

3. look at the output...

What is the expected output? What do you see instead?
Expected output:
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:j.0="http://thewebsemantic.com/"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" >
...
</rdf:RDF>

What i got instead:
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:j.0="http://thewebsemantic.com/"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" >
...
<rdf:Description rdf:nodeID="A0">
<rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-
ns#Seq"/>
</rdf:Description>
</rdf:RDF>

What version of the product are you using? On what operating system?
Using 1.0.6 multi platform (platform not relevant here).

Taylor Cowan

unread,
Jun 15, 2010, 9:51:23 AM6/15/10
to jenabe...@googlegroups.com
Thanks 4 the mail, looking into it now , taylor

Sent from my HTC

Hi there,

[The entire original message is not included]

barraq

unread,
Jun 15, 2010, 10:01:56 AM6/15/10
to jenabean-dev
Hi Taylor,

This is only a post about an issue have been confronted recently. It
refers to http://code.google.com/p/jenabean/issues/detail?id=12

About the mail i sent you, i've made some changes to the Thing.class,
is there any way to commit it ?
I would like to contribute to jenabean if it is ok ;)

Rémi
Reply all
Reply to author
Forward
0 new messages