cygri / prefix.cc

Source code to the prefix.cc website
http://prefix.cc/
The Unlicense
38 stars 10 forks source link

Handle bad prefixes in multi-prefix requests more gracefully #10

Open cygri opened 10 years ago

cygri commented 10 years ago

Currently, a bad prefix (e.g., one-letter prefix or bad character) in a request for multiple prefixes causes the entire request to be rejected. It would be better to provide a useful answer for the good ones and just show an in-line error for the bad ones (and do HTTP 200 instead of 400).

Says Jean-Marc Vanel in email:

For one letter prefixes, like : http://prefix.cc/foaf,x.file.n3

prefix.cc returns an HTTP error 400 with :

bad prefix name “x”

It would be more convenient for my editor completion use case to return the same response as for other unknow prefixes :

@prefix foaf: <http://xmlns.com/foaf/0.1/>.
#@prefix x:  <??? not found>.

I'd say that <??? bad prefix name> might be more informative, but otherwise it would be good to do as Jean-Marc suggests.