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

Cannot version RDF resource with a blank node

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Fedora 5.0.0
    • Fix Version/s: Fedora 5.0.1
    • Component/s: f4-core
    • Labels:
      None
    • Roadmap Theme:
      Services: Versioning

      Description

      Aaron Coburn reported to me that there is a problem with this regex

      In that regular expression, there's a "\w" for matching a hash URI. That regex class is defined to include the following character ranges: A-Z, a-z, 0-9 and the _
      As it turns out, though, there are many other legitimate characters that can be part of a hash URI, most notably, the - character, which incidentally is used for any blank-node skolemization.

      To reproduce this, just create a resource with this RDF:

      <> <http://purl.org/dc/terms/subject> [ a <http://example.com/Subject> ] .

      Then, try to version that resource. You can't. This will be a pretty significant gotcha for anyone who happens to rely on bnode skolemization in fedora.

      Verified, by myself.

      curl -i -XPUT -ufedoraAdmin:fedoraAdmin http://localhost:8080/fcrepo/rest/test_regex -H"Content-type: text/turtle" -d"<> <http://purl.org/dc/terms/subject> [ a <http://example.com/Subject> ] ."

      HTTP/1.1 201 Created

      curl -i -XPOST -ufedoraAdmin:fedoraAdmin http://localhost:8080/fcrepo/rest/test_regex/fcr:versions

      HTTP/1.1 400 Bad Request
      Server: Apache-Coyote/1.1
      Set-Cookie: JSESSIONID=CC4DC918CEBCEFD2EA7B4A4A251EEA66; Path=/fcrepo/; HttpOnly
      Set-Cookie: rememberMe=deleteMe; Path=/fcrepo; Max-Age=0; Expires=Sun, 16-Dec-2018 15:48:40 GMT
      Link: <http://localhost:8080/fcrepo/static/constraints/MalformedRdfException.rdf>; rel="http://www.w3.org/ns/ldp#constrainedBy"
      Content-Type: text/plain;charset=utf-8
      Content-Length: 53
      Date: Mon, 17 Dec 2018 15:48:39 GMT
      Connection: close

      Error converting "fcr:versions" from String to a Name

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              awoods Andrew Woods
              Reporter:
              whikloj Jared Whiklo
              Reviewer:
              Danny Bernstein
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: