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
move modeshape-specific code out of the kernel-api #882
Conversation
This is good, but we need to go even further and get the JCR stuff out of the API code. But this is a good start. |
We totally need to go further, this is just a start... |
I think I will see if I can send a PR to this going a bit further. Maybe we can ping-pong it a bit. If not I will just merge this by itself. |
@@ -94,7 +94,10 @@ public static String getPropertyNameFromPredicate(final Node node, | |||
final Resource predicate, | |||
final Map<String, String> namespaceMapping) | |||
throws RepositoryException { | |||
final NamespaceRegistry namespaceRegistry = getNamespaceRegistry.apply(node); | |||
|
|||
final NamespaceRegistry namespaceRegistry = uncheck((final Node n) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was there are reason for not just using NamespaceTools.getNamespaceRegistry(n)
?
https://github.com/fcrepo4/fcrepo4/pull/882/files#diff-a456c1fc2649a798904fe05c3ae2e5fdR46
This addresses the subtask: https://jira.duraspace.org/browse/FCREPO-1824 Now, the only remaining trace of Modeshape is in the |
@@ -15,7 +15,7 @@ | |||
*/ | |||
package org.fcrepo.auth.common; | |||
|
|||
import static org.fcrepo.kernel.api.FedoraJcrTypes.JCR_CONTENT; | |||
import static org.modeshape.jcr.api.JcrConstants.JCR_CONTENT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The initial intent of this work was to remove dependencies from other modules on the "fcrepo-kernel-modeshape" module. This particular refactoring seems to be moving in the opposite direction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree. The core issue is this: isolate all modeshape-related code in the fcrepo-kernel-modeshape
module. And in order to achieve this, there are two primary issues to resolve.
First, this means removing all modeshape-specific code from fcrepo-kernel-api
where it most certainly does not belong. That is the primary goal of this particular PR. And IMO it is the right place to begin.
The second part of the issue relates to removing specific dependencies on fcrepo-kernel-modeshape
. The central issue here relates to how RdfStream::getTriples
is used (See related issue at https://jira.duraspace.org/browse/FCREPO-1312). That is, a class that calls RdfStream::getTriples
must pass in a class from the org.fcrepo.kernel.modeshape.rdf.impl
package. See, for example here: http://git.io/v8DUq, where the fcrepo-http-api module is completely tied to the fcrepo-kernel-modeshape module. That sort of interdependence will need to change; but it should be a separate effort (separate from this PR).
In this particular case: fcrepo-auth-common is already entirely bound to modeshape, so using a JCR-related constant from org.modeshape.jcr.api
instead of org.fcrepo.kernel.api
makes perfect sense to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @acoburn on this, and I ask him to please create a ticket for that refactoring to get dependence on org.fcrepo.kernel.modeshape.rdf.impl
out of the kernel. That was a gross oversight for which I think I can mostly be blamed. @cbeer wrote that, but I convinced him that it was a good idea. It was a good idea, but not good enough. We need to completely rethink the RDF generation subsystem in light of these things:
- The new Java 8 Streams API
- Our desire to refactor JCR into invisibility.
- Our need to produce a specification that can be reimplemented in a practical way.
Let me further suggest. along the lines of @acoburn 's argument, that this module actually be renamed fcrepo-auth-common-modeshape
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The argument here makes sense. Can you also describe how this current PR moves us in the direction of the "parent" ticket:
https://jira.duraspace.org/browse/FCREPO-1694 : "Ensure that no non-deployable module compile-depends on fcrepo-kernel-modeshape"
...or maybe the intent/title of the above ticket is simply misleading.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is confused. I had forgotten about the relationship between authN and MODE. We can alter the title to be more precise and therefore accurate. Did I miss anything other than authN?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
find . -name 'pom.xml' -exec grep -H "fcrepo-kernel-modeshape" "{}" \;
results in:
./fcrepo-kernel-modeshape/pom.xml: <artifactId>fcrepo-kernel-modeshape</artifactId>
./fcrepo-connector-file/pom.xml: <artifactId>fcrepo-kernel-modeshape</artifactId>
./fcrepo-auth-common/pom.xml: <artifactId>fcrepo-kernel-modeshape</artifactId>
./fcrepo-http-api/pom.xml: <artifactId>fcrepo-kernel-modeshape</artifactId>
./fcrepo-http-api/pom.xml: <artifactId>fcrepo-kernel-modeshape</artifactId>
./pom.xml: <module>fcrepo-kernel-modeshape</module>
./fcrepo-webapp/pom.xml: <artifactId>fcrepo-kernel-modeshape</artifactId>
./fcrepo-http-commons/pom.xml: <artifactId>fcrepo-kernel-modeshape</artifactId>
./fcrepo-boms/fcrepo4-bom/pom.xml: <artifactId>fcrepo-kernel-modeshape</artifactId>
./fcrepo-jms/pom.xml: <artifactId>fcrepo-kernel-modeshape</artifactId>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fcrepo-jms
has a test-dependency, which doesn't matter. It would be expected that fcrepo-webapp
depends on the modeshape impl. Both fcrepo-connector-file
and fcrepo-auth-common
have a special relationship to modeshape and should remain as they are. The only concerning dependencies are fcrepo-http-api
and fcrepo-http-commons
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I believe that fcrepo-audit depends on fcrepo-kernel-modeshape (in the same way fcrepo-http-api does).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that a test dependency?
Regarding: #882 (comment) |
That is repo-wide backup/restore? |
yes |
We'll need more than RDF, right? The bitstreams need to come with. I hate to keep banging the same drum, but maybe we should look at @cwilper 's Semantic Packages again. |
I think both options need to be available:
I suspect the community would be more attracted to BagIt. How do you view the comparison between BagIt and SCP? |
I view BagIt as a second-class choice. There's no instant translation of RDF into BagIt and the client libraries are awful. That having been said, Semantic Packages were never implemented, so there would be extra work there. It might be better to think of another choice-- RDF with links to binaries, instead of trying to package everything together. |
For better or worse, BagIt is what everybody uses (that I've heard detail what they use, anyway). I think the mapping should be pretty easy: the RDF would be an extra tag file, the child nodes and binaries would be the payload, and the binary descriptions would be converted to sidecar RDF files. |
Right, the idea of sidecar RDF files isn't very attractive, and I don't see that pushing the RDF into a tag file actually works all that well. But to be honest, I'm not going to do this work and I don't think that the "whole repo" backup is all that important anyway, so whatever gets the box checked most quickly is fine with me. |
Just to be clear, the question of BagIt vs. SCP vs. something else is actually orthogonal to the question of modeshape dependencies in the kernel-api. The problem with the |
Yes, this was a tangent. +1 to shimming over |
Sorry for crushing in here. But I have been doing some research related to this stuff for islandora. I found this people, doing https://researchobject.github.io/specifications/bundle/ looks more semantic ready than adapting bagIT Their approach is very aligned to LDP and have even some tools. More over, they have very similar approaches on many things to what you are doing. http://www.researchobject.org/specifications/ Just a contribution (maybe just adding noise to the conversation),but i really don't die for BagIT nor for a BagIT semantic monster. |
@acoburn 👍 for shimmy-shimmy |
@awoods Do we have a separate issue available to track discussion about the backup/restore serialization? |
@ajs6f, yes: #946 |
@DiegoPino Please put a link to RO-Bundle in #946. |
Related to https://jira.duraspace.org/browse/FCREPO-1694