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

Fixing media indexing in Fedora with 5.0 #62

Merged
merged 9 commits into from
Apr 30, 2019

Conversation

dannylamb
Copy link
Contributor

@dannylamb dannylamb commented Apr 16, 2019

GitHub Issue: Islandora/documentation#1079

Test with: Islandora-Devops/islandora-playbook#100

What does this Pull Request do?

Fixes Milliner indexing of media for files that are in the fedora.

What's new?

We were indexing the RDF with the subject of the triples being the file uri itself: http://localhost:8080/fcrepo/rest/some_file.jpg. Fedora has been rejecting these with 403's because it requires the fcr:medata url to be the subject: http://localhost:8080/fcrepo/rest/some_file.jpg/fcr:metadata

This is a one line fix to inject that url in as the subject instead of the file uri.

How should this be tested?

You should be able to see things like pcdm:fileOf and schema:author in RDF from Fedora now:

vagrant@claw:~$ curl http://localhost:8080/fcrepo/rest/2019-04/beefalo.jpeg/fcr:metadata
@prefix premis:  <http://www.loc.gov/premis/rdf/v1#> .
@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix fedora:  <http://fedora.info/definitions/v4/repository#> .
@prefix ebucore:  <http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#> .
@prefix ldp:  <http://www.w3.org/ns/ldp#> .
@prefix dcterms:  <http://purl.org/dc/terms/> .
@prefix iana:  <http://www.iana.org/assignments/relation/> .

<http://localhost:8080/fcrepo/rest/2019-04/beefalo.jpeg>
        rdf:type                    fedora:NonRdfSourceDescription ;
        rdf:type                    <http://pcdm.org/models#File> ;
        rdf:type                    <http://pcdm.org/use#OriginalFile> ;
        rdf:type                    fedora:Binary ;
        rdf:type                    fedora:Resource ;
        fedora:lastModifiedBy       "bypassAdmin" ;
        <http://schema.org/dateModified>  "2019-04-16T13:21:12+00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
        <http://schema.org/author>  <http://localhost:8000/user/1?_format=jsonld> ;
        <http://schema.org/sameAs>  "http://localhost:8000/_flysystem/fedora/2019-04/beefalo.jpeg" ;
        <http://schema.org/dateCreated>  "2019-04-16T12:55:35+00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
        ebucore:width               "1024"^^<http://www.w3.org/2001/XMLSchema#int> ;
        premis:hasSize              "194003"^^<http://www.w3.org/2001/XMLSchema#long> ;
        ebucore:hasMimeType         "image/jpeg" ;
        fedora:createdBy            "bypassAdmin" ;
        fedora:created              "2019-04-16T12:55:41.454Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
        fedora:lastModified         "2019-04-16T13:21:13.939Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
        premis:hasMessageDigest     <urn:sha1:5079e6e28144b97e9019d8fa5a831e8049858fcc> ;
        ebucore:height              "576"^^<http://www.w3.org/2001/XMLSchema#int> ;
        <http://pcdm.org/models#fileOf>  <http://localhost:8000/node/2?_format=jsonld> ;
        rdf:label                   "Beefalo Madness"@en ;
        ebucore:filename            "" ;
        dcterms:title               "Beefalo Madness"@en ;
        rdf:type                    ldp:NonRDFSource ;
        iana:describedby            <http://localhost:8080/fcrepo/rest/2019-04/beefalo.jpeg/fcr:metadata> ;
        fedora:hasFixityService     <http://localhost:8080/fcrepo/rest/2019-04/beefalo.jpeg/fcr:fixity> .

Interested parties

@Islandora-CLAW/committers

@codecov
Copy link

codecov bot commented Apr 23, 2019

Codecov Report

Merging #62 into master will decrease coverage by 0.81%.
The diff coverage is 91.07%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #62      +/-   ##
============================================
- Coverage     97.13%   96.32%   -0.82%     
- Complexity      146      151       +5     
============================================
  Files             9        9              
  Lines           629      626       -3     
============================================
- Hits            611      603       -8     
- Misses           18       23       +5
Impacted Files Coverage Δ Complexity Δ
Milliner/src/Controller/MillinerController.php 93.65% <80%> (-6.35%) 16 <4> (+6)
Milliner/src/Service/MillinerService.php 99.54% <97.22%> (-0.46%) 47 <3> (-1)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0b49f10...c348d67. Read the comment docs.

@whikloj whikloj self-requested a review April 24, 2019 17:47
@dannylamb
Copy link
Contributor Author

-0.82... close but no 🚬... which is the closest emoji to cigar on github.

@dannylamb
Copy link
Contributor Author

Anyway, I think that's close enough for code coverage. Moving on to the other PRs and install.

@seth-shaw-unlv seth-shaw-unlv self-requested a review April 29, 2019 19:52
Copy link
Contributor

@seth-shaw-unlv seth-shaw-unlv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@dannylamb
Copy link
Contributor Author

Linking this to Islandora-Devops/islandora-playbook#100

@seth-shaw-unlv seth-shaw-unlv merged commit 0663c54 into master Apr 30, 2019
@dannylamb dannylamb deleted the fedora-media-indexing branch May 30, 2019 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants