fcrepo-exts / fcrepo-import-export

Apache License 2.0
15 stars 19 forks source link

Ensures that objects of rdf:type predicates in the ldp: namespace are… #126

Closed dbernstein closed 5 years ago

dbernstein commented 5 years ago

… removed before import.

This fix also brings the ImporterIT integration tests back into the mix (ie they are no longer ignored).

Resolves: https://jira.duraspace.org/browse/FCREPO-3001


This PR widens the ban on forbidden types on import to all types in the LDP namespace. The functionality is covered by integration tests. For manual test:

  1. start a fresh repo
  2. create a container resource1 and a nested binary
    curl -X PUT -u fedoraAdmin:fedoraAdmin http://localhost:8080/rest/container
  3. Add a triple
    curl -X PATCH -u fedoraAdmin:fedoraAdmin http://localhost:8080/rest/container --data-binary "INSERT { <> <http://example.org/test> \"something\" } WHERE {}" 
  4. Create a binary
    curl -X PUT -u fedoraAdmin:fedoraAdmin http://localhost:8080/rest/container/binary --data-binary "hello world" -H "Content-Type: text/plain"
  5. Run the import export tool:
    java -jar ~/code/fcrepo-import-export/target/fcrepo-import-export-0.4.0-SNAPSHOT.jar  --mode export --predicates "http://www.w3.org/ns/ldp#contains" --resource "http://localhost:8080/rest" --versions --binaries --rdfLang "text/turtle" --dir export-dir
  6. start a fresh repo: stop report, remove fcrepo4-data and start the repo
  7. Import the data:
    java -jar ~/code/fcrepo-import-export/target/fcrepo-import-export-0.4.0-SNAPSHOT.jar  --mode import --predicates "http://www.w3.org/ns/ldp#contains" --resource "http://localhost:8080/rest" --versions --binaries --rdfLang "text/turtle" --dir export-dir
  8. Verify the resources have been successfully imported.
dbernstein commented 5 years ago

Regarding the issues raised with logging:
Re 1: there is another ticket for that one (at least there is now): https://jira.duraspace.org/browse/FCREPO-3020 Re 2: I suppose we can make that first one a debug message since it is not an error and creates too much noise. Re 3: The fcr:versions endpoint is addressed in a soon-to-be posted PR for https://jira.duraspace.org/browse/FCREPO-2982

dbernstein commented 5 years ago

@bbpennel : Thanks for the feedback. I've addressed the issues you raised in the above commit.