Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contribution of a Spring/RDF4J integration #3059

Closed
fkleedorfer opened this issue May 20, 2021 · 16 comments · Fixed by #3269
Closed

Contribution of a Spring/RDF4J integration #3059

fkleedorfer opened this issue May 20, 2021 · 16 comments · Fixed by #3269
Labels
📶 enhancement issue is a new feature or improvement M1 Fixed in milestone 1
Milestone

Comments

@fkleedorfer
Copy link
Contributor

fkleedorfer commented May 20, 2021

As discussed on the mailinglist, we have built a spring integration for RDF4J and are looking into contributing it, this issue is just for tracking the progress and having a place for community discussions in case there is anything to discuss.

Features

  • Integration with the spring transaction system (modeled after rdf4j-spring)
  • Result caching layer
  • Operation (query/update) stats exposed via JMX
  • Rdf4JTemplate (modeled after springs JDBCTemplate) and builders for assembling query/update executions
  • DAO base class
  • CRUD DAO base class
  • a few minor non spring-specific things that have been missing or we thought would be useful, such as some expressions for the sparql builder (BIND, IN/NOT_IN), a PropertyPath builder,

State of the Code

The code currently depends on rdf4j 3.2.2 and spring 5.2.7. Our JDK version is 12 (we are stuck on that because of a keycloak bug - but that's another story). Some of our developments are probably obsolete by now (e.g. the BIND expression). So before the contribution can be merged, there is some more maintenance to do, and it's likely that the code turns out to contribute to some existing modules in addition to the main contribution. A closer look at our use of the rdf4j API will be greatly appreciated - I suspect we aren't always using it optimally. Also, the spring code is tested in domain-specific integration tests that cannot really be moved, so we'll have to write new tests. Anyone who wants to chip in to help with these tasks is highly welcome!

Current Usage Context

In our project, we run a spring-boot server that offers a graphql endpoint and fetches the data via rdf4j. There may be a little bit of supporting code we could extract to make this architecture easier for users of our contribution - the Instrumentation class for commiting/rolling back the transaction after qraphql processing (or setting the transaction readonly if there are no mutations).

Status

A pull request will follow as soon as I have the final approval from our management.

@abrokenjester abrokenjester added the 📶 enhancement issue is a new feature or improvement label May 21, 2021
@fkleedorfer
Copy link
Contributor Author

Status update: still working on getting all the necessary people to approve. It's complicated.

@abrokenjester
Copy link
Contributor

Status update: still working on getting all the necessary people to approve. It's complicated.

No worries @fkleedorfer, I know it can be tricky to get all the noses pointing in the same direction. Let us know if there's anything we can do.

@fkleedorfer
Copy link
Contributor Author

There is progress: our project consortium has until July 16 to object to this plan. After that, we can go ahead.

@fkleedorfer
Copy link
Contributor Author

Success! There haven't been any objections from project partners. As soon as I get to it, I'll start a PR and move the code over.

@abrokenjester
Copy link
Contributor

@fkleedorfer that is great news! I'd really appreciate it if you and @JervenBolleman could also get your heads together on how to best integrate this: Jerven has an open Pull Request for a spring boot component as well (see #2905), so it seems to me that you two comparing notes and see how they fit together as part of the framework is the easiest way to get this integrated.

@abrokenjester
Copy link
Contributor

@fkleedorfer the contribution by Jereven (#2904) has now been merged into the develop branch, which means you're good to go to fork directly from the eclipse/rdf4j repo and base your contribution off our develop branch!

@abrokenjester
Copy link
Contributor

abrokenjester commented Aug 7, 2021

@fkleedorfer I'm filling out the contribution questionnaire for this. Can you provide me with the name of the organization I should list for you as the author of this work? And are there any other authors I should list? We need to provide contact details for each of the contributors: name, organization, email address and/or phone number, percent of contribution authored. Btw feel free to mail me directly if you don't feel comfortable putting these details here on a public ticket.

@fkleedorfer
Copy link
Contributor Author

fkleedorfer commented Aug 7, 2021 via email

@fkleedorfer
Copy link
Contributor Author

Wait, one thing is missing: the tx code is based on https://github.com/CarbonLDP/rdf4j-spring/ - I'll add an issue there and ask the authors to review this PR and say whether they are ok with it

@abrokenjester
Copy link
Contributor

@abrokenjester abrokenjester added the ✋ ECA-Pending requires the contributor to sign the ECA label Aug 7, 2021
@fkleedorfer
Copy link
Contributor Author

@mhernandeza @ameingast @MiguelAraCo @peacememories can you review the PR and claim @author tags where appropriate? Also, you are most welcome to do a more thorough review or add unit tests while you're at it ;-)

@abrokenjester abrokenjester linked a pull request Aug 8, 2021 that will close this issue
6 tasks
@fkleedorfer
Copy link
Contributor Author

I keep trying to log in to IPZilla, but although I can log in at the eclipse.org website just fine, my username/password combination is not accepted at IPZilla.

@abrokenjester
Copy link
Contributor

I keep trying to log in to IPZilla, but although I can log in at the eclipse.org website just fine, my username/password combination is not accepted at IPZilla.

I think that is because the IPZilla tool is only accessible for Eclipse members. Don't worry about it, I'm keeping an eye on it (though be prepared for the process to take a while).

Also, minor heads up: due to personal circumstances I will not be available as much to work on RDF4J in the next few weeks. I'm counting on my co-committers to keep things moving along, but I may not always immediately be able to jump in and reply.

abrokenjester added a commit that referenced this issue Oct 27, 2021
…-spring

Contribute Rdf4j Spring Integration
@abrokenjester abrokenjester removed the ✋ ECA-Pending requires the contributor to sign the ECA label Oct 27, 2021
@abrokenjester
Copy link
Contributor

Merged!

There's a followup task to add some documentation (for the rdf4j.org website and possibly also as a readme.md in the source repo itself). We can make a new ticket for that though.

@fkleedorfer
Copy link
Contributor Author

fkleedorfer commented Oct 31, 2021

I agree, it would be good to provide a how-to.

I think the straightforward way would be to put a project on github that does something simple, maybe just a REST interface to read/write with an in-memory RDF database that is initialized from a TTL file in the project. Make that as lean as possible and then describe it. Can we create such a demo project in the eclipse org or is there another org that is used for such purposes?

The artist data I used in the unit tests would be a good database to use for that.

With such a demo project, we could get some feedback from developers more easily. I think the code could use a round of criticism by prospective users and subsequent refactoring.

Having said that, I think we still weren't 100% about the spring-related module names, maybe we can make an issue for that, too, now that it's all in develop and easy to be moved about without creating conflicts.

@abrokenjester
Copy link
Contributor

I think the straightforward way would be to put a project on github that does something simple, maybe just a REST interface to read/write with an in-memory RDF database that is initialized from a TTL file in the project. Make that as lean as possible and then describe it. Can we create such a demo project in the eclipse org or is there another org that is used for such purposes?

We could use the main repo for this, under examples. It's a bit under-used at the moment, but it was sort of meant for this kind of thing (it also contains the example code for the RDF4J beginner's tutorial).

@abrokenjester abrokenjester added this to the 4.0.0 milestone Nov 13, 2021
@abrokenjester abrokenjester added the M1 Fixed in milestone 1 label Nov 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📶 enhancement issue is a new feature or improvement M1 Fixed in milestone 1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants