MarcusBarnes / islandora_compound_batch

Provides the basic ability to batch import compound objects into Islandora.
GNU General Public License v3.0
3 stars 12 forks source link

Does islandora_compound_batch work as expected with Islandora 7.x-1.10? #27

Closed bseeger closed 6 years ago

bseeger commented 6 years ago

Hi,

I'm using Islandora 7.x-1.10 and trying out this module. After ingest, I see the two parent level compound objects, but when I click on them, all I see is the MODS metadata - the image objects have not been associated with the compound objects. The images are not part of any collection, though they look like they were created correctly.

Have folks tried this module with v1.10?
There's a very good chance it's my lack of knowledge about how this works, but since I saw a github issue about whether it worked in v1.9 I thought I'd ask.

Thanks, Bethany

mjordan commented 6 years ago

@bseeger can you do a tree on your input directory and paste the output here between triple backticks to preserve formatting?

bseeger commented 6 years ago

Hi -- sure. The first time I ran it I didn't include the MODS.xml at the child level. Then I tried this out.


import
├── asc_902516
│   ├── 001
│   │   ├── MODS.xml
│   │   └── OBJ.tiff
│   ├── 002
│   │   ├── MODS.xml
│   │   └── OBJ.tiff
│   ├── MODS.xml
│   └── structure.xml
└── asc_905026
    ├── 001
    │   ├── MODS.xml
    │   └── OBJ.tiff
    ├── 002
    │   ├── MODS.xml
    │   └── OBJ.tiff
    ├── MODS.xml
    └── structure.xml

6 directories, 12 files```
mjordan commented 6 years ago

OK, that checks out.

It's normal for the parents to have MODS only and no images. Have you enabled the "Islandora Compound Object Navigation" block, so the child objects are visible with their parents?

bseeger commented 6 years ago

Not yet (I didn't know about it. :) I'll try that out in the am. Thanks!

bseeger commented 6 years ago

In one setup where I manually created compound objects, I'm using JAIL and seeing the child thumbnails in the sidebar in the parent object. In the compound objects I imported via this module, that sidebar doesn't show up, as I don't think the 'child' objects are associated with the compound object.

bseeger commented 6 years ago

I can associate them manually and then it all works, but it doesn't appear that the importer is associating them. Odd...

mjordan commented 6 years ago

Hm... only think I can think of to confirm the children are being created and linked to their parents is to find the child objects (using a search, for example) and viewing their RELS-EXT to see if the collection membership relationship is there. Can you try that?

mjordan commented 6 years ago

@bseeger if you ingest the same data on a fresh Vagrant, what happens?

bseeger commented 6 years ago

Hi, I just looked at what's in the RELS-EXT file. One imported child object's RELS-EXT looks like this:

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:fedora="info:fedora/fedora-system:def/relations-external#" xmlns:fedora-model="info:fedora/fedora-system:def/model#" xmlns:islandora="http://islandora.ca/ontology/relsext#">
  <rdf:Description rdf:about="info:fedora/islandora:341">
    <fedora:isConstituentOf rdf:resource="info:fedora/islandora:343"></fedora:isConstituentOf>
    <islandora:isSequenceNumberOfislandora_343>1</islandora:isSequenceNumberOfislandora_343>
    <fedora-model:hasModel rdf:resource="info:fedora/islandora:sp_large_image_cmodel"></fedora-model:hasModel>
  </rdf:Description>
</rdf:RDF>

From a functional compound object that I created earlier (manually) - it's child object's RELS-EXT looks like this:

<rdf:RDF xmlns:fedora="info:fedora/fedora-system:def/relations-external#" xmlns:fedora-model="info:fedora/fedora-system:def/model#" xmlns:islandora="http://islandora.ca/ontology/relsext#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:about="info:fedora/islandora:301">
    <fedora:isMemberOfCollection rdf:resource="info:fedora/islandora:295"></fedora:isMemberOfCollection>
    <fedora-model:hasModel rdf:resource="info:fedora/islandora:compoundCModel"></fedora-model:hasModel>
    <fedora:isPartOf rdf:resource="info:fedora/islandora:300"></fedora:isPartOf>
    <islandora:isSequenceNumberOfislandora_300>1</islandora:isSequenceNumberOfislandora_300>
  </rdf:Description>
</rdf:RDF>

Looks like I need to edit the relationship somewhere so that it will use isPartOf predicate rather then isConstituentOf? (and the collection triple as well?)

bseeger commented 6 years ago

Okay, ^^ that seems to be the issue that I'm seeing.

If I change the code here: https://github.com/MarcusBarnes/islandora_compound_batch/blob/0f6d81fb35cd1ddd38c16d5ed31be75753967e7f/includes/object.inc#L181

To use isPartOf as well as adding membership for good measure (may not be necessary):

  public function addRelationshipsForChild($parent_pid, $sequence_number) {
    /*
    <fedora:isConstituentOf rdf:resource="info:fedora/islandora:93"/>
    <islandora:isSequenceNumberOfislandora_93>1</islandora:isSequenceNumberOfislandora_93>
     */
    //$this->relationships->add(FEDORA_RELS_EXT_URI, 'isConstituentOf', $parent_pid);
    $this->relationships->add(FEDORA_RELS_EXT_URI, 'isPartOf', $parent_pid);
    $this->relationships->add(FEDORA_RELS_EXT_URI, 'isMemberOfCollection', $parent_pid);
    $escaped_pid = str_replace(':', '_', $parent_pid);
    $this->relationships->add(ISLANDORA_RELS_EXT_URI, "isSequenceNumberOf$escaped_pid", $sequence_number, RELS_TYPE_PLAIN_LITERAL);

  }

I can successfully import compound objects

MarcusBarnes commented 6 years ago

@bseeger Would you please create a pull-request with this change and mentioning this issue? Out of curiosity, what version of Fedora are you using? Thank you!

bseeger commented 6 years ago

In thinking more about this... I guess I changed that default relationship to isPartOf in the Compound Object Solution pack. This code should probably pull that configuration information from the DB, rather then just assuming it will always be isConstituentOf. But perhaps it will always will be?

bseeger commented 6 years ago

Hi @MarcusBarnes - I am using fedora 3.8.1. For reference, I'm not using a vagrant setup and this is a development environment, overall, so not a huge issue for me.
I can make a PR in a little while. Would it be safe to assume that I can pull that predicate from the Compound Object Solution pack?

MarcusBarnes commented 6 years ago

@bseeger Thanks for clarifying. Yes, it would be good to use the value of the Child relationship predicate setting from the admin/islandora/solution_pack_config/compound_object form rather than just assuming that it will be the default 'isConstituentOf' (with the same caveats on that setting in the compound object solution pack admin form).

mjordan commented 6 years ago

@bseeger do you mind if I ask why you changed the predicate from the default isConstituentOf?

bseeger commented 6 years ago

@mjordan - in production we have fedora 3 (3.5 to be exact) and that uses isPartOf, so I thought I'd continue down that road. Seems like it's been replaced by isConstituentOf though.

bseeger commented 6 years ago

Closing due to https://github.com/MarcusBarnes/islandora_compound_batch/issues/28 being created

mjordan commented 6 years ago

@bseeger I always wondered why there was an admin option to change that predicate.... didn't know that it had changed across versions of fcrepo. Thanks!