Uploaded image for project: 'Fedora Repository Project'
  1. Fedora Repository Project
  2. FCREPO-3015

PUT on NonRdfSourceDescription is additive, does not replace triples

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Fedora 5.0.0
    • Fix Version/s: Fedora 5.1.0
    • Component/s: f4-core
    • Labels:
      None
    • Environment:
      Islandora 8 vagrant - Ubuntu 16.04

      Description

      PUT requests to update metdata for a NonRdfSourceDescription adds triples to the RDF representation instead of replacing them.

      To reproduce, make a NonRdfSource (I PUT'd a text file)

      curl -i -X PUT -H "Content-Type: text/plain" --data-binary "@text.txt" http://localhost:8080/fcrepo/rest/text
      

      Update its title using the following RDF and command

      @prefix dcterms:  <http://purl.org/dc/terms/> .
      <http://localhost:8080/fcrepo/rest/text/fcr:metadata>
              dcterms:title               "ORIGINAL"@en ;
      
      $ curl -X PUT -H "Content-Type: text/turtle" -H "Prefer: return=minimal; handling=lenient" --data-binary "@rdf.ttl" http://localhost:8080/fcrepo/rest/text/fcr:metadata
      

      If you GET the resource you'll see the title,  and if you update it with another PUT, you'll get both in the resulting RDF:

      @prefix dcterms: <http://purl.org/dc/terms/> .
      <http://localhost:8080/fcrepo/rest/text/fcr:metadata>
              dcterms:title            "CHANGED"@en ;
      
      $ curl -X PUT -H "Content-Type: text/turtle" -H "Prefer: return=minimal; handling=lenient" --data-binary "@rdf.ttl" http://localhost:8080/fcrepo/rest/text/fcr:metadata
      
      $ curl localhost:8080/fcrepo/rest/text/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/text>
              rdf:type                 fedora:NonRdfSourceDescription ;
              rdf:type                 fedora:Binary ;
              rdf:type                 fedora:Resource ;
              fedora:lastModifiedBy    "bypassAdmin" ;
              premis:hasSize           "15"^^<http://www.w3.org/2001/XMLSchema#long> ;
              ebucore:hasMimeType      "text/plain" ;
              fedora:createdBy         "bypassAdmin" ;
              fedora:created           "2019-06-17T16:18:54.19Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
              fedora:lastModified      "2019-06-17T16:20:44.624Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
              premis:hasMessageDigest  <urn:sha1:9d8b92c51da294c82d42a0cb35629259b1573f43> ;
              ebucore:filename         "" ;
              dcterms:title            "ORIGINAL"@en ;
              dcterms:title            "CHANGED"@en ;
              rdf:type                 ldp:NonRDFSource ;
              iana:describedby         <http://localhost:8080/fcrepo/rest/text/fcr:metadata> ;
              fedora:hasFixityService  <http://localhost:8080/fcrepo/rest/text/fcr:fixity> .
      
      

       

       

        Attachments

          Activity

            People

            Assignee:
            whikloj Jared Whiklo
            Reporter:
            dlamb Daniel Lamb
            Reviewer:
            Danny Bernstein
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: