cyberborean / rdfbeans

Java persistence with RDF
Other
11 stars 12 forks source link

Allow passing inference flag and context parameters #26

Closed reckart closed 7 years ago

reckart commented 7 years ago

Cf. https://github.com/cyberborean/rdfbeans/issues/25

Although eventually, I am not using rdfbeans for loading/storing data atm. others might find these additional parameters useful.

wherget commented 7 years ago

a little bit of whitespace confusion, but other than that it looks good to me

cyberborean commented 7 years ago

Looks good!

It seems it addresses #20 as well?

twallmey commented 5 years ago

Im working with interfaces instead of classes. For this purpose having the inference parameter on createAll as well would be fine. Could you pls. supply the parameter for this kind of method, too?

twallmey commented 5 years ago

Are there any news about this? I would really appreciate having inferred statements included within the result set, too. Are there any plans when this feature will be available for bean interfaces?

I've had a look into the code and added the required feature. Would you mind to add/change the following lines of code within class RDFBeanManager to reflect the changes within the repository as well?

1) Change method signature of createAll (line: 760) public <T> Collection<T> createAll(Class<T> iface, boolean includeInferred, Resource... contexts)

2) Change parameter of method call (line: 771) sts = conn.getStatements(null, RDF.TYPE, type, includeInferred, contexts);

3) (Re)add all method signature and delegate call to method with new parameter public <T> Collection<T> createAll(Class<T> iface, Resource... contexts) throws RDFBeanException, RepositoryException { return createAll(iface, false, contexts); }

I'm not allowed to push my changes so it would be great if you could perform these changes!

Thanks a lot,

Thorben

cyberborean commented 5 years ago

The change you have suggested only affects identification of resources for a specific RDF type. I think we have to consider inferred triples also on getters execution: so it needs a bit more work.

I'm also thinking if it would be better to have this flag as a RDFBeanManager property, rather than to pass it to each individual method.

twallmey commented 5 years ago

1) Considering inferred triples on getter execution as well would be perfect! 2) From my point of view the flag shouldn't be set as a property of RDFBeanManager. I would like to decide on each single call whether I want to get inferred triples or not. Setting the property on RDFBeanManger would require to have different instances for this purpose or re-instantiating a manager before every call.

twallmey commented 5 years ago

Are there any news about this topic? I'm currently working with a slightly modified version of RDFBeans that contains my three suggested changes. That's fine for my requirements but I do understand that the issue should be solved in a more generic way.

Do you have an idea when the issued could be solved? For our team it is a bit difficult to work with a modified version that isn't archived officially within Maven. It would be great if this issue would be fixed.

Perhaps you can announce a timeline?