Skip to content

Anonymous RDFBeans by menas of interfaces #33

Description

@twallmey

Hi all,

I'm using RDFBeans (annotated interfaces) with success and would like to make use of anonymous/blank nodes now. I've followed every step from the documentation, but everytime I'm trying to assign an anonymous bean to another bean (calling setter of property) it throws an exception saying, that @RDFSubject annotation is missing. My code is:

KT aBean = this.manager.create(ID_UNKNOWN, beanType);
aBean.setId(null); //reset to make anonymous - id not set
bBean.setProp(aBean); //throws exception

I've tried a second way to solve my problem. This time I've explictely created an anonymous node and tried to create the bean afterwards:

Resource r = SimpleValueFactory.getInstance().createBNode();
Context ctx = this.manager.create(r, Context.class);

Unfortunately, this appraoch resulted in a different exception:
java.lang.ClassCastException: org.eclipse.rdf4j.model.impl.SimpleBNode cannot be cast to org.eclipse.rdf4j.model.IRI

As none of my solutions work I'm guessing that anonymous RDFBeans only work for classes and not for interfaces. Is that right? Or could someone tell me what I am doing wrong and point me into the correct direction?

Thanks in advance,

Thorben

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions