Problem Alibaba gettin an object simple property...always return null!!

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Problem Alibaba gettin an object simple property...always return null!!

Javier Sevilla
Hello

I'm a newbie in the alibaba system.

I have downloaded the last version (2-0.beta 7) and I don't know the  
reason about I can't get the value a simple property from a very simple  
class instance.

I tell you the context....

I use an ontology with the Class "Ayuda" with the property "serie" (single  
string)

I have developed Ayuda.java with this source code (following the  
documentation, like Document sample):

----------------------- Ayuda.java------------------


import org.openrdf.repository.object.annotations.iri;

@iri(Ayuda.NS + "Ayuda")


public class Ayuda {

          public static final String NS =  
"http://www.icontents.com/Discapacidad.owl#";

          @iri(NS + "serie") String serie;

          public String getSerie() {
            return serie;
          }
          public void setSerie(String serie) {
            this.serie = serie;
          }
}

---------------------------------------------------

The class is mapped in the META-INF\org.openrdf.concepts

org.icontents.ontology.persistence.system.Ayuda =  
http://www.icontents.com/Discapacidad.owl#Ayuda

When this entry is not set, appears unregistered type errors, now is ok.




Once the repository is initialized (and works, cause I tested it with a  
normal SPARQL query) I write this source code:

---------------------------------------------------------------------
ValueFactory vf = session.getConnection().getValueFactory();
URI id = vf.createURI("http://www.icontents.com/Discapacidad.owl#Ayuda_4");

// The uri of the instance is  
http://www.icontents.com/Discapacidad.owl#Ayuda_4


try {
        Ayuda ayuda;
        try {
                ayuda = session.getConnection().getObject(Ayuda.class,id);
                System.out.println("Result "+ayuda.getSerie());
        } catch (QueryEvaluationException e) {
                e.printStackTrace();
        }
} catch (RepositoryException e) {
        e.printStackTrace();
}

-----------------------------------------------
These lines are written following the documentation instructions
When I execute it, there are not any problem, error, exception,...
But the result, the value of the serie property is null, and if I put  
directly "ayuda" in the system.out apperas an error, that I write bellow.

I only want to retrieve the value of a property, I think that this step  
must be so easy. I think that something is wrong, but I don't understand  
what happens. PLease, can help me somebody???


Here is the error that appear if I put "ayuda" directly in the system.out,  
If I put ayuda.getSerie() simply returns null.

-----------------------------------

Exception in thread "main" java.lang.StackOverflowError
        at java.util.ArrayList.<init>(Unknown Source)
        at  
org.openrdf.repository.object.composition.helpers.InvocationMessageContext.<init>(InvocationMessageContext.java:110)
        at  
object.proxies._fffffcb9769b98df._EntityProxyffe83308686f8980.toString(_EntityProxyffe83308686f8980.java)
        at  
object.behaviours.org.openrdf.http.object.behaviours.HTTPFileObjectSupportAbstractClass.toString(HTTPFileObjectSupportAbstractClass.java)
        at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at  
org.openrdf.repository.object.composition.helpers.InvocationMessageContext.nextResponse(InvocationMessageContext.java:301)
        at  
org.openrdf.repository.object.composition.helpers.InvocationMessageContext.proceed(InvocationMessageContext.java:220)
        at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at  
org.openrdf.repository.object.composition.helpers.InvocationMessageContext.invoke(InvocationMessageContext.java:146)
        at $Proxy8.proceed(Unknown Source)
        at  
org.openrdf.repository.object.behaviours.RDFObjectImpl.toString(RDFObjectImpl.java:86)
        at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at  
org.openrdf.repository.object.composition.helpers.InvocationMessageContext.nextResponse(InvocationMessageContext.java:294)
        at  
org.openrdf.repository.object.composition.helpers.InvocationMessageContext.getFunctionalObjectResponse(InvocationMessageContext.java:251)
        at  
object.proxies._fffffcb9769b98df._EntityProxyffe83308686f8980.toString(_EntityProxyffe83308686f8980.java)
        at  
object.behaviours.org.openrdf.http.object.behaviours.HTTPFileObjectSupportAbstractClass.toString(HTTPFileObjectSupportAbstractClass.java)
        at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at  
org.openrdf.repository.object.composition.helpers.InvocationMessageContext.nextResponse(InvocationMessageContext.java:301)
        at  
org.openrdf.repository.object.composition.helpers.InvocationMessageContext.proceed(InvocationMessageContext.java:220)
        at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at  
org.openrdf.repository.object.composition.helpers.InvocationMessageContext.invoke(InvocationMessageContext.java:146)
        at $Proxy8.proceed(Unknown Source)
        at  
org.openrdf.repository.object.behaviours.RDFObjectImpl.toString(RDFObjectImpl.java:86)
        at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at  
org.openrdf.repository.object.composition.helpers.InvocationMessageContext.nextResponse(InvocationMessageContext.java:294)
        at  
org.openrdf.repository.object.composition.helpers.InvocationMessageContext.getFunctionalObjectResponse(InvocationMessageContext.java:251)
        at  
object.proxies._fffffcb9769b98df._EntityProxyffe83308686f8980.toString(_EntityProxyffe83308686f8980.java)
        at  
object.behaviours.org.openrdf.http.object.behaviours.HTTPFileObjectSupportAbstractClass.toString(HTTPFileObjectSupportAbstractClass.java)
        at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at  
org.openrdf.repository.object.composition.helpers.InvocationMessageContext.nextResponse(InvocationMessageContext.java:301)
        at  
org.openrdf.repository.object.composition.helpers.InvocationMessageContext.proceed(InvocationMessageContext.java:220)
        at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at  
org.openrdf.repository.object.composition.helpers.InvocationMessageContext.invoke(InvocationMessageContext.java:146)
        at $Proxy8.proceed(Unknown Source)
        at  
org.openrdf.repository.object.behaviours.RDFObjectImpl.toString(RDFObjectImpl.java:86)
        at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at  
org.openrdf.repository.object.composition.helpers.InvocationMessageContext.nextResponse(InvocationMessageContext.java:294)
        at  
org.openrdf.repository.object.composition.helpers.InvocationMessageContext.getFunctionalObjectResponse(InvocationMessageContext.java:251)
        at  
object.proxies._fffffcb9769b98df._EntityProxyffe83308686f8980.toString(_EntityProxyffe83308686f8980.java)
        at  
object.behaviours.org.openrdf.http.object.behaviours.HTTPFileObjectSupportAbstractClass.toString(HTTPFileObjectSupportAbstractClass.java)
        at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at  
org.openrdf.repository.object.composition.helpers.InvocationMessageContext.nextResponse(InvocationMessageContext.java:301)
        at  
org.openrdf.repository.object.composition.helpers.InvocationMessageContext.proceed(InvocationMessageContext.java:220)
        at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at  
org.openrdf.repository.object.composition.helpers.InvocationMessageContext.invoke(InvocationMessageContext.java:146)
        at $Proxy8.proceed(Unknown Source)
        at  
org.openrdf.repository.object.behaviours.RDFObjectImpl.toString(RDFObjectImpl.java:86)
        at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at  
org.openrdf.repository.object.composition.helpers.InvocationMessageContext.nextResponse(InvocationMessageContext.java:294)
        at  
org.openrdf.repository.object.composition.helpers.InvocationMessageContext.getFunctionalObjectResponse(InvocationMessageContext.java:251)
        at  
object.proxies._fffffcb9769b98df._EntityProxyffe83308686f8980.toString(_EntityProxyffe83308686f8980.java)
        at  
object.behaviours.org.openrdf.http.object.behaviours.HTTPFileObjectSupportAbstractClass.toString(HTTPFileObjectSupportAbstractClass.java)
        at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
-----------------------------------


Thanks for all in advance!!!

--
__________________________________________________
Javier Sevilla Peris
Grupo de Autismo y Dificultades de Aprendizaje
Universidad de Valencia
[hidden email]
http://autismo.uv.es
T: (+34)963543573
F: (+34)963543550
__________________________________________________

------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Sesame-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sesame-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem Alibaba gettin an object simple property...always return null!!

James Leigh
Hi Javier,

I wasn't able to reproduce your problem (works for me). Because of the
stack trace I think you might have multiple versions of AliBaba in your
classpath (is that possible?). Otherwise, please try to produce a small
program you can send me so I can see it fail.

Also, the getConnection() method returns a *new* connection each time,
so you need to close it when you are finished with the connection.

James

On Thu, 2011-04-14 at 13:38 +0200, Javier Sevilla wrote:

> Hello
>
> I'm a newbie in the alibaba system.
>
> I have downloaded the last version (2-0.beta 7) and I don't know the  
> reason about I can't get the value a simple property from a very simple  
> class instance.
>
> I tell you the context....
>
> I use an ontology with the Class "Ayuda" with the property "serie" (single  
> string)
>
> I have developed Ayuda.java with this source code (following the  
> documentation, like Document sample):
>
> ----------------------- Ayuda.java------------------
>
>
> import org.openrdf.repository.object.annotations.iri;
>
> @iri(Ayuda.NS + "Ayuda")
>
>
> public class Ayuda {
>
>  public static final String NS =  
> "http://www.icontents.com/Discapacidad.owl#";
>
>  @iri(NS + "serie") String serie;
>
>  public String getSerie() {
>    return serie;
>  }
>  public void setSerie(String serie) {
>    this.serie = serie;
>  }
> }
>
> ---------------------------------------------------
>
> The class is mapped in the META-INF\org.openrdf.concepts
>
> org.icontents.ontology.persistence.system.Ayuda =  
> http://www.icontents.com/Discapacidad.owl#Ayuda
>
> When this entry is not set, appears unregistered type errors, now is ok.
>
>
>
>
> Once the repository is initialized (and works, cause I tested it with a  
> normal SPARQL query) I write this source code:
>
> ---------------------------------------------------------------------
> ValueFactory vf = session.getConnection().getValueFactory();
> URI id = vf.createURI("http://www.icontents.com/Discapacidad.owl#Ayuda_4");
>
> // The uri of the instance is  
> http://www.icontents.com/Discapacidad.owl#Ayuda_4
>
>
> try {
> Ayuda ayuda;
> try {
> ayuda = session.getConnection().getObject(Ayuda.class,id);
> System.out.println("Result "+ayuda.getSerie());
> } catch (QueryEvaluationException e) {
> e.printStackTrace();
> }
> } catch (RepositoryException e) {
> e.printStackTrace();
> }
>
> -----------------------------------------------
> These lines are written following the documentation instructions
> When I execute it, there are not any problem, error, exception,...
> But the result, the value of the serie property is null, and if I put  
> directly "ayuda" in the system.out apperas an error, that I write bellow.
>
> I only want to retrieve the value of a property, I think that this step  
> must be so easy. I think that something is wrong, but I don't understand  
> what happens. PLease, can help me somebody???
>
>
> Here is the error that appear if I put "ayuda" directly in the system.out,  
> If I put ayuda.getSerie() simply returns null.
>
> -----------------------------------
>
> Exception in thread "main" java.lang.StackOverflowError
> at java.util.ArrayList.<init>(Unknown Source)
> at  
> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.<init>(InvocationMessageContext.java:110)
> at  
> object.proxies._fffffcb9769b98df._EntityProxyffe83308686f8980.toString(_EntityProxyffe83308686f8980.java)
> at  
> object.behaviours.org.openrdf.http.object.behaviours.HTTPFileObjectSupportAbstractClass.toString(HTTPFileObjectSupportAbstractClass.java)
> at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at  
> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.nextResponse(InvocationMessageContext.java:301)
> at  
> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.proceed(InvocationMessageContext.java:220)
> at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at  
> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.invoke(InvocationMessageContext.java:146)
> at $Proxy8.proceed(Unknown Source)
> at  
> org.openrdf.repository.object.behaviours.RDFObjectImpl.toString(RDFObjectImpl.java:86)
> at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at  
> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.nextResponse(InvocationMessageContext.java:294)
> at  
> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.getFunctionalObjectResponse(InvocationMessageContext.java:251)
> at  
> object.proxies._fffffcb9769b98df._EntityProxyffe83308686f8980.toString(_EntityProxyffe83308686f8980.java)
> at  
> object.behaviours.org.openrdf.http.object.behaviours.HTTPFileObjectSupportAbstractClass.toString(HTTPFileObjectSupportAbstractClass.java)
> at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at  
> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.nextResponse(InvocationMessageContext.java:301)
> at  
> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.proceed(InvocationMessageContext.java:220)
> at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at  
> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.invoke(InvocationMessageContext.java:146)
> at $Proxy8.proceed(Unknown Source)
> at  
> org.openrdf.repository.object.behaviours.RDFObjectImpl.toString(RDFObjectImpl.java:86)
> at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at  
> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.nextResponse(InvocationMessageContext.java:294)
> at  
> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.getFunctionalObjectResponse(InvocationMessageContext.java:251)
> at  
> object.proxies._fffffcb9769b98df._EntityProxyffe83308686f8980.toString(_EntityProxyffe83308686f8980.java)
> at  
> object.behaviours.org.openrdf.http.object.behaviours.HTTPFileObjectSupportAbstractClass.toString(HTTPFileObjectSupportAbstractClass.java)
> at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at  
> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.nextResponse(InvocationMessageContext.java:301)
> at  
> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.proceed(InvocationMessageContext.java:220)
> at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at  
> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.invoke(InvocationMessageContext.java:146)
> at $Proxy8.proceed(Unknown Source)
> at  
> org.openrdf.repository.object.behaviours.RDFObjectImpl.toString(RDFObjectImpl.java:86)
> at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at  
> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.nextResponse(InvocationMessageContext.java:294)
> at  
> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.getFunctionalObjectResponse(InvocationMessageContext.java:251)
> at  
> object.proxies._fffffcb9769b98df._EntityProxyffe83308686f8980.toString(_EntityProxyffe83308686f8980.java)
> at  
> object.behaviours.org.openrdf.http.object.behaviours.HTTPFileObjectSupportAbstractClass.toString(HTTPFileObjectSupportAbstractClass.java)
> at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at  
> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.nextResponse(InvocationMessageContext.java:301)
> at  
> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.proceed(InvocationMessageContext.java:220)
> at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at  
> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.invoke(InvocationMessageContext.java:146)
> at $Proxy8.proceed(Unknown Source)
> at  
> org.openrdf.repository.object.behaviours.RDFObjectImpl.toString(RDFObjectImpl.java:86)
> at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at  
> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.nextResponse(InvocationMessageContext.java:294)
> at  
> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.getFunctionalObjectResponse(InvocationMessageContext.java:251)
> at  
> object.proxies._fffffcb9769b98df._EntityProxyffe83308686f8980.toString(_EntityProxyffe83308686f8980.java)
> at  
> object.behaviours.org.openrdf.http.object.behaviours.HTTPFileObjectSupportAbstractClass.toString(HTTPFileObjectSupportAbstractClass.java)
> at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> -----------------------------------
>
>
> Thanks for all in advance!!!
>



------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Sesame-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sesame-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem Alibaba gettin an object simple property...always return null!!

Javier Sevilla

Hi James

Lot of thanks for the quick answer.

I can send you the complete program, In fact, I think I can organize it in  
two classes.

But I think, for your answer that must be a configuration problem, or a  
incorrect jat, or similar.

For that reason I think that the best is that you send me a mini example,  
similar to my question. If you consider that is a good idea, of course.

In fact, this is only leak of alibaba, I think that people need complete  
examples while the documentation is preparing.
Do you know where exist some complete examples? (with .java)


Anywhere, if  you consider that the best is that I send you the program,  
for me is no problema, I will send it to you.

The lib folder has the next jars

commons-codec-1.5.jar
httpcore-4.0.jar
javassist.jar
log4j-1.2.16.jar
openrdf-alibaba-2.0-beta7.jar
slf4-api-1.5.8.jar
slf4j-jdk14-1.5.8.jar
openrdf-sesame-2.3.3-onejar.jar

Please, tell me if is the same for your program, could be this is the  
problem, the jar and the classpath.

Thanks again, Javier.




En 14/04/2011 15:19:36, James Leigh <[hidden email]> escribió:

> Hi Javier,
>
> I wasn't able to reproduce your problem (works for me). Because of the
> stack trace I think you might have multiple versions of AliBaba in your
> classpath (is that possible?). Otherwise, please try to produce a small
> program you can send me so I can see it fail.
>
> Also, the getConnection() method returns a *new* connection each time,
> so you need to close it when you are finished with the connection.
>
> James
>
> On Thu, 2011-04-14 at 13:38 +0200, Javier Sevilla wrote:
>> Hello
>>
>> I'm a newbie in the alibaba system.
>>
>> I have downloaded the last version (2-0.beta 7) and I don't know the
>> reason about I can't get the value a simple property from a very simple
>> class instance.
>>
>> I tell you the context....
>>
>> I use an ontology with the Class "Ayuda" with the property "serie"  
>> (single
>> string)
>>
>> I have developed Ayuda.java with this source code (following the
>> documentation, like Document sample):
>>
>> ----------------------- Ayuda.java------------------
>>
>>
>> import org.openrdf.repository.object.annotations.iri;
>>
>> @iri(Ayuda.NS + "Ayuda")
>>
>>
>> public class Ayuda {
>>
>>  public static final String NS =
>> "http://www.icontents.com/Discapacidad.owl#";
>>
>>  @iri(NS + "serie") String serie;
>>
>>  public String getSerie() {
>>    return serie;
>>  }
>>  public void setSerie(String serie) {
>>    this.serie = serie;
>>  }
>> }
>>
>> ---------------------------------------------------
>>
>> The class is mapped in the META-INF\org.openrdf.concepts
>>
>> org.icontents.ontology.persistence.system.Ayuda =
>> http://www.icontents.com/Discapacidad.owl#Ayuda
>>
>> When this entry is not set, appears unregistered type errors, now is ok.
>>
>>
>>
>>
>> Once the repository is initialized (and works, cause I tested it with a
>> normal SPARQL query) I write this source code:
>>
>> ---------------------------------------------------------------------
>> ValueFactory vf = session.getConnection().getValueFactory();
>> URI id =  
>> vf.createURI("http://www.icontents.com/Discapacidad.owl#Ayuda_4");
>>
>> // The uri of the instance is
>> http://www.icontents.com/Discapacidad.owl#Ayuda_4
>>
>>
>> try {
>> Ayuda ayuda;
>> try {
>> ayuda = session.getConnection().getObject(Ayuda.class,id);
>> System.out.println("Result "+ayuda.getSerie());
>> } catch (QueryEvaluationException e) {
>> e.printStackTrace();
>> }
>> } catch (RepositoryException e) {
>> e.printStackTrace();
>> }
>>
>> -----------------------------------------------
>> These lines are written following the documentation instructions
>> When I execute it, there are not any problem, error, exception,...
>> But the result, the value of the serie property is null, and if I put
>> directly "ayuda" in the system.out apperas an error, that I write  
>> bellow.
>>
>> I only want to retrieve the value of a property, I think that this step
>> must be so easy. I think that something is wrong, but I don't understand
>> what happens. PLease, can help me somebody???
>>
>>
>> Here is the error that appear if I put "ayuda" directly in the  
>> system.out,
>> If I put ayuda.getSerie() simply returns null.
>>
>> -----------------------------------
>>
>> Exception in thread "main" java.lang.StackOverflowError
>> at java.util.ArrayList.<init>(Unknown Source)
>> at
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.<init>(InvocationMessageContext.java:110)
>> at
>> object.proxies._fffffcb9769b98df._EntityProxyffe83308686f8980.toString(_EntityProxyffe83308686f8980.java)
>> at
>> object.behaviours.org.openrdf.http.object.behaviours.HTTPFileObjectSupportAbstractClass.toString(HTTPFileObjectSupportAbstractClass.java)
>> at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> at java.lang.reflect.Method.invoke(Unknown Source)
>> at
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.nextResponse(InvocationMessageContext.java:301)
>> at
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.proceed(InvocationMessageContext.java:220)
>> at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> at java.lang.reflect.Method.invoke(Unknown Source)
>> at
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.invoke(InvocationMessageContext.java:146)
>> at $Proxy8.proceed(Unknown Source)
>> at
>> org.openrdf.repository.object.behaviours.RDFObjectImpl.toString(RDFObjectImpl.java:86)
>> at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> at java.lang.reflect.Method.invoke(Unknown Source)
>> at
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.nextResponse(InvocationMessageContext.java:294)
>> at
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.getFunctionalObjectResponse(InvocationMessageContext.java:251)
>> at
>> object.proxies._fffffcb9769b98df._EntityProxyffe83308686f8980.toString(_EntityProxyffe83308686f8980.java)
>> at
>> object.behaviours.org.openrdf.http.object.behaviours.HTTPFileObjectSupportAbstractClass.toString(HTTPFileObjectSupportAbstractClass.java)
>> at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> at java.lang.reflect.Method.invoke(Unknown Source)
>> at
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.nextResponse(InvocationMessageContext.java:301)
>> at
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.proceed(InvocationMessageContext.java:220)
>> at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> at java.lang.reflect.Method.invoke(Unknown Source)
>> at
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.invoke(InvocationMessageContext.java:146)
>> at $Proxy8.proceed(Unknown Source)
>> at
>> org.openrdf.repository.object.behaviours.RDFObjectImpl.toString(RDFObjectImpl.java:86)
>> at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> at java.lang.reflect.Method.invoke(Unknown Source)
>> at
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.nextResponse(InvocationMessageContext.java:294)
>> at
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.getFunctionalObjectResponse(InvocationMessageContext.java:251)
>> at
>> object.proxies._fffffcb9769b98df._EntityProxyffe83308686f8980.toString(_EntityProxyffe83308686f8980.java)
>> at
>> object.behaviours.org.openrdf.http.object.behaviours.HTTPFileObjectSupportAbstractClass.toString(HTTPFileObjectSupportAbstractClass.java)
>> at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> at java.lang.reflect.Method.invoke(Unknown Source)
>> at
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.nextResponse(InvocationMessageContext.java:301)
>> at
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.proceed(InvocationMessageContext.java:220)
>> at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> at java.lang.reflect.Method.invoke(Unknown Source)
>> at
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.invoke(InvocationMessageContext.java:146)
>> at $Proxy8.proceed(Unknown Source)
>> at
>> org.openrdf.repository.object.behaviours.RDFObjectImpl.toString(RDFObjectImpl.java:86)
>> at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> at java.lang.reflect.Method.invoke(Unknown Source)
>> at
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.nextResponse(InvocationMessageContext.java:294)
>> at
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.getFunctionalObjectResponse(InvocationMessageContext.java:251)
>> at
>> object.proxies._fffffcb9769b98df._EntityProxyffe83308686f8980.toString(_EntityProxyffe83308686f8980.java)
>> at
>> object.behaviours.org.openrdf.http.object.behaviours.HTTPFileObjectSupportAbstractClass.toString(HTTPFileObjectSupportAbstractClass.java)
>> at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> at java.lang.reflect.Method.invoke(Unknown Source)
>> at
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.nextResponse(InvocationMessageContext.java:301)
>> at
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.proceed(InvocationMessageContext.java:220)
>> at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> at java.lang.reflect.Method.invoke(Unknown Source)
>> at
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.invoke(InvocationMessageContext.java:146)
>> at $Proxy8.proceed(Unknown Source)
>> at
>> org.openrdf.repository.object.behaviours.RDFObjectImpl.toString(RDFObjectImpl.java:86)
>> at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> at java.lang.reflect.Method.invoke(Unknown Source)
>> at
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.nextResponse(InvocationMessageContext.java:294)
>> at
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.getFunctionalObjectResponse(InvocationMessageContext.java:251)
>> at
>> object.proxies._fffffcb9769b98df._EntityProxyffe83308686f8980.toString(_EntityProxyffe83308686f8980.java)
>> at
>> object.behaviours.org.openrdf.http.object.behaviours.HTTPFileObjectSupportAbstractClass.toString(HTTPFileObjectSupportAbstractClass.java)
>> at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> at java.lang.reflect.Method.invoke(Unknown Source)
>> -----------------------------------
>>
>>
>> Thanks for all in advance!!!
>>
>
>
>
> ------------------------------------------------------------------------------
> Benefiting from Server Virtualization: Beyond Initial Workload
> Consolidation -- Increasing the use of server virtualization is a top
> priority.Virtualization can reduce costs, simplify management, and  
> improve
> application availability and disaster protection. Learn more about  
> boosting
> the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
> _______________________________________________
> Sesame-general mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/sesame-general
>


--
__________________________________________________
Javier Sevilla Peris
Grupo de Autismo y Dificultades de Aprendizaje
Universidad de Valencia
[hidden email]
http://autismo.uv.es
T: (+34)963543573
F: (+34)963543550
__________________________________________________

------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Sesame-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sesame-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem Alibaba gettin an object simple property...always return null!!

Javier Sevilla

I think is the version of javassist.
I have an old version, from 2008, named simply javassit.jar.
This version compiles without any problem, and works till getting the  
values of the object.
The main problem is that there is not any exception, simply return null in  
the value.

Thanks for your quick answers, and your responsability, these actions  
makes me trust in the project.

Javier.




En 14/04/2011 17:55:59, James Leigh <[hidden email]> escribió:

> Your solution is not clear to me. Other may have the same problem. Can
> you be more explicit of the steps you took to resolve this problem?
>
> Did you compile AliBaba yourself? Did you have the wrong version of
> javassist (should be 3.11.0.GA)?
>
> James
>
> On Thu, 2011-04-14 at 16:28 +0200, Javier Sevilla wrote:
>> Dear James
>>
>> Thanks for all, the problem is solved.
>> In fact , it was a jar problem.
>> I download the source code of alibaba, and put all these jars and the
>> alibaba jar, recompile, and ready!!
>> It works.
>> I don't know if the cause was javassist, the common, I don't know, but
>> sure that it was a jar problems.
>>
>> Thank for all.
>>
>>
>> En 14/04/2011 16:16:38, James Leigh <[hidden email]> escribió:
>>
>> > Please send a complete program (jars included). What JVM are you using
>> > (java -version)?
>> >
>> > James
>> >
>> > On Thu, 2011-04-14 at 16:09 +0200, Javier Sevilla wrote:
>> >> Hi James
>> >>
>> >> Lot of thanks for the quick answer.
>> >>
>> >> I can send you the complete program, In fact, I think I can organize  
>> it
>> >> in
>> >> two classes.
>> >>
>> >> But I think, for your answer that must be a configuration problem,  
>> or a
>> >> incorrect jat, or similar.
>> >>
>> >> For that reason I think that the best is that you send me a mini
>> >> example,
>> >> similar to my question. If you consider that is a good idea, of  
>> course.
>> >>
>> >> In fact, this is only leak of alibaba, I think that people need  
>> complete
>> >> examples while the documentation is preparing.
>> >> Do you know where exist some complete examples? (with .java)
>> >>
>> >>
>> >> Anywhere, if  you consider that the best is that I send you the  
>> program,
>> >> for me is no problema, I will send it to you.
>> >>
>> >> The lib folder has the next jars
>> >>
>> >> commons-codec-1.5.jar
>> >> httpcore-4.0.jar
>> >> javassist.jar
>> >> log4j-1.2.16.jar
>> >> openrdf-alibaba-2.0-beta7.jar
>> >> slf4-api-1.5.8.jar
>> >> slf4j-jdk14-1.5.8.jar
>> >> openrdf-sesame-2.3.3-onejar.jar
>> >>
>> >> Please, tell me if is the same for your program, could be this is the
>> >> problem, the jar and the classpath.
>> >>
>> >> Thanks again, Javier.
>> >>
>> >>
>> >>
>> >>
>> >> En 14/04/2011 15:19:36, James Leigh <[hidden email]>  
>> escribió:
>> >>
>> >> > Hi Javier,
>> >> >
>> >> > I wasn't able to reproduce your problem (works for me). Because of  
>> the
>> >> > stack trace I think you might have multiple versions of AliBaba in
>> >> your
>> >> > classpath (is that possible?). Otherwise, please try to produce a
>> >> small
>> >> > program you can send me so I can see it fail.
>> >> >
>> >> > Also, the getConnection() method returns a *new* connection each  
>> time,
>> >> > so you need to close it when you are finished with the connection.
>> >> >
>> >> > James
>> >> >
>> >> > On Thu, 2011-04-14 at 13:38 +0200, Javier Sevilla wrote:
>> >> >> Hello
>> >> >>
>> >> >> I'm a newbie in the alibaba system.
>> >> >>
>> >> >> I have downloaded the last version (2-0.beta 7) and I don't know  
>> the
>> >> >> reason about I can't get the value a simple property from a very
>> >> simple
>> >> >> class instance.
>> >> >>
>> >> >> I tell you the context....
>> >> >>
>> >> >> I use an ontology with the Class "Ayuda" with the property "serie"
>> >> >> (single
>> >> >> string)
>> >> >>
>> >> >> I have developed Ayuda.java with this source code (following the
>> >> >> documentation, like Document sample):
>> >> >>
>> >> >> ----------------------- Ayuda.java------------------
>> >> >>
>> >> >>
>> >> >> import org.openrdf.repository.object.annotations.iri;
>> >> >>
>> >> >> @iri(Ayuda.NS + "Ayuda")
>> >> >>
>> >> >>
>> >> >> public class Ayuda {
>> >> >>
>> >> >>  public static final String NS =
>> >> >> "http://www.icontents.com/Discapacidad.owl#";
>> >> >>
>> >> >>  @iri(NS + "serie") String serie;
>> >> >>
>> >> >>  public String getSerie() {
>> >> >>    return serie;
>> >> >>  }
>> >> >>  public void setSerie(String serie) {
>> >> >>    this.serie = serie;
>> >> >>  }
>> >> >> }
>> >> >>
>> >> >> ---------------------------------------------------
>> >> >>
>> >> >> The class is mapped in the META-INF\org.openrdf.concepts
>> >> >>
>> >> >> org.icontents.ontology.persistence.system.Ayuda =
>> >> >> http://www.icontents.com/Discapacidad.owl#Ayuda
>> >> >>
>> >> >> When this entry is not set, appears unregistered type errors, now  
>> is
>> >> ok.
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >> Once the repository is initialized (and works, cause I tested it
>> >> with a
>> >> >> normal SPARQL query) I write this source code:
>> >> >>
>> >> >>  
>> ---------------------------------------------------------------------
>> >> >> ValueFactory vf = session.getConnection().getValueFactory();
>> >> >> URI id =
>> >> >> vf.createURI("http://www.icontents.com/Discapacidad.owl#Ayuda_4");
>> >> >>
>> >> >> // The uri of the instance is
>> >> >> http://www.icontents.com/Discapacidad.owl#Ayuda_4
>> >> >>
>> >> >>
>> >> >> try {
>> >> >> Ayuda ayuda;
>> >> >> try {
>> >> >> ayuda = session.getConnection().getObject(Ayuda.class,id);
>> >> >> System.out.println("Result "+ayuda.getSerie());
>> >> >> } catch (QueryEvaluationException e) {
>> >> >> e.printStackTrace();
>> >> >> }
>> >> >> } catch (RepositoryException e) {
>> >> >> e.printStackTrace();
>> >> >> }
>> >> >>
>> >> >> -----------------------------------------------
>> >> >> These lines are written following the documentation instructions
>> >> >> When I execute it, there are not any problem, error, exception,...
>> >> >> But the result, the value of the serie property is null, and if I  
>> put
>> >> >> directly "ayuda" in the system.out apperas an error, that I write
>> >> >> bellow.
>> >> >>
>> >> >> I only want to retrieve the value of a property, I think that this
>> >> step
>> >> >> must be so easy. I think that something is wrong, but I don't
>> >> understand
>> >> >> what happens. PLease, can help me somebody???
>> >> >>
>> >> >>
>> >> >> Here is the error that appear if I put "ayuda" directly in the
>> >> >> system.out,
>> >> >> If I put ayuda.getSerie() simply returns null.
>> >> >>
>> >> >> -----------------------------------
>> >> >>
>> >> >> Exception in thread "main" java.lang.StackOverflowError
>> >> >> at java.util.ArrayList.<init>(Unknown Source)
>> >> >> at
>> >> >>
>> >>  
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.<init>(InvocationMessageContext.java:110)
>> >> >> at
>> >> >>
>> >>  
>> object.proxies._fffffcb9769b98df._EntityProxyffe83308686f8980.toString(_EntityProxyffe83308686f8980.java)
>> >> >> at
>> >> >>
>> >>  
>> object.behaviours.org.openrdf.http.object.behaviours.HTTPFileObjectSupportAbstractClass.toString(HTTPFileObjectSupportAbstractClass.java)
>> >> >> at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
>> >> >> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown  
>> Source)
>> >> >> at java.lang.reflect.Method.invoke(Unknown Source)
>> >> >> at
>> >> >>
>> >>  
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.nextResponse(InvocationMessageContext.java:301)
>> >> >> at
>> >> >>
>> >>  
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.proceed(InvocationMessageContext.java:220)
>> >> >> at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
>> >> >> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown  
>> Source)
>> >> >> at java.lang.reflect.Method.invoke(Unknown Source)
>> >> >> at
>> >> >>
>> >>  
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.invoke(InvocationMessageContext.java:146)
>> >> >> at $Proxy8.proceed(Unknown Source)
>> >> >> at
>> >> >>
>> >>  
>> org.openrdf.repository.object.behaviours.RDFObjectImpl.toString(RDFObjectImpl.java:86)
>> >> >> at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
>> >> >> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown  
>> Source)
>> >> >> at java.lang.reflect.Method.invoke(Unknown Source)
>> >> >> at
>> >> >>
>> >>  
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.nextResponse(InvocationMessageContext.java:294)
>> >> >> at
>> >> >>
>> >>  
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.getFunctionalObjectResponse(InvocationMessageContext.java:251)
>> >> >> at
>> >> >>
>> >>  
>> object.proxies._fffffcb9769b98df._EntityProxyffe83308686f8980.toString(_EntityProxyffe83308686f8980.java)
>> >> >> at
>> >> >>
>> >>  
>> object.behaviours.org.openrdf.http.object.behaviours.HTTPFileObjectSupportAbstractClass.toString(HTTPFileObjectSupportAbstractClass.java)
>> >> >> at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
>> >> >> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown  
>> Source)
>> >> >> at java.lang.reflect.Method.invoke(Unknown Source)
>> >> >> at
>> >> >>
>> >>  
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.nextResponse(InvocationMessageContext.java:301)
>> >> >> at
>> >> >>
>> >>  
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.proceed(InvocationMessageContext.java:220)
>> >> >> at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
>> >> >> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown  
>> Source)
>> >> >> at java.lang.reflect.Method.invoke(Unknown Source)
>> >> >> at
>> >> >>
>> >>  
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.invoke(InvocationMessageContext.java:146)
>> >> >> at $Proxy8.proceed(Unknown Source)
>> >> >> at
>> >> >>
>> >>  
>> org.openrdf.repository.object.behaviours.RDFObjectImpl.toString(RDFObjectImpl.java:86)
>> >> >> at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
>> >> >> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown  
>> Source)
>> >> >> at java.lang.reflect.Method.invoke(Unknown Source)
>> >> >> at
>> >> >>
>> >>  
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.nextResponse(InvocationMessageContext.java:294)
>> >> >> at
>> >> >>
>> >>  
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.getFunctionalObjectResponse(InvocationMessageContext.java:251)
>> >> >> at
>> >> >>
>> >>  
>> object.proxies._fffffcb9769b98df._EntityProxyffe83308686f8980.toString(_EntityProxyffe83308686f8980.java)
>> >> >> at
>> >> >>
>> >>  
>> object.behaviours.org.openrdf.http.object.behaviours.HTTPFileObjectSupportAbstractClass.toString(HTTPFileObjectSupportAbstractClass.java)
>> >> >> at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
>> >> >> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown  
>> Source)
>> >> >> at java.lang.reflect.Method.invoke(Unknown Source)
>> >> >> at
>> >> >>
>> >>  
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.nextResponse(InvocationMessageContext.java:301)
>> >> >> at
>> >> >>
>> >>  
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.proceed(InvocationMessageContext.java:220)
>> >> >> at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
>> >> >> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown  
>> Source)
>> >> >> at java.lang.reflect.Method.invoke(Unknown Source)
>> >> >> at
>> >> >>
>> >>  
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.invoke(InvocationMessageContext.java:146)
>> >> >> at $Proxy8.proceed(Unknown Source)
>> >> >> at
>> >> >>
>> >>  
>> org.openrdf.repository.object.behaviours.RDFObjectImpl.toString(RDFObjectImpl.java:86)
>> >> >> at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
>> >> >> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown  
>> Source)
>> >> >> at java.lang.reflect.Method.invoke(Unknown Source)
>> >> >> at
>> >> >>
>> >>  
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.nextResponse(InvocationMessageContext.java:294)
>> >> >> at
>> >> >>
>> >>  
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.getFunctionalObjectResponse(InvocationMessageContext.java:251)
>> >> >> at
>> >> >>
>> >>  
>> object.proxies._fffffcb9769b98df._EntityProxyffe83308686f8980.toString(_EntityProxyffe83308686f8980.java)
>> >> >> at
>> >> >>
>> >>  
>> object.behaviours.org.openrdf.http.object.behaviours.HTTPFileObjectSupportAbstractClass.toString(HTTPFileObjectSupportAbstractClass.java)
>> >> >> at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
>> >> >> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown  
>> Source)
>> >> >> at java.lang.reflect.Method.invoke(Unknown Source)
>> >> >> at
>> >> >>
>> >>  
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.nextResponse(InvocationMessageContext.java:301)
>> >> >> at
>> >> >>
>> >>  
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.proceed(InvocationMessageContext.java:220)
>> >> >> at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
>> >> >> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown  
>> Source)
>> >> >> at java.lang.reflect.Method.invoke(Unknown Source)
>> >> >> at
>> >> >>
>> >>  
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.invoke(InvocationMessageContext.java:146)
>> >> >> at $Proxy8.proceed(Unknown Source)
>> >> >> at
>> >> >>
>> >>  
>> org.openrdf.repository.object.behaviours.RDFObjectImpl.toString(RDFObjectImpl.java:86)
>> >> >> at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
>> >> >> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown  
>> Source)
>> >> >> at java.lang.reflect.Method.invoke(Unknown Source)
>> >> >> at
>> >> >>
>> >>  
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.nextResponse(InvocationMessageContext.java:294)
>> >> >> at
>> >> >>
>> >>  
>> org.openrdf.repository.object.composition.helpers.InvocationMessageContext.getFunctionalObjectResponse(InvocationMessageContext.java:251)
>> >> >> at
>> >> >>
>> >>  
>> object.proxies._fffffcb9769b98df._EntityProxyffe83308686f8980.toString(_EntityProxyffe83308686f8980.java)
>> >> >> at
>> >> >>
>> >>  
>> object.behaviours.org.openrdf.http.object.behaviours.HTTPFileObjectSupportAbstractClass.toString(HTTPFileObjectSupportAbstractClass.java)
>> >> >> at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
>> >> >> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown  
>> Source)
>> >> >> at java.lang.reflect.Method.invoke(Unknown Source)
>> >> >> -----------------------------------
>> >> >>
>> >> >>
>> >> >> Thanks for all in advance!!!
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> >
>> >>  
>> ------------------------------------------------------------------------------
>> >> > Benefiting from Server Virtualization: Beyond Initial Workload
>> >> > Consolidation -- Increasing the use of server virtualization is a  
>> top
>> >> > priority.Virtualization can reduce costs, simplify management, and
>> >> > improve
>> >> > application availability and disaster protection. Learn more about
>> >> > boosting
>> >> > the value of server virtualization.
>> >> http://p.sf.net/sfu/vmware-sfdev2dev
>> >> > _______________________________________________
>> >> > Sesame-general mailing list
>> >> > [hidden email]
>> >> > https://lists.sourceforge.net/lists/listinfo/sesame-general
>> >> >
>> >>
>> >>
>> >
>> >
>> >
>>
>>
>
>
>


--
__________________________________________________
Javier Sevilla Peris
Grupo de Autismo y Dificultades de Aprendizaje
Universidad de Valencia
[hidden email]
http://autismo.uv.es
T: (+34)963543573
F: (+34)963543550
__________________________________________________

------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Sesame-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sesame-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to set multiple objects

Javier Sevilla
In reply to this post by Javier Sevilla

Hello

Alibaba is fantastic, it works fine with simple data types, but how can I  
set and retrieve multiple objects?
In the example is easy to see how to get and set simple data types  
(e.g.title)

Following the example data, imagine that the Document class has a property  
called written_by which is a multiple objects of class "Writer"

How can I do the mapping (with set, with add?):

- setWriter( Vector? Collection?)...
- addWriter(Writer)

Please, help me.

Regards, Javier.

__________________________________________________
Javier Sevilla Peris
Grupo de Autismo y Dificultades de Aprendizaje
Universidad de Valencia
[hidden email]
http://autismo.uv.es
T: (+34)963543573
F: (+34)963543550
__________________________________________________

------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Sesame-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sesame-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to set multiple objects

pointbreak+openrdf
Method declarations:

Set<Writer> getWriters();
void setWriters(Set<Writer> writers);

Then to add a writer in your code you can call:

document.getWriters().add(anotherWriter);


On Mon, 18 Apr 2011 21:24 +0200, "Javier Sevilla" <[hidden email]>
wrote:

>
> Hello
>
> Alibaba is fantastic, it works fine with simple data types, but how can I
> set and retrieve multiple objects?
> In the example is easy to see how to get and set simple data types  
> (e.g.title)
>
> Following the example data, imagine that the Document class has a
> property  
> called written_by which is a multiple objects of class "Writer"
>
> How can I do the mapping (with set, with add?):
>
> - setWriter( Vector? Collection?)...
> - addWriter(Writer)
>
> Please, help me.
>
> Regards, Javier.
>
> __________________________________________________
> Javier Sevilla Peris
> Grupo de Autismo y Dificultades de Aprendizaje
> Universidad de Valencia
> [hidden email]
> http://autismo.uv.es
> T: (+34)963543573
> F: (+34)963543550
> __________________________________________________
>
> ------------------------------------------------------------------------------
> Benefiting from Server Virtualization: Beyond Initial Workload
> Consolidation -- Increasing the use of server virtualization is a top
> priority.Virtualization can reduce costs, simplify management, and
> improve
> application availability and disaster protection. Learn more about
> boosting
> the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
> _______________________________________________
> Sesame-general mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/sesame-general
>

------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Sesame-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sesame-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to set multiple objects

Javier Sevilla
Thanks for the quiclk answer, but I think I need aditional things to do.

I mean, I have an ontology with two classes "Actividad" and "Objetivo"

There is a property in "Actividad" called "trabaja" with multiple  
"Objetivo".

I have created the instance of "Actividad" with the URI  
"http://www.icontents.com/Disability.owl#Actividad_2"
I have created two instances of "Objetivo" with the URIs:
  - http://www.icontents.com/Disability.owl#Objetivo_1
  - http://www.icontents.com/Disability.owl#Objetivo_2

The instance of "Actividad" (Actividad_2)is related with the instances  
"Objetivo" (Objetivo_1 Objetivo_2)

The source code I use is...

Actividad.java
------------------------------------------

@iri(Actividad.NS + "Actividad")


public class Actividad extends GenericPOJO{

          public static final String NS =  
"http://www.icontents.com/Disability.owl#";

          @iri(NS + "trabaja") Set trabaja;

          Set<Objetivo> getTrabaja() {
                  return trabaja;
          }
       
          void setTrabaja(Set<Objetivo> trabaja) {
                  this.trabaja = trabaja;
          }

}
---------------------------------------------------------------------------




Objetivo.java
------------------------------------------

@iri(Objetivo.NS + "Objetivo")


public class Objetivo extends GenericPOJO{

          public static final String NS =  
"http://www.icontents.com/Disability.owl#";
}
---------------------------------------------------------------------------




In SesameTest.java I only put the source code to get the objet Actividad  
with the adequate uri.
I use this code for get other objetct from this ontology, and from others,  
and works ok.
I only change the name of the class, and the URI. I don't put here in orde  
to reduce the post, cause is the same like others, and its do it following  
the alibaba documentation philosophy.

Well, when I try to get the object Actividad is generated this exception:

----------------------------------------

_EntityProxyff271a113ab35f56 implements HTTPFileObject ManagedRDFObject  
RDFObject VersionedObject FileObject ProxyObject Mergeable Refreshable  
PropertyConsumer
Exception in thread "main"  
org.openrdf.repository.object.exceptions.ObjectCompositionException:  
org.openrdf.repository.object.exceptions.ObjectCompositionException:  
[source error] setTrabaja(java.util.Set) not found in  
object.behaviours.org.adapta.ontology.persistence.Actividad$setTrabaja1689dc97FieldPopulater  
for {return ($r)  
_$getActividad$setTrabaja1689dc97FieldPopulater8d42d3b2().setTrabaja($$);
} for entity with roles: [HTTPFileObject, HTTPFileObjectSupport,  
RDFObjectImpl, Actividad, VersionedObjectSupport, ProxyObjectSupport]
        at  
org.openrdf.repository.object.composition.ClassResolver.resolveRoles(ClassResolver.java:141)
        at  
org.openrdf.repository.object.composition.ClassResolver.resolveIndividualEntity(ClassResolver.java:129)
        at  
org.openrdf.repository.object.composition.ClassResolver.resolveEntity(ClassResolver.java:121)
        at  
org.openrdf.repository.object.ObjectFactory.createObject(ObjectFactory.java:208)
        at  
org.openrdf.repository.object.result.ObjectCursor.createRDFObject(ObjectCursor.java:113)
        at  
org.openrdf.repository.object.result.ObjectCursor.getNextElement(ObjectCursor.java:81)
        at  
info.aduna.iteration.LookAheadIteration.lookAhead(LookAheadIteration.java:80)
        at  
info.aduna.iteration.LookAheadIteration.hasNext(LookAheadIteration.java:49)
        at org.openrdf.result.impl.ResultImpl.next(ResultImpl.java:87)
        at  
org.openrdf.repository.object.ObjectConnection$1.getNextElement(ObjectConnection.java:505)
        at  
info.aduna.iteration.LookAheadIteration.lookAhead(LookAheadIteration.java:80)
        at  
info.aduna.iteration.LookAheadIteration.hasNext(LookAheadIteration.java:49)
        at org.openrdf.result.impl.ResultImpl.next(ResultImpl.java:87)
        at org.openrdf.result.impl.ResultImpl.singleResult(ResultImpl.java:115)
        at  
org.openrdf.repository.object.ObjectConnection.getObject(ObjectConnection.java:448)
        at  
org.openrdf.repository.object.ObjectConnection.getObject(ObjectConnection.java:440)
        at org.adapta.ontology.persistence.SesameTest.test3(SesameTest.java:99)
        at org.adapta.ontology.persistence.SesameTest.main(SesameTest.java:137)
Caused by:  
org.openrdf.repository.object.exceptions.ObjectCompositionException:  
[source error] setTrabaja(java.util.Set) not found in  
object.behaviours.org.adapta.ontology.persistence.Actividad$setTrabaja1689dc97FieldPopulater  
for {return ($r)  
_$getActividad$setTrabaja1689dc97FieldPopulater8d42d3b2().setTrabaja($$);
}
        at  
org.openrdf.repository.object.composition.MethodBuilder.end(MethodBuilder.java:105)
        at  
org.openrdf.repository.object.composition.helpers.ClassCompositor.implementMethod(ClassCompositor.java:329)
        at  
org.openrdf.repository.object.composition.helpers.ClassCompositor.compose(ClassCompositor.java:153)
        at  
org.openrdf.repository.object.composition.ClassResolver.composeBehaviours(ClassResolver.java:197)
        at  
org.openrdf.repository.object.composition.ClassResolver.getComposedBehaviours(ClassResolver.java:152)
        at  
org.openrdf.repository.object.composition.ClassResolver.resolveRoles(ClassResolver.java:135)
        ... 18 more
Caused by: javassist.CannotCompileException: [source error]  
setTrabaja(java.util.Set) not found in  
object.behaviours.org.adapta.ontology.persistence.Actividad$setTrabaja1689dc97FieldPopulater
        at javassist.CtBehavior.setBody(CtBehavior.java:409)
        at javassist.CtBehavior.setBody(CtBehavior.java:375)
        at  
org.openrdf.repository.object.composition.MethodBuilder.end(MethodBuilder.java:93)
        ... 23 more
Caused by: compile error: setTrabaja(java.util.Set) not found in  
object.behaviours.org.adapta.ontology.persistence.Actividad$setTrabaja1689dc97FieldPopulater
        at javassist.compiler.TypeChecker.atMethodCallCore(TypeChecker.java:716)
        at javassist.compiler.TypeChecker.atCallExpr(TypeChecker.java:681)
        at javassist.compiler.JvstTypeChecker.atCallExpr(JvstTypeChecker.java:156)
        at javassist.compiler.ast.CallExpr.accept(CallExpr.java:45)
        at  
javassist.compiler.JvstTypeChecker.atCastToRtype(JvstTypeChecker.java:112)
        at javassist.compiler.JvstTypeChecker.atCastExpr(JvstTypeChecker.java:93)
        at javassist.compiler.ast.CastExpr.accept(CastExpr.java:54)
        at javassist.compiler.CodeGen.doTypeCheck(CodeGen.java:241)
        at javassist.compiler.CodeGen.compileExpr(CodeGen.java:228)
        at javassist.compiler.JvstCodeGen.atReturnStmnt(JvstCodeGen.java:415)
        at javassist.compiler.CodeGen.atStmnt(CodeGen.java:362)
        at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49)
        at javassist.compiler.CodeGen.atStmnt(CodeGen.java:350)
        at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49)
        at javassist.compiler.CodeGen.atMethodBody(CodeGen.java:291)
        at javassist.compiler.Javac.compileBody(Javac.java:222)
        at javassist.CtBehavior.setBody(CtBehavior.java:401)
        ... 25 more

----------------------------------------



Please, what's happen here? Where is the problem:

- The object definition?
- The ontology?


Thanks form all, Javi.





__________________________________________________
Javier Sevilla Peris
Grupo de Autismo y Dificultades de Aprendizaje
Universidad de Valencia
[hidden email]
http://autismo.uv.es
T: (+34)963543573
F: (+34)963543550
__________________________________________________

------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Sesame-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sesame-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to set multiple objects

Javier Sevilla
In reply to this post by pointbreak+openrdf


Thanks for the quiclk answer, but I think I need aditional things to do.

I mean, I have an ontology with two classes "Actividad" and "Objetivo"

There is a property in "Actividad" called "trabaja" with multiple  
"Objetivo".

I have created the instance of "Actividad" with the URI  
"http://www.icontents.com/Disability.owl#Actividad_2"
I have created two instances of "Objetivo" with the URIs:
  - http://www.icontents.com/Disability.owl#Objetivo_1
  - http://www.icontents.com/Disability.owl#Objetivo_2

The instance of "Actividad" (Actividad_2)is related with the instances  
"Objetivo" (Objetivo_1 Objetivo_2)

The source code I use is...

Actividad.java
------------------------------------------

@iri(Actividad.NS + "Actividad")


public class Actividad extends GenericPOJO{

          public static final String NS =  
"http://www.icontents.com/Disability.owl#";

          @iri(NS + "trabaja") Set trabaja;

          Set<Objetivo> getTrabaja() {
                  return trabaja;
          }
       
          void setTrabaja(Set<Objetivo> trabaja) {
                  this.trabaja = trabaja;
          }

}
---------------------------------------------------------------------------




Objetivo.java
------------------------------------------

@iri(Objetivo.NS + "Objetivo")


public class Objetivo extends GenericPOJO{

          public static final String NS =  
"http://www.icontents.com/Disability.owl#";
}
---------------------------------------------------------------------------




In SesameTest.java I only put the source code to get the objet Actividad  
with the adequate uri.
I use this code for get other objetct from this ontology, and from others,  
and works ok.
I only change the name of the class, and the URI. I don't put here in orde  
to reduce the post, cause is the same like others, and its do it following  
the alibaba documentation philosophy.

Well, when I try to get the object Actividad is generated this exception:

----------------------------------------

_EntityProxyff271a113ab35f56 implements HTTPFileObject ManagedRDFObject  
RDFObject VersionedObject FileObject ProxyObject Mergeable Refreshable  
PropertyConsumer
Exception in thread "main"  
org.openrdf.repository.object.exceptions.ObjectCompositionException:  
org.openrdf.repository.object.exceptions.ObjectCompositionException:  
[source error] setTrabaja(java.util.Set) not found in  
object.behaviours.org.adapta.ontology.persistence.Actividad$setTrabaja1689dc97FieldPopulater  
for {return ($r)  
_$getActividad$setTrabaja1689dc97FieldPopulater8d42d3b2().setTrabaja($$);
} for entity with roles: [HTTPFileObject, HTTPFileObjectSupport,  
RDFObjectImpl, Actividad, VersionedObjectSupport, ProxyObjectSupport]
        at  
org.openrdf.repository.object.composition.ClassResolver.resolveRoles(ClassResolver.java:141)
        at  
org.openrdf.repository.object.composition.ClassResolver.resolveIndividualEntity(ClassResolver.java:129)
        at  
org.openrdf.repository.object.composition.ClassResolver.resolveEntity(ClassResolver.java:121)
        at  
org.openrdf.repository.object.ObjectFactory.createObject(ObjectFactory.java:208)
        at  
org.openrdf.repository.object.result.ObjectCursor.createRDFObject(ObjectCursor.java:113)
        at  
org.openrdf.repository.object.result.ObjectCursor.getNextElement(ObjectCursor.java:81)
        at  
info.aduna.iteration.LookAheadIteration.lookAhead(LookAheadIteration.java:80)
        at  
info.aduna.iteration.LookAheadIteration.hasNext(LookAheadIteration.java:49)
        at org.openrdf.result.impl.ResultImpl.next(ResultImpl.java:87)
        at  
org.openrdf.repository.object.ObjectConnection$1.getNextElement(ObjectConnection.java:505)
        at  
info.aduna.iteration.LookAheadIteration.lookAhead(LookAheadIteration.java:80)
        at  
info.aduna.iteration.LookAheadIteration.hasNext(LookAheadIteration.java:49)
        at org.openrdf.result.impl.ResultImpl.next(ResultImpl.java:87)
        at org.openrdf.result.impl.ResultImpl.singleResult(ResultImpl.java:115)
        at  
org.openrdf.repository.object.ObjectConnection.getObject(ObjectConnection.java:448)
        at  
org.openrdf.repository.object.ObjectConnection.getObject(ObjectConnection.java:440)
        at org.adapta.ontology.persistence.SesameTest.test3(SesameTest.java:99)
        at org.adapta.ontology.persistence.SesameTest.main(SesameTest.java:137)
Caused by:  
org.openrdf.repository.object.exceptions.ObjectCompositionException:  
[source error] setTrabaja(java.util.Set) not found in  
object.behaviours.org.adapta.ontology.persistence.Actividad$setTrabaja1689dc97FieldPopulater  
for {return ($r)  
_$getActividad$setTrabaja1689dc97FieldPopulater8d42d3b2().setTrabaja($$);
}
        at  
org.openrdf.repository.object.composition.MethodBuilder.end(MethodBuilder.java:105)
        at  
org.openrdf.repository.object.composition.helpers.ClassCompositor.implementMethod(ClassCompositor.java:329)
        at  
org.openrdf.repository.object.composition.helpers.ClassCompositor.compose(ClassCompositor.java:153)
        at  
org.openrdf.repository.object.composition.ClassResolver.composeBehaviours(ClassResolver.java:197)
        at  
org.openrdf.repository.object.composition.ClassResolver.getComposedBehaviours(ClassResolver.java:152)
        at  
org.openrdf.repository.object.composition.ClassResolver.resolveRoles(ClassResolver.java:135)
        ... 18 more
Caused by: javassist.CannotCompileException: [source error]  
setTrabaja(java.util.Set) not found in  
object.behaviours.org.adapta.ontology.persistence.Actividad$setTrabaja1689dc97FieldPopulater
        at javassist.CtBehavior.setBody(CtBehavior.java:409)
        at javassist.CtBehavior.setBody(CtBehavior.java:375)
        at  
org.openrdf.repository.object.composition.MethodBuilder.end(MethodBuilder.java:93)
        ... 23 more
Caused by: compile error: setTrabaja(java.util.Set) not found in  
object.behaviours.org.adapta.ontology.persistence.Actividad$setTrabaja1689dc97FieldPopulater
        at javassist.compiler.TypeChecker.atMethodCallCore(TypeChecker.java:716)
        at javassist.compiler.TypeChecker.atCallExpr(TypeChecker.java:681)
        at javassist.compiler.JvstTypeChecker.atCallExpr(JvstTypeChecker.java:156)
        at javassist.compiler.ast.CallExpr.accept(CallExpr.java:45)
        at  
javassist.compiler.JvstTypeChecker.atCastToRtype(JvstTypeChecker.java:112)
        at javassist.compiler.JvstTypeChecker.atCastExpr(JvstTypeChecker.java:93)
        at javassist.compiler.ast.CastExpr.accept(CastExpr.java:54)
        at javassist.compiler.CodeGen.doTypeCheck(CodeGen.java:241)
        at javassist.compiler.CodeGen.compileExpr(CodeGen.java:228)
        at javassist.compiler.JvstCodeGen.atReturnStmnt(JvstCodeGen.java:415)
        at javassist.compiler.CodeGen.atStmnt(CodeGen.java:362)
        at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49)
        at javassist.compiler.CodeGen.atStmnt(CodeGen.java:350)
        at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49)
        at javassist.compiler.CodeGen.atMethodBody(CodeGen.java:291)
        at javassist.compiler.Javac.compileBody(Javac.java:222)
        at javassist.CtBehavior.setBody(CtBehavior.java:401)
        ... 25 more

----------------------------------------



Please, what's happen here? Where is the problem:

- The object definition?
- The ontology?


Thanks form all, Javi.
__________________________________________________
Javier Sevilla Peris
Grupo de Autismo y Dificultades de Aprendizaje
Universidad de Valencia
[hidden email]
http://autismo.uv.es
T: (+34)963543573
F: (+34)963543550
__________________________________________________

------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Sesame-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sesame-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to set multiple objects

James Leigh
On Tue, 2011-04-19 at 00:08 +0200, Javier Sevilla wrote:

>
> Thanks for the quiclk answer, but I think I need aditional things to do.
>
> I mean, I have an ontology with two classes "Actividad" and "Objetivo"
>
> There is a property in "Actividad" called "trabaja" with multiple  
> "Objetivo".
>
> I have created the instance of "Actividad" with the URI  
> "http://www.icontents.com/Disability.owl#Actividad_2"
> I have created two instances of "Objetivo" with the URIs:
>   - http://www.icontents.com/Disability.owl#Objetivo_1
>   - http://www.icontents.com/Disability.owl#Objetivo_2
>
> The instance of "Actividad" (Actividad_2)is related with the instances  
> "Objetivo" (Objetivo_1 Objetivo_2)
>
> The source code I use is...
>
> Actividad.java
> ------------------------------------------
>
> @iri(Actividad.NS + "Actividad")
>
>
> public class Actividad extends GenericPOJO{
>
>  public static final String NS =  
> "http://www.icontents.com/Disability.owl#";
>
>  @iri(NS + "trabaja") Set trabaja;
>
>  Set<Objetivo> getTrabaja() {
>  return trabaja;
>  }
>
>  void setTrabaja(Set<Objetivo> trabaja) {
>  this.trabaja = trabaja;
>  }
>
> }
> ---------------------------------------------------------------------------
>
>
>
>
> Objetivo.java
> ------------------------------------------
>
> @iri(Objetivo.NS + "Objetivo")
>
>
> public class Objetivo extends GenericPOJO{
>
>  public static final String NS =  
> "http://www.icontents.com/Disability.owl#";
> }
> ---------------------------------------------------------------------------
>
>
>
>
> In SesameTest.java I only put the source code to get the objet Actividad  
> with the adequate uri.
> I use this code for get other objetct from this ontology, and from others,  
> and works ok.
> I only change the name of the class, and the URI. I don't put here in orde  
> to reduce the post, cause is the same like others, and its do it following  
> the alibaba documentation philosophy.
>
> Well, when I try to get the object Actividad is generated this exception:
>
> ----------------------------------------
>
> _EntityProxyff271a113ab35f56 implements HTTPFileObject ManagedRDFObject  
> RDFObject VersionedObject FileObject ProxyObject Mergeable Refreshable  
> PropertyConsumer
> Exception in thread "main"  
> org.openrdf.repository.object.exceptions.ObjectCompositionException:  
> org.openrdf.repository.object.exceptions.ObjectCompositionException:  
> [source error] setTrabaja(java.util.Set) not found in  
> object.behaviours.org.adapta.ontology.persistence.Actividad$setTrabaja1689dc97FieldPopulater  
> for {return ($r)  
> _$getActividad$setTrabaja1689dc97FieldPopulater8d42d3b2().setTrabaja($$);
> } for entity with roles: [HTTPFileObject, HTTPFileObjectSupport,  
> RDFObjectImpl, Actividad, VersionedObjectSupport, ProxyObjectSupport]
>
> ----------------------------------------
>
>
>
> Please, what's happen here? Where is the problem:
>
> - The object definition?
> - The ontology?
>
>
> Thanks form all, Javi.

Hi Javi,

The getters and setters must be public or protected methods. When
private or default that are not found by the compiler.

James


------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Sesame-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sesame-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to set multiple objects

Javier Sevilla
Thanks James.

I put the methods with public attribute, and works fine.
I get and set the multiple data.

I only have a problem when I remove the data of the set.

I created an instance of "Actividad"
I created two instances of "Objetivo"

I save the "Actividad" instance with the multiple object property  
"trabaja" (with the last two instances of "Objetivo")

Like I said, I can save and retrieve without problems.

But when I want to remove a instance or both, it doesn't work.

I try putting setTrabaja(null) and setTrabaja(empty-set), in both cases  
the result is the same, the instance of "Actividad" maintains the initial  
"Objetivo" instances.


Another thing, is that I have created a property in the relation  
"trabaja", this property defines how good is the pair Actividad<->Objetivo  
(the possible values are "Poco", "Bastante", "Mucho", in english (Low,  
Normal, Too much"))
how can I read this value property?

Thanks again, Javier.


En 19/04/2011 03:07:30, James Leigh <[hidden email]> escribió:

> On Tue, 2011-04-19 at 00:08 +0200, Javier Sevilla wrote:
>>
>> Thanks for the quiclk answer, but I think I need aditional things to do.
>>
>> I mean, I have an ontology with two classes "Actividad" and "Objetivo"
>>
>> There is a property in "Actividad" called "trabaja" with multiple
>> "Objetivo".
>>
>> I have created the instance of "Actividad" with the URI
>> "http://www.icontents.com/Disability.owl#Actividad_2"
>> I have created two instances of "Objetivo" with the URIs:
>>   - http://www.icontents.com/Disability.owl#Objetivo_1
>>   - http://www.icontents.com/Disability.owl#Objetivo_2
>>
>> The instance of "Actividad" (Actividad_2)is related with the instances
>> "Objetivo" (Objetivo_1 Objetivo_2)
>>
>> The source code I use is...
>>
>> Actividad.java
>> ------------------------------------------
>>
>> @iri(Actividad.NS + "Actividad")
>>
>>
>> public class Actividad extends GenericPOJO{
>>
>>  public static final String NS =
>> "http://www.icontents.com/Disability.owl#";
>>
>>  @iri(NS + "trabaja") Set trabaja;
>>
>>  Set<Objetivo> getTrabaja() {
>>  return trabaja;
>>  }
>>
>>  void setTrabaja(Set<Objetivo> trabaja) {
>>  this.trabaja = trabaja;
>>  }
>>
>> }
>> ---------------------------------------------------------------------------
>>
>>
>>
>>
>> Objetivo.java
>> ------------------------------------------
>>
>> @iri(Objetivo.NS + "Objetivo")
>>
>>
>> public class Objetivo extends GenericPOJO{
>>
>>  public static final String NS =
>> "http://www.icontents.com/Disability.owl#";
>> }
>> ---------------------------------------------------------------------------
>>
>>
>>
>>
>> In SesameTest.java I only put the source code to get the objet Actividad
>> with the adequate uri.
>> I use this code for get other objetct from this ontology, and from  
>> others,
>> and works ok.
>> I only change the name of the class, and the URI. I don't put here in  
>> orde
>> to reduce the post, cause is the same like others, and its do it  
>> following
>> the alibaba documentation philosophy.
>>
>> Well, when I try to get the object Actividad is generated this  
>> exception:
>>
>> ----------------------------------------
>>
>> _EntityProxyff271a113ab35f56 implements HTTPFileObject ManagedRDFObject
>> RDFObject VersionedObject FileObject ProxyObject Mergeable Refreshable
>> PropertyConsumer
>> Exception in thread "main"
>> org.openrdf.repository.object.exceptions.ObjectCompositionException:
>> org.openrdf.repository.object.exceptions.ObjectCompositionException:
>> [source error] setTrabaja(java.util.Set) not found in
>> object.behaviours.org.adapta.ontology.persistence.Actividad$setTrabaja1689dc97FieldPopulater
>> for {return ($r)
>> _$getActividad$setTrabaja1689dc97FieldPopulater8d42d3b2().setTrabaja($$);
>> } for entity with roles: [HTTPFileObject, HTTPFileObjectSupport,
>> RDFObjectImpl, Actividad, VersionedObjectSupport, ProxyObjectSupport]
>>
>> ----------------------------------------
>>
>>
>>
>> Please, what's happen here? Where is the problem:
>>
>> - The object definition?
>> - The ontology?
>>
>>
>> Thanks form all, Javi.
>
> Hi Javi,
>
> The getters and setters must be public or protected methods. When
> private or default that are not found by the compiler.
>
> James
>
>
> ------------------------------------------------------------------------------
> Benefiting from Server Virtualization: Beyond Initial Workload
> Consolidation -- Increasing the use of server virtualization is a top
> priority.Virtualization can reduce costs, simplify management, and  
> improve
> application availability and disaster protection. Learn more about  
> boosting
> the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
> _______________________________________________
> Sesame-general mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/sesame-general
>


--
__________________________________________________
Javier Sevilla Peris
Grupo de Autismo y Dificultades de Aprendizaje
Universidad de Valencia
[hidden email]
http://autismo.uv.es
T: (+34)963543573
F: (+34)963543550
__________________________________________________

------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Sesame-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sesame-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to set multiple objects

James Leigh
Hi Javier,

On Tue, 2011-04-19 at 10:58 +0200, Javier Sevilla wrote:

> Thanks James.
>
> I put the methods with public attribute, and works fine.
> I get and set the multiple data.
>
> I only have a problem when I remove the data of the set.
>
> I created an instance of "Actividad"
> I created two instances of "Objetivo"
>
> I save the "Actividad" instance with the multiple object property  
> "trabaja" (with the last two instances of "Objetivo")
>
> Like I said, I can save and retrieve without problems.
>
> But when I want to remove a instance or both, it doesn't work.
>
> I try putting setTrabaja(null) and setTrabaja(empty-set), in both cases  
> the result is the same, the instance of "Actividad" maintains the initial  
> "Objetivo" instances.
>

When an object is created outside of the repository then added to the
repository the values are copied into the repository (passed by value).
Any further changes to to object will not be reflected in the
repository. If you don't think this applies to you please post a
complete program to demonstrate what you are doing.

>
> Another thing, is that I have created a property in the relation  
> "trabaja", this property defines how good is the pair Actividad<->Objetivo  
> (the possible values are "Poco", "Bastante", "Mucho", in english (Low,  
> Normal, Too much"))
> how can I read this value property?
>
> Thanks again, Javier.
>

Your explanation of the data structure is not clear. What would this
look like in RDF triples?

Cheers,
James


------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Sesame-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sesame-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem Alibaba gettin an object simple property...always return null!!

Yke van Randen
This post has NOT been accepted by the mailing list yet.
In reply to this post by Javier Sevilla
I also encounter the same issue. My code for generating triples (based on the sample document class) and the answers James gave to Javier. I used alibaba 2.0 (downloaded today), modified javassist to a previous version. I tested Sailrepos and HTTPRepo (allows easier validation server side). my test method looks like
    private void setup() throws Exception {

        // create a repository
        // Repository store = new SailRepository(new MemoryStore());
        HTTPRepository store = new HTTPRepository("http://localhost:8180/openrdf-sesame", "e");
        store.initialize();
        store.setPreferredRDFFormat(RDFFormat.TURTLE);

// wrap in an object repository
        ObjectRepositoryFactory factory = new ObjectRepositoryFactory();
        ObjectRepositoryConfig config = factory.getConfig();
        config.addConcept(Document.class);
        ObjectRepository repository = factory.createRepository(config, store);
        ObjectConnection con = repository.getConnection();
        ValueFactory vf = con.getValueFactory();
        ObjectFactory objectFactory = con.getObjectFactory();
        repository.setQueryLanguage(QueryLanguage.SPARQL);

// add a Document to the repository using new document
        Document doc = objectFactory.createObject("http://example.com/data/2012/document_1", Document.class);
        doc.setTitle("Getting Started");
        doc.setAuthor("Jan");
        con.addDesignation(doc, Document.class);

// add a Document to the repository using Object factory
        URI id = vf.createURI("http://example.com/data/2012/document_2");
        Document docb = objectFactory.createObject(id, Document.class);
        docb.setTitle("2");
        docb.setAuthor("2");
        docb.setNumberOfPages(9);
        con.addDesignation(docb, Document.class);

        // show the data
        showData(store);  // simple method displays select * where { ?x ?y ?z }

        // dump as Turtle.
        con.export(new TurtleWriter(new FileOutputStream(new File("d:\\temp\\docs.ttl"))));

        // find all
        Result<Document> result = con.getObjects(Document.class);
        while (result.hasNext()) {
            System.out.println(result.next().toString());
        }
        result.close();

// retrieve a Document by id
        Document doc2 = con.getObject(Document.class, "http://example.com/data/2012/document_2");
        

        Object object = con.getObject("http://example.com/data/2012/document_2");
        System.out.println(doc2.toString());
        System.out.println(object.toString());

        ObjectQuery query = con.prepareObjectQuery(
                "PREFIX gs:<http://example.com/rdf/2012/gs#>\n"
                + "SELECT ?doc WHERE {?doc gs:title ?title}");
        query.setObject("title", "Getting Started");
        Document afdoc = query.evaluate(Document.class).singleResult();
        System.out.println(afdoc.toString());
// close everything down
        con.close();
        repository.shutDown();
    }
This leads to 7 triples (which is correct) and I validated that server side
<http://example.com/data/2012/document_1> <http://example.com/rdf/2012/gs#title> "Getting Started" ;
	<http://example.com/rdf/2012/gs#author> "Jan" ;
	a <http://example.com/rdf/2012/gs#Document> .

<http://example.com/data/2012/document_2> <http://example.com/rdf/2012/gs#title> "2" ;
	<http://example.com/rdf/2012/gs#author> "2" ;
	<http://example.com/rdf/2012/gs#pages> "9"^^<http://www.w3.org/2001/XMLSchema#int> ;
	a <http://example.com/rdf/2012/gs#Document> .
However if i fetch the objects all objects have null value properties (for title and author), pages is 0 due to being an int. Hope someone has an anwser.
Loading...