Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: Fedora 4.7.4
    • Fix Version/s: None
    • Component/s: f4-core
    • Labels:
      None
    • Roadmap Theme:
      Services: CRUD

      Description

      When providing a md5 while creating a binary resource, the md5 is normally stored as something like "premis:hasMessageDigest <urn:md5:e1cbb0c3879af8347246f12c559a86b5> ;".

      However, if you do this during a transaction and access the binary's metadata before the end of the transaction, the MD5 will be lost.

      Attached is a script which demonstrates the issue in three examples:
      1) Create binary without a tx - MD5 is retained
      2) Create binary in tx - MD5 is retained
      3) Create binary in tx, access fcr:metadata in tx - MD5 is lost

      Also, I believe the same issue happens if you perform a patch against the binary during the tx, as this is the case we ran into in our application.

      Example output, performed against fcrepo 4.7.4 jetty console:
      1) MD5, no transaction

      @prefix premis: <http://www.loc.gov/premis/rdf/v1#> .
      @prefix test: <info:fedora/test/> .
      @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
      @prefix xsi: <http://www.w3.org/2001/XMLSchema-instance> .
      @prefix xmlns: <http://www.w3.org/2000/xmlns/> .
      @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
      @prefix fedora: <http://fedora.info/definitions/v4/repository#> .
      @prefix xml: <http://www.w3.org/XML/1998/namespace> .
      @prefix ebucore: <http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#> .
      @prefix ldp: <http://www.w3.org/ns/ldp#> .
      @prefix xs: <http://www.w3.org/2001/XMLSchema> .
      @prefix fedoraconfig: <http://fedora.info/definitions/v4/config#> .
      @prefix foaf: <http://xmlns.com/foaf/0.1/> .
      @prefix dc: <http://purl.org/dc/elements/1.1/> .

      <http://localhost:8080/rest/35/5c/18/c8/355c18c8-847d-4cfb-a064-572d65cf2268>
              rdf:type fedora:Binary ;
              rdf:type fedora:Resource ;
              fedora:lastModifiedBy "bypassAdmin"^^<http://www.w3.org/2001/XMLSchema#string> ;
              premis:hasSize "5"^^<http://www.w3.org/2001/XMLSchema#long> ;
              ebucore:hasMimeType "application/x-www-form-urlencoded"^^<http://www.w3.org/2001/XMLSchema#string> ;
              fedora:createdBy "bypassAdmin"^^<http://www.w3.org/2001/XMLSchema#string> ;
              fedora:created "2017-10-24T20:27:05.971Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
              fedora:lastModified "2017-10-24T20:27:05.971Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
              premis:hasMessageDigest <urn:md5:e1cbb0c3879af8347246f12c559a86b5> ;
              premis:hasMessageDigest <urn:sha1:aa785adca3fcdfe1884ae840e13c6d294a2414e8> ;
              ebucore:filename ""^^<http://www.w3.org/2001/XMLSchema#string> ;
              rdf:type ldp:NonRDFSource ;
              fedora:writable "true"^^<http://www.w3.org/2001/XMLSchema#boolean> ;
              <http://www.iana.org/assignments/relation/describedby> <http://localhost:8080/rest/35/5c/18/c8/355c18c8-847d-4cfb-a064-572d65cf2268/fcr:metadata> ;
              fedora:hasParent <http://localhost:8080/rest/> ;
              fedora:hasFixityService <http://localhost:8080/rest/35/5c/18/c8/355c18c8-847d-4cfb-a064-572d65cf2268/fcr:fixity> .

      ============================

      2) md5 in transaction

      @prefix premis: <http://www.loc.gov/premis/rdf/v1#> .
      @prefix test: <info:fedora/test/> .
      @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
      @prefix xsi: <http://www.w3.org/2001/XMLSchema-instance> .
      @prefix xmlns: <http://www.w3.org/2000/xmlns/> .
      @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
      @prefix fedora: <http://fedora.info/definitions/v4/repository#> .
      @prefix xml: <http://www.w3.org/XML/1998/namespace> .
      @prefix ebucore: <http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#> .
      @prefix ldp: <http://www.w3.org/ns/ldp#> .
      @prefix xs: <http://www.w3.org/2001/XMLSchema> .
      @prefix fedoraconfig: <http://fedora.info/definitions/v4/config#> .
      @prefix foaf: <http://xmlns.com/foaf/0.1/> .
      @prefix dc: <http://purl.org/dc/elements/1.1/> .

      <http://localhost:8080/rest/1b/08/3e/e0/1b083ee0-a5fd-4365-8300-aeedb0d8d619>
              rdf:type fedora:Binary ;
              rdf:type fedora:Resource ;
              fedora:lastModifiedBy "bypassAdmin"^^<http://www.w3.org/2001/XMLSchema#string> ;
              premis:hasSize "5"^^<http://www.w3.org/2001/XMLSchema#long> ;
              ebucore:hasMimeType "application/x-www-form-urlencoded"^^<http://www.w3.org/2001/XMLSchema#string> ;
              fedora:createdBy "bypassAdmin"^^<http://www.w3.org/2001/XMLSchema#string> ;
              fedora:created "2017-10-24T20:27:06.05Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
              fedora:lastModified "2017-10-24T20:27:06.05Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
              premis:hasMessageDigest <urn:md5:e1cbb0c3879af8347246f12c559a86b5> ;
              premis:hasMessageDigest <urn:sha1:aa785adca3fcdfe1884ae840e13c6d294a2414e8> ;
              ebucore:filename ""^^<http://www.w3.org/2001/XMLSchema#string> ;
              rdf:type ldp:NonRDFSource ;
              fedora:writable "true"^^<http://www.w3.org/2001/XMLSchema#boolean> ;
              <http://www.iana.org/assignments/relation/describedby> <http://localhost:8080/rest/1b/08/3e/e0/1b083ee0-a5fd-4365-8300-aeedb0d8d619/fcr:metadata> ;
              fedora:hasParent <http://localhost:8080/rest/> ;
              fedora:hasFixityService <http://localhost:8080/rest/1b/08/3e/e0/1b083ee0-a5fd-4365-8300-aeedb0d8d619/fcr:fixity> .

      ============================

      3) md5, inspection during transaction

      @prefix premis: <http://www.loc.gov/premis/rdf/v1#> .
      @prefix test: <info:fedora/test/> .
      @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
      @prefix xsi: <http://www.w3.org/2001/XMLSchema-instance> .
      @prefix xmlns: <http://www.w3.org/2000/xmlns/> .
      @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
      @prefix fedora: <http://fedora.info/definitions/v4/repository#> .
      @prefix xml: <http://www.w3.org/XML/1998/namespace> .
      @prefix ebucore: <http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#> .
      @prefix ldp: <http://www.w3.org/ns/ldp#> .
      @prefix xs: <http://www.w3.org/2001/XMLSchema> .
      @prefix fedoraconfig: <http://fedora.info/definitions/v4/config#> .
      @prefix foaf: <http://xmlns.com/foaf/0.1/> .
      @prefix dc: <http://purl.org/dc/elements/1.1/> .

      <http://localhost:8080/rest/41/f3/d0/28/41f3d028-4e59-484e-9491-1eb33c6e270c>
              rdf:type fedora:Binary ;
              rdf:type fedora:Resource ;
              fedora:lastModifiedBy "bypassAdmin"^^<http://www.w3.org/2001/XMLSchema#string> ;
              premis:hasSize "5"^^<http://www.w3.org/2001/XMLSchema#long> ;
              ebucore:hasMimeType "application/x-www-form-urlencoded"^^<http://www.w3.org/2001/XMLSchema#string> ;
              fedora:createdBy "bypassAdmin"^^<http://www.w3.org/2001/XMLSchema#string> ;
              fedora:created "2017-10-24T20:27:06.143Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
              fedora:lastModified "2017-10-24T20:27:06.143Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
              premis:hasMessageDigest <urn:sha1:aa785adca3fcdfe1884ae840e13c6d294a2414e8> ;
              ebucore:filename ""^^<http://www.w3.org/2001/XMLSchema#string> ;
              rdf:type ldp:NonRDFSource ;
              fedora:writable "true"^^<http://www.w3.org/2001/XMLSchema#boolean> ;
              <http://www.iana.org/assignments/relation/describedby> <http://localhost:8080/rest/41/f3/d0/28/41f3d028-4e59-484e-9491-1eb33c6e270c/fcr:metadata> ;
              fedora:hasParent <http://localhost:8080/rest/> ;
              fedora:hasFixityService <http://localhost:8080/rest/41/f3/d0/28/41f3d028-4e59-484e-9491-1eb33c6e270c/fcr:fixity> .

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bseeger Bethany Seeger
                Reporter:
                ben.pennell Ben Pennell
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: