Giter Site home page Giter Site logo

derby's People

Contributors

cbeer avatar escowles avatar no-reply avatar whikloj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

derby's Issues

Should FCR API Guarantee Slug Behavior on POST?

Both Derby and FCRepo4 currently respect Slug: headers on HTTP POST requests, failing the request if the requested slug can't be applied.

This behavior provides a safe mechanism for clients to request a new resource with a known URI within a given container. PUT can provide a similar mechanism, but only with a more complex set of assumptions about the containment of resources created with PUT requests. The slug approach feels more general.

@tpendragon, @cbeer and I ran into this while testing ActiveFedora with Derby, and had the sense that POST was the best approach for clients aiming for generalized LDP support.

NoMethodError: undefined method `new_offset' for nil:NilClass

$ curl -X PUT "http://localhost:4567/basic" -H "Link: <http://www.w3.org/ns/ldp#BasicContainer>;rel=\"type\"" -d "" -H "Content-Type: text/turtle"
$ curl -v "http://localhost:4567/basic"
...
< HTTP/1.1 200 OK
$ curl -v "http://localhost:4567/basic/"
...
< HTTP/1.1 500 Internal Server Error 
NoMethodError: undefined method `new_offset' for nil:NilClass
    /Users/cabeer/.gem/ruby/2.2.3/gems/rdf-ldp-0.4.0/lib/rdf/ldp/resource.rb:305:in `etag'
    /Users/cabeer/.gem/ruby/2.2.3/gems/rdf-ldp-0.4.0/lib/rdf/ldp/resource.rb:492:in `update_headers'
    /Users/cabeer/.gem/ruby/2.2.3/gems/rdf-ldp-0.4.0/lib/rdf/ldp/resource.rb:436:in `options'
    /Users/cabeer/.gem/ruby/2.2.3/gems/rdf-ldp-0.4.0/lib/rdf/ldp/resource.rb:410:in `request'

500 error on PATCH with sparql-update

I admit that I'm relatively green when it comes to LDP, so I might be missing something from the client side. But given that this is an interaction between ActiveFedora -> LDP -> Derby, I don't think it's anything I'm doing. At any rate, if the sparql-update is bad, I'd expect a 4xx at worst.

Trying to save a new Avalon::Collection descendant for the first time. The initial POST works fine, but it's immediately followed by a PATCH that blows up:

::1 - - [07/Oct/2016:23:19:37 -0500] "POST /rest/development HTTP/1.1" 201 - 0.0092
::1 - - [07/Oct/2016:23:19:37 -0500] "HEAD /rest/development/3f17c037-1282-4200-83b0-b7c0207eed23 HTTP/1.1" 200 - 0.0024
::1 - - [07/Oct/2016:23:19:37 -0500] "GET /rest/development/3f17c037-1282-4200-83b0-b7c0207eed23 HTTP/1.1" 200 - 0.0063
::1 - - [07/Oct/2016:23:19:37 -0500] "HEAD /rest/development/20b3bc2b-929a-4341-82a3-aca77dcb7d31 HTTP/1.1" 200 - 0.0016
::1 - - [07/Oct/2016:23:19:37 -0500] "GET /rest/development/20b3bc2b-929a-4341-82a3-aca77dcb7d31 HTTP/1.1" 200 - 0.0049
::1 - - [07/Oct/2016:23:19:37 -0500] "PATCH /rest/development/20b3bc2b-929a-4341-82a3-aca77dcb7d31 HTTP/1.1" 500 144778 0.0553

The request body looks like this:


DELETE { <> <http://purl.org/dc/terms/title> ?change . }
  WHERE { <> <http://purl.org/dc/terms/title> ?change . } ;
DELETE { <> <http://bibframe.org/vocab/heldBy> ?change . }
  WHERE { <> <http://bibframe.org/vocab/heldBy> ?change . } ;
DELETE { <> <http://www.w3.org/ns/auth/acl#accessControl> ?change . }
  WHERE { <> <http://www.w3.org/ns/auth/acl#accessControl> ?change . } ;
DELETE { <> <http://avalonmediasystem.org/rdf/vocab/collection#dropbox_directory_name> ?change . }
  WHERE { <> <http://avalonmediasystem.org/rdf/vocab/collection#dropbox_directory_name> ?change . } ;
DELETE { <> <http://avalonmediasystem.org/rdf/vocab/collection#default_visibility> ?change . }
  WHERE { <> <http://avalonmediasystem.org/rdf/vocab/collection#default_visibility> ?change . } ;
DELETE { <> <http://projecthydra.org/ns/auth/acl#defaultPermissions> ?change . }
  WHERE { <> <http://projecthydra.org/ns/auth/acl#defaultPermissions> ?change . } ;
INSERT {
<> <http://purl.org/dc/terms/title> "foo" .
<> <http://bibframe.org/vocab/heldBy> "Default Unit" .
<> <http://www.w3.org/ns/auth/acl#accessControl> <http://localhost:9292/rest/development/b88e7057-824f-471c-a850-bdebf4e8849f> .
<> <http://avalonmediasystem.org/rdf/vocab/collection#dropbox_directory_name> "foo" .
<> <http://avalonmediasystem.org/rdf/vocab/collection#default_visibility> "private" .
<> <http://projecthydra.org/ns/auth/acl#defaultPermissions> <http://localhost:9292/rest/development/3f17c037-1282-4200-83b0-b7c0207eed23> .
}
 WHERE { }

(unfortunately I was unable to capture the request headers)

The error that comes back is #<RDF::Query::Pattern:0x3ffd025e33c0(<> <http://purl.org/dc/terms/title> ?change .)> is not valid

I've added what I think is a reasonable approximation of a failing test in my fork: mbklein/derby@c1553d3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.