Closed reederz closed 9 years ago
yep, that looks like the patch. I'll be glad to merge it.
and I'd be glad to make a PR :) but I've only the solution for "missing reader problem". The writer would still be missing. application/n-triples writer doesn't seem to exist in Sesame (https://github.com/read-write-web/banana-rdf/blob/master/sesame/src/main/scala/org/w3/banana/sesame/io/SesameRDFWriter.scala#L45-50 ). Does it mean that it has to be written? or can we somehow use the one from Plantain?
I don't think you need an NTriples Writer do you? It looks like my client only ever writes one very specific type of output - which is a limitation, but not for LDP as Turtle is a requirement.
It seems like I do need a writer. If try to get application/n-triples with client, I get 415 response like this.
curl -i --insecure -H "Accept: application/n-triples" 'https://localhost:8443/srv/cors?url=http%3A%2F%2Flocalhost%3A8080%2Freederz.nt'
HTTP/1.1 415 Unsupported Media Type
Content-Type: text/plain; charset=utf-8
Content-Length: 82
could not find RDF type of resource at remote location Some(application/n-triples)%
The error comes from here and happens because appropriate writer cannot be found by writerSelector: https://github.com/read-write-web/rww-play/blob/dev/app/rww/play/CORSProxy.scala#L107-115 (
Alternatively, we could get some other reader/writer into plantain implementation for client apps. It is because currently, rww-scala-js with plantain can only speak "application/n-triples"
Ah, yes, I see. There is in banana-rdf a writer here: https://github.com/read-write-web/banana-rdf/blob/master/io/ntriples/common/src/main/scala/org/w3/banana/io/NTriplesWriter.scala
You just have to add it to the defaults in the controllers/package.scala
I think.
Oh cool- it did work. I'll make a PR shortly.
We're using Sesame readerSelector, which does not include NTriplesReader: https://github.com/read-write-web/banana-rdf/blob/master/sesame/src/main/scala/org/w3/banana/sesame/SesameModule.scala#L75-78 . We could solve this by exchange the following in ./app/controllers/package.scala:
for
Also, we're using this writerSelector https://github.com/read-write-web/rww-play/blob/dev/app/controllers/package.scala#L181-187 which does not include one for application/n-triples. I'm not sure how to solve this problem since Sesame doesn't seem to support ntriples syntax.