Islandora / documentation

Contains islandora's documentation and main issue queue.
MIT License
104 stars 71 forks source link

Drupal REST collection response returns "http://pcdm.org/models#Object" #1001

Closed kayakr closed 5 years ago

kayakr commented 5 years ago

node/1 is a Repository Item with Resource Type=Collection and Model=Collection. curl -v "http://localhost:8000/node/1?_format=jsonld" returns Link: <http://purl.org/dc/dcmitype/Collection>; rel="tag"; title="Collection" Link: <http://localhost:8000/taxonomy/term/2>; rel="tag"; title="Collection" ok, but also

"@type": [
        "http://pcdm.org/models#Object"
      ],

Shouldn't the @type value be "http://pcdm.org/models#Collection"?

dannylamb commented 5 years ago

Hey @kayakr,

Thanks for taking a look at the REST api. We've had some recent changes flow through that should make that collection a http://purl.org/dc/dcmitype/Collection (or whatever the Collection term has for field_external_uri). If you want it to be a PCDM Collection, you can just edit the taxonomy term and replace the DCMIType url.

That's all in theory of course, because you're sitting on a bug. Or at least a misconfiguration in https://github.com/Islandora-CLAW/islandora_demo. The rdf:type should come from its taxonomy terms, not the rdf mapping.

As for why not http://pcdm.org/models#Collection by default, there's some semantic baggage that comes with it. PCDM Collections aren't supposed to have files, they collect only other objects. So our workaround is to make it a PCDM object and slap a different collection URI on there. I understand PCDM's need to make that distinction, but unfortunately all Islandora collections pretty much always have a thumbnail. :man_shrugging:

whikloj commented 5 years ago

@kayakr was this resolved to your satisfaction by the PRs on the above linked ticket?

dannylamb commented 5 years ago

I can confirm that the bug I mentioned has been fixed, and that you can still make a collection a pcdm:Collection if you want to.

dannylamb commented 5 years ago

Resolved via https://github.com/Islandora-CLAW/islandora_demo/commit/1a9b2992fc11b5c9ea52031a9b3c3bce4f1e3ab7 and https://github.com/Islandora-CLAW/islandora/commit/a209d3c1ca4ad248a43210d724f0106ebe428794