These are chat archives for read-write-web/chat

16th
Feb 2015
Justas Ažna
@reederz
Feb 16 2015 15:17
ok, this is crazy. I'm trying to use corsProxy in my client code and I'm getting this stuff again:
Caused by: rww.ldp.ParserException: Can't parse http://localhost:8080/reederz.nt with any mime types of Set(MimeType(application,n-triples,Map())). Original contentType was Some(application/n-triples)
    at rww.ldp.WSClient$$anonfun$rww$ldp$WSClient$$tryToReadAsGraph$1.applyOrElse(WebClient.scala:134) ~[na:na]
    at rww.ldp.WSClient$$anonfun$rww$ldp$WSClient$$tryToReadAsGraph$1.applyOrElse(WebClient.scala:134) ~[na:na]
    at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:33) ~[scala-library.jar:na]
    at scala.util.Failure.recoverWith(Try.scala:172) ~[scala-library.jar:na]
    at rww.ldp.WSClient.rww$ldp$WSClient$$tryToReadAsGraph(WebClient.scala:134) ~[na:na]
    at rww.ldp.WSClient$$anonfun$fetch$1.apply(WebClient.scala:95) ~[na:na]
    ... 16 common frames omitted
Henry Story
@bblfish
Feb 16 2015 16:42
Hi @reederz , sorry just saw your post
are you trying to read your own LDP content via the proxy?
Justas Ažna
@reederz
Feb 16 2015 16:43
yes- published on local python server
Henry Story
@bblfish
Feb 16 2015 16:44
what happens when you curl -I that resource?
or curl -i
Justas Ažna
@reederz
Feb 16 2015 16:45
$ curl -i http://localhost:8080/reederz.nt
HTTP/1.0 200 OK
Server: BaseHTTP/0.3 Python/2.7.9
Date: Mon, 16 Feb 2015 16:45:21 GMT
Content-type: application/n-triples

<https://localhost:8443/card#me> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
<https://localhost:8443/card#me> <http://xmlns.com/foaf/0.1/name> "Justas Azna" .
<https://localhost:8443/card#me> <http://xmlns.com/foaf/0.1/name> "Handsome Hacker" .
<https://localhost:8443/card#me> <http://xmlns.com/foaf/0.1/img> <https://avatars3.githubusercontent.com/u/3193560?v=3&s=460> .
<https://localhost:8443/card#me> <http://xmlns.com/foaf/0.1/depiction> <https://avatars3.githubusercontent.com/u/3193560?v=3&s=460> .
<https://localhost:8443/card#me> <http://purl.org/net/pingback/to> <https://my-profile.eu/pingback.php> .
_:node19e9ck1osx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/auth/cert#RSAPublicKey> .
_:node19e9ck1osx1 <http://www.w3.org/ns/auth/cert#modulus> "D3A7E935705B80C8CF7988D922EFF17B76CF8D12F14645BA39A2381A272EC5A4A10397B66FC7A2869DB40E971CAC98A2DB6467818371ABF785B4C88170EEB15F392863A6492EEDAD2D5E3B758F1E679961C69A57E17F69B4CFD7C0762906B0F407810CEBCC9A5C1562169CF0522612C690F7F7F5BBB9D527E33F22AE36D04E141D6793323378CEA7165A7ADD79E97EAC391C3688B28FB63A17FE743DF6D762AF8C5863A24592249FE60D371D03133F791876DC68B657171975E047587A684C548BBE0374DDD0462CB9C340EDC1461B991363077875BDE6E6BE2991307FDF355EFFA9A151415EC1E994F09B13AF1E5320FB121427E9261A4A809981443A6FD929"^^<http://www.w3.org/2001/XMLSchema#hexBinary> .
_:node19e9ck1osx1 <http://www.w3.org/ns/auth/cert#exponent> "65537"^^<http://www.w3.org/2001/XMLSchema#int> .
<https://localhost:8443/card#me> <http://www.w3.org/ns/auth/cert#key> _:node19e9ck1osx1 .
<https://localhost:8443/card#me> <http://xmlns.com/foaf/0.1/knows> <http://bblfish.net/people/henry/card#me> .
<https://localhost:8000/card> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/PersonalProfileDocument> .
<https://localhost:8000/card> <http://xmlns.com/foaf/0.1/maker> <https://my-profile.eu/people/reederz/card#me> .
<https://localhost:8000/card> <http://xmlns.com/foaf/0.1/primaryTopic> <https://my-profile.eu/people/reederz/card#me> .
<https://localhost:8000/card> <http://xmlns.com/foaf/0.1/title> "Justas Azna's profile." .
the subjects are messed up in the document
but that's not the problem here
Henry Story
@bblfish
Feb 16 2015 16:46
is that served by the same ldp server?
Justas Ažna
@reederz
Feb 16 2015 16:46
no- I serve it with local python server
python -m 'http.server'
Henry Story
@bblfish
Feb 16 2015 16:47
ok, just checking
did you try using curl on the proxy directly?
Justas Ažna
@reederz
Feb 16 2015 16:47
1 sec, gonna try
curl -i --insecure 'https://localhost:8443/srv/cors?url=http%3A%2F%2Flocalhost%3A8080%2Freederz.nt'
HTTP/1.1 200 OK
Accept: */*
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Content-Type: text/turtle
Host: localhost:8443
User-Agent: curl/7.40.0
Content-Length: 1754


<https://localhost:8443/card#me> a <http://xmlns.com/foaf/0.1/Person> ;
    <http://xmlns.com/foaf/0.1/name> "Justas Azna" , "Handsome Hacker" ;
    <http://xmlns.com/foaf/0.1/img> <https://avatars3.githubusercontent.com/u/3193560?v=3&s=460> ;
    <http://xmlns.com/foaf/0.1/depiction> <https://avatars3.githubusercontent.com/u/3193560?v=3&s=460> ;
    <http://purl.org/net/pingback/to> <https://my-profile.eu/pingback.php> .

_:genid-d561b6491fc245638d731fab13ee5bdf-node19e9ck1osx1 a <http://www.w3.org/ns/auth/cert#RSAPublicKey> ;
    <http://www.w3.org/ns/auth/cert#modulus> "D3A7E935705B80C8CF7988D922EFF17B76CF8D12F14645BA39A2381A272EC5A4A10397B66FC7A2869DB40E971CAC98A2DB6467818371ABF785B4C88170EEB15F392863A6492EEDAD2D5E3B758F1E679961C69A57E17F69B4CFD7C0762906B0F407810CEBCC9A5C1562169CF0522612C690F7F7F5BBB9D527E33F22AE36D04E141D6793323378CEA7165A7ADD79E97EAC391C3688B28FB63A17FE743DF6D762AF8C5863A24592249FE60D371D03133F791876DC68B657171975E047587A684C548BBE0374DDD0462CB9C340EDC1461B991363077875BDE6E6BE2991307FDF355EFFA9A151415EC1E994F09B13AF1E5320FB121427E9261A4A809981443A6FD929"^^<http://www.w3.org/2001/XMLSchema#hexBinary> ;
    <http://www.w3.org/ns/auth/cert#exponent> "65537"^^<http://www.w3.org/2001/XMLSchema#int> .

<https://localhost:8443/card#me> <http://www.w3.org/ns/auth/cert#key> _:genid-d561b6491fc245638d731fab13ee5bdf-node19e9ck1osx1 ;
    <http://xmlns.com/foaf/0.1/knows> <http://bblfish.net/people/henry/card#me> .

<https://localhost:8000/card> a <http://xmlns.com/foaf/0.1/PersonalProfileDocument> ;
    <http://xmlns.com/foaf/0.1/maker> <https://my-profile.eu/people/reederz/card#me> ;
    <http://xmlns.com/foaf/0.1/primaryTopic> <https://my-profile.eu/people/reederz/card#me> ;
    <http://xmlns.com/foaf/0.1/title> "Justas Azna's profile." .
Henry Story
@bblfish
Feb 16 2015 16:49
see the ok that works
Justas Ažna
@reederz
Feb 16 2015 16:49
gonna try with Accept: application/n-triples
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)%
Henry Story
@bblfish
Feb 16 2015 16:50
ok, it’s probably that the super simple proxy I wrote did not catch that parser somehow
Justas Ažna
@reederz
Feb 16 2015 16:52
Minor inconsistency: the fixes that you have done for banana-rdf are annotated with 0.7.1-SNAPSHOT version
and in rww-play you require 0.7.2-SNAPSHOT from bblfish.net
Henry Story
@bblfish
Feb 16 2015 16:52
I pushed the changes to master
Justas Ažna
@reederz
Feb 16 2015 16:52
read-write-web/rww-play@ceb91d5
Justas Ažna
@reederz
Feb 16 2015 16:53
of w3c? because read-write-web fork of b-rdf doesn't have your updates on master
Henry Story
@bblfish
Feb 16 2015 16:53
not of w3c of read-write-web repo
see link above
Justas Ažna
@reederz
Feb 16 2015 16:54
I see now
thnx
Justas Ažna
@reederz
Feb 16 2015 17:03
ok, recompiled and tried again
now I'm getting 417 response
but basically, the same story
rww.ldp.ParserException: WebClient for http://localhost:8080/reederz.nt -> ContentType=[Some(application/n-triples)] -> Can't parse body as an RDF graph
Justas Ažna
@reederz
Feb 16 2015 17:32
just a guess- we're using readerSelector from sesame and it doesn't cover NTriples: https://github.com/read-write-web/banana-rdf/blob/master/sesame/src/main/scala/org/w3/banana/sesame/SesameModule.scala#L75-78
Justas Ažna
@reederz
Feb 16 2015 18:24
that was part of the problem
we're also missing NTriplesWriter from Sesame
which, I'm not sure how to instantiate
Justas Ažna
@reederz
Feb 16 2015 19:04
I made an issue read-write-web/rww-play#134 - please comment there
Sylvain Le Bon
@sylvainlb
Feb 16 2015 21:03
I have a dumb question
Is there a typical way to create an id for a new object to be stored on my LDP server
for example, I'm storing todos in my LDP
I was figuring I could use t1, t2, t3... as subjects
but then when I create a new todo, I'm not sure what number to put after the t to make sure it's unique
or maybe I should create a slug from the label?
is there a best practice?
Justas Ažna
@reederz
Feb 16 2015 21:22
beats me- I'd like to know that too. It seems that when you create a container or a resource which you want to name explicitly, you have to add "Slug" header: https://dvcs.w3.org/hg/ldpwg/raw-file/default/ldp-primer/ldp-primer.html (example 20)
whereas, if you want the server to manage the resource id (e.g. autoincrement), you omit the Slug header: example 26 in the ldp-primer
but I wasn't able to find how the resource id can be managed
Perhaps, you could take care of that entirely in the client? By keeping last id in the ldp container and querying it, before posting
otherwise, UUIDs are probably safe bets too
anyway, I'm just thinking aloud- I didn't find anything concrete on the net
Sylvain Le Bon
@sylvainlb
Feb 16 2015 22:19
thanks
that brings in another question
I manage a list of todos
which are very basic (an assignee and a label)
So far, I created a resource todos, in which I patched the todo items
should I set the todolist as a container, and every todo as a resource, or is it best as I did?
Justas Ažna
@reederz
Feb 16 2015 22:27
I think that you should make todolist a container
when you wouldn't need patching
the container would update itself with it's members once you post a member to it
Sylvain Le Bon
@sylvainlb
Feb 16 2015 22:31
makes sense
thanks :)
Sylvain Le Bon
@sylvainlb
Feb 16 2015 23:17
For some reason I get a 405 Method Not Allowed when doing a POST
no useful log in the server console
my container has Read, Write, and Append acls
any idea why that could be?
Sylvain Le Bon
@sylvainlb
Feb 16 2015 23:23
and POST is indeed in the Allowed methods the server gives me
Justas Ažna
@reederz
Feb 16 2015 23:28
Is the JavaScript which posts stuff accessed through the LDP server?
I.e. same domain and port
Read, write, append acls for foaf Agent?
Sylvain Le Bon
@sylvainlb
Feb 16 2015 23:34
I got it
I was missing the trailing /
for some reason RwwPlay considers the uri to be representing a LDPR if it has no trailing /, even if it was created as a LDPC
Justas Ažna
@reederz
Feb 16 2015 23:49
That's in the LDP standard I think
Can't find it right now because my laptop's at my office