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

6th
Mar 2015
Justas Ažna
@reederz
Mar 06 2015 09:58
@bblfish should one be able to make updates (PATCH, PUT, DELETE) through cors proxy? Because currently it doesn't seem to be possible
Henry Story
@bblfish
Mar 06 2015 09:59
that would be something to add yes.
Do you have a setup with a number of different rww servers?
Justas Ažna
@reederz
Mar 06 2015 10:00
Also, I have noticed that if I get a resource through CORS proxy and then issue a direct update (PUT)- the server does not invalidate cache
meaning that I won't see update until I restart the server
Henry Story
@bblfish
Mar 06 2015 10:00
yes, the CORS proxy is only in GET mode
doing updates is much more complex. I was discussing that with @sylvainlb recently.
Justas Ažna
@reederz
Mar 06 2015 10:01
I have a single server setup but I was going to add 1 more cloud server this weekend or early next week
perhaps there is a quick and dirty workaround that you could suggest?
Henry Story
@bblfish
Mar 06 2015 10:02
so there are two ways to fix that: one is to do UPDATES directly on the server, but then it requires the server to allow updates using CORS, and that means one has to think about what it is reasonable to allow.
For a demo one could allow anything, but that would be a security hole
the same thinking needs to go into CORS updates via the proxy, though that allows a lot more flexibility
I came up with a few options a week ago, but then got caught up in CAPS organisation
Justas Ažna
@reederz
Mar 06 2015 10:05
yes, I'm only thinking about a demo scenario. Security is really important but it isn't the crucial part of our demo
thanks, I guess I'll just not use CORS proxy and make the server accept updates from all origins (scary stuff)
Henry Story
@bblfish
Mar 06 2015 10:06
yes, I think that is what the PR from @sylvainlb does.
Justas Ažna
@reederz
Mar 06 2015 10:06
cool, I'll check it out
oh, and I found that the server does not accept updates with Content-Type: application/n-triples. I can make a PR for that
of course, such small things wouldn't slip through if we had the test suite up an running.
I was looking into the test suite some 3 weeks ago and it seemed rather doable. But I didn't want to put a lot of work into something that might not be in sync with the overall vision that you have
Henry Story
@bblfish
Mar 06 2015 10:11
mhh, yes, I remember I made a PR for banana-rdf for wrong mime types
but I thought I had published the fixed version on bblfish.net
otherwise application/n-triples looks like a binary resource to rww
Henry Story
@bblfish
Mar 06 2015 10:15
ah ok, make a PR then, that will help
Justas Ažna
@reederz
Mar 06 2015 10:15
OK, I'll do it shortly
Henry Story
@bblfish
Mar 06 2015 10:15
I just checked I released a new version of banana-rdf but I may have mistakenly published it as a SNAPSHOT
I don’t think we are using a snapshot
Justas Ažna
@reederz
Mar 06 2015 10:16
we are
just checked
  val banana = (name: String) => "org.w3" %% name % "0.7.2-SNAPSHOT" excludeAll (ExclusionRule(organization = "org.scala-stm"))
Henry Story
@bblfish
Mar 06 2015 10:17
ah ok
Henry Story
@bblfish
Mar 06 2015 10:56
great PR thanks :-) short and concise
Justas Ažna
@reederz
Mar 06 2015 10:57
I'm getting better at this
Justas Ažna
@reederz
Mar 06 2015 12:13
@bblfish I see that you worked on ntriples reader for banana-rdf. I've just wrote about it on banana-rdf chat. Would you care to comment?
Justas Ažna
@reederz
Mar 06 2015 13:38

I was away for a bit. Thanks for your comments. Here's how you how requesting an n-triples resource works via CORS proxy vs normally.
via CORS proxy:

[  2:36PM ]  [ justas@choedankal:~/Source/scala/workspace/jolocom/rww-play/test_www(jolocom✗) ]
 $ curl -k -i -H "Accept: application/n-triples" -X GET \
   --cert ../eg/test-localhost.pem:test "https://localhost:8443/srv/cors?url=https%3A%2F%2Flocalhost%3A8443%2F2013%2Fcouch"
HTTP/1.1 200 OK
Accept: application/n-triples
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Content-Type: application/n-triples
Host: localhost:8443
User-Agent: curl/7.40.0
Content-Length: 1985

<https://localhost:8443/2013/couch#mycouch> <http://purl.org/goodrelations/v1#description> "Comfortable couch in Artist Stables"^^<http://www.w3.org/2001/XMLSchema#string> .
_:genid-6382c443ca2c43778040cc45991c56d2-genid-5669fc7e1dc84e8c860d396866d6c2af-node19fn63u4nx2 <http://www.w3.org/2000/10/swap/pim/contact#city> "Fontainebleau"^^<http://www.w3.org/2001/XMLSchema#string> .
_:genid-6382c443ca2c43778040cc45991c56d2-genid-5669fc7e1dc84e8c860d396866d6c2af-node19fn63u4nx2 <http://www.w3.org/2000/10/swap/pim/contact#postalCode> "77300"^^<http://www.w3.org/2001/XMLSchema#string> .
_:genid-6382c443ca2c43778040cc45991c56d2-genid-5669fc7e1dc84e8c860d396866d6c2af-node19fn63u4nx2 <http://www.w3.org/2000/10/swap/pim/contact#country> "France"^^<http://www.w3.org/2001/XMLSchema#string> .
<https://localhost:8443/2013/couch> <http://www.w3.org/ns/ldp#contains> <https://localhost:8443/2013/couch> .
<https://localhost:8443/2013/couch#mycouch> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://bblfish.net/2013/05/10/couch#Surf> .
_:genid-6382c443ca2c43778040cc45991c56d2-genid-5669fc7e1dc84e8c860d396866d6c2af-node19fn63u4nx1 <http://www.w3.org/2000/10/swap/pim/contact#address> _:genid-6382c443ca2c43778040cc45991c56d2-genid-5669fc7e1dc84e8c860d396866d6c2af-node19fn63u4nx2 .
<https://localhost:8443/2013/couch#mycouch> <http://purl.org/goodrelations/v1#color> "Red"^^<http://www.w3.org/2001/XMLSchema#string> .
<https://localhost:8443/2013/couch#mycouch> <http://purl.org/goodrelations/v1#location> _:genid-6382c443ca2c43778040cc45991c56d2-genid-5669fc7e1dc84e8c860d396866d6c2af-node19fn63u4nx1 .
_:genid-6382c443ca2c43778040cc45991c56d2-genid-5669fc7e1dc84e8c860d396866d6c2af-node19fn63u4nx2 <http://www.w3.org/2000/10/swap/pim/contact#street> "21 rue Saint Honoré"^^<http://www.w3.org/2001/XMLSchema#string> .
<https://localhost:8443/2013/couch#mycouch> <http://purl.org/goodrelations/v1#name> "Very Unstable Couch"^^<http://www.w3.org/2001/XMLSchema#string> .

nomal:

[  2:38PM ]  [ justas@choedankal:~/Source/scala/workspace/jolocom/rww-play/test_www(jolocom✗) ]
 $ curl -k -i -H "Accept: application/n-triples" -X GET \
   --cert ../eg/test-localhost.pem:test https://localhost:8443/2013/couch                                                  
HTTP/1.1 200 OK
Accept-Patch: application/sparql-update
Access-Control-Allow-Origin: *
Allow: OPTIONS, GET, HEAD, SEARCH, PUT, DELETE, PUT, PATCH
Content-Type: application/n-triples
ETag: "1425638154104|Success(857)"
Last-Modified: Fri, 06 Mar 2015 10:35:54 GMT
Link: <http://www.w3.org/ns/ldp#Resource>; rel=type, <couch.acl>; rel=acl
Content-Length: 1481

<#mycouch> <http://purl.org/goodrelations/v1#description> "Comfortable couch in Artist Stables"^^<http://www.w3.org/2001/XMLSchema#string> .
_:genid-5669fc7e1dc84e8c860d396866d6c2af-node19fn63u4nx2 <http://www.w3.org/2000/10/swap/pim/contact#city> "Fontainebleau"^^<http://www.w3.org/2001/XMLSchema#string> .
_:genid-5669fc7e1dc84e8c860d396866d6c2af-node19fn63u4nx2 <http://www.w3.org/2000/10/swap/pim/contact#postalCode> "77300"^^<http://www.w3.org/2001/XMLSchema#string> .
_:genid-5669fc7e1dc84e8c860d396866d6c2af-node19fn63u4nx2 <http://www.w3.org/2000/10/swap/pim/contact#country> "France"^^<http://www.w3.org/2001/XMLSchema#string> .
<> <http://www.w3.org/ns/ldp#contains> <> .
<#mycouch> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://bblfish.net/2013/05/10/couch#Surf> .
_:genid-5669fc7e1dc84e8c860d396866d6c2af-node19fn63u4nx1 <http://www.w3.org/2000/10/swap/pim/contact#address> _:genid-5669fc7e1dc84e8c860d396866d6c2af-node19fn63u4nx2 .
<#mycouch> <http://purl.org/goodrelations/v1#color> "Red"^^<http://www.w3.org/2001/XMLSchema#string> .
<#mycouch> <http://purl.org/goodrelations/v1#location> _:genid-5669fc7e1dc84e8c860d396866d6c2af-node19fn63u4nx1 .
_:genid-5669fc7e1dc84e8c860d396866d6c2af-node19fn63u4nx2 <http://www.w3.org/2000/10/swap/pim/contact#street> "21 rue Saint Honoré"^^<http://www.w3.org/2001/XMLSchema#string> .
<#mycouch> <http://purl.org/goodrelations/v1#name> "Very Unstable Couch"^^<http://www.w3.org/2001/XMLSchema#string> .
so yeah, rww does return relative URLs when asking for n-triples unless you request through CORS proxy.
Henry Story
@bblfish
Mar 06 2015 13:42
ah oops
that’s the problem that we don’t distinguish in banana-rdf at present between graphs with and graphs without relative URLs
I think there is an issue open on that, let me find it
mmhhh
It’s really a question as to wether the write function takes a « relative graph » or a full graph.
currently it is ambiguous, or rather it does take a relative graph, and so the base is important
can you paste the above in the the banana-rdf issue
then I’ll comment on it, and link it
Justas Ažna
@reederz
Mar 06 2015 13:48
ok, will do
Henry Story
@bblfish
Mar 06 2015 13:49
thanks for spotting
Justas Ažna
@reederz
Mar 06 2015 13:52
np
Henry Story
@bblfish
Mar 06 2015 14:05
I’ll write a patch for banana-rdf
or do you have one already?
I’ll do it now, it will be quick
Justas Ažna
@reederz
Mar 06 2015 14:12
I don't have it
thanks
would you patch series 0.7.x or series 0.8.x or both?
because we're using 0.8-SNAPSHOT on rww-scala-js
Henry Story
@bblfish
Mar 06 2015 14:15
0.7.x
Alexandre then takes care of moving that over to 0.8.x
Justas Ažna
@reederz
Mar 06 2015 14:16
cool
Henry Story
@bblfish
Mar 06 2015 14:16
but the problem is that the version I have is also different in another respect, and he does not want to accept a patch
Justas Ažna
@reederz
Mar 06 2015 14:19
you mean you will make a patch fixing the relative URL issue on read-write-web fork and it is likely that he won't accept it into w3c?
Henry Story
@bblfish
Mar 06 2015 14:20
because of w3c/banana-rdf#228
but I don’t have time to argue in detail with alex
there are some points where he is perhaps right, but it’s just sometimes not worth the fight
Justas Ažna
@reederz
Mar 06 2015 14:22
That's right... Well I'll just work with your fork then
Henry Story
@bblfish
Mar 06 2015 15:08
ah no, the problem is the serialiser
Justas Ažna
@reederz
Mar 06 2015 15:17
I didn't think of it. Do you have time to fix it?
Henry Story
@bblfish
Mar 06 2015 15:47
ok
done
publishLocal and tell me if it fixes it
@reederz
Justas Ažna
@reederz
Mar 06 2015 15:50
thanks. I'll try it within an hour- got caught up in something else
Henry Story
@bblfish
Mar 06 2015 15:50
ok, need to go on an errand too
Justas Ažna
@reederz
Mar 06 2015 17:00
ok, it didn't work
the same end result
but in the server log I see correct (absolute) subjects & objects:
[DEBUG] [03/06/2015 17:58:50.719] [rww-akka.actor.default-dispatcher-6] [akka://rww/user/router] received ScriptMessage(Return(LocalLDPR(https://localhost:8443/2013/couch,[(_:genid-39c4c90cf7a44108a330b8f8ecfc78f0-node19fn63u4nx2, http://www.w3.org/2000/10/swap/pim/contact#city, "Fontainebleau"^^<http://www.w3.org/2001/XMLSchema#string>) [null], (https://localhost:8443/2013/couch#mycouch, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://bblfish.net/2013/05/10/couch#Surf) [null], (_:genid-39c4c90cf7a44108a330b8f8ecfc78f0-node19fn63u4nx1, http://www.w3.org/2000/10/swap/pim/contact#address, _:genid-39c4c90cf7a44108a330b8f8ecfc78f0-node19fn63u4nx2) [null], (_:genid-39c4c90cf7a44108a330b8f8ecfc78f0-node19fn63u4nx2, http://www.w3.org/2000/10/swap/pim/contact#street, "21 rue Saint Honoré"^^<http://www.w3.org/2001/XMLSchema#string>) [null], (https://localhost:8443/2013/couch#mycouch, http://purl.org/goodrelations/v1#name, "Very Unstable Couch"^^<http://www.w3.org/2001/XMLSchema#string>) [null], (https://localhost:8443/2013/couch#mycouch, http://purl.org/goodrelations/v1#color, "Red"^^<http://www.w3.org/2001/XMLSchema#string>) [null], (_:genid-39c4c90cf7a44108a330b8f8ecfc78f0-node19fn63u4nx2, http://www.w3.org/2000/10/swap/pim/contact#country, "France"^^<http://www.w3.org/2001/XMLSchema#string>) [null], (https://localhost:8443/2013/couch#mycouch, http://purl.org/goodrelations/v1#location, _:genid-39c4c90cf7a44108a330b8f8ecfc78f0-node19fn63u4nx1) [null], (https://localhost:8443/2013/couch#mycouch, http://purl.org/goodrelations/v1#description, "Comfortable couch in Artist Stables"^^<http://www.w3.org/2001/XMLSchema#string>) [null], (_:genid-39c4c90cf7a44108a330b8f8ecfc78f0-node19fn63u4nx2, http://www.w3.org/2000/10/swap/pim/contact#postalCode, "77300"^^<http://www.w3.org/2001/XMLSchema#string>) [null], (https://localhost:8443/2013/couch, http://www.w3.org/ns/ldp#contains, https://localhost:8443/2013/couch) [null]],/home/justas/Source/scala/workspace/jolocom/rww-play/test_www/couch,None)))
Justas Ažna
@reederz
Mar 06 2015 17:10
I will try to cross-compile
have a hunch that it might help
Justas Ažna
@reederz
Mar 06 2015 18:16
so my local ivy got messed up- I dropped everything and recompiled
now it kinda works but not quite
here it is:
[  7:15PM ]  [ justas@choedankal:~/Source/scala/workspace/jolocom/rww-play/test_www(jolocom✗) ]
 $ curl -k -i -H "Accept: application/n-triples" -X GET \
   --cert ../eg/test-localhost.pem:test https://localhost:8443/2013/couch
HTTP/1.1 200 OK
Accept-Patch: application/sparql-update
Access-Control-Allow-Origin: *
Allow: OPTIONS, GET, HEAD, SEARCH, PUT, DELETE, PUT, PATCH
Content-Type: application/n-triples
ETag: "1425638154104|Success(857)"
Last-Modified: Fri, 06 Mar 2015 10:35:54 GMT
Link: <http://www.w3.org/ns/ldp#Resource>; rel=type, <couch.acl>; rel=acl
Content-Length: 1635

<http://localhost:8888/#mycouch> <http://purl.org/goodrelations/v1#location> _:genid-271498a3bdf441acb1bddd4f3559c9f2-node19fn63u4nx1 .
<http://localhost:8888/#mycouch> <http://purl.org/goodrelations/v1#description> "Comfortable couch in Artist Stables"^^<http://www.w3.org/2001/XMLSchema#string> .
_:genid-271498a3bdf441acb1bddd4f3559c9f2-node19fn63u4nx2 <http://www.w3.org/2000/10/swap/pim/contact#city> "Fontainebleau"^^<http://www.w3.org/2001/XMLSchema#string> .
_:genid-271498a3bdf441acb1bddd4f3559c9f2-node19fn63u4nx2 <http://www.w3.org/2000/10/swap/pim/contact#country> "France"^^<http://www.w3.org/2001/XMLSchema#string> .
<http://localhost:8888/> <http://www.w3.org/ns/ldp#contains> <http://localhost:8888/> .
<http://localhost:8888/#mycouch> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://bblfish.net/2013/05/10/couch#Surf> .
<http://localhost:8888/#mycouch> <http://purl.org/goodrelations/v1#color> "Red"^^<http://www.w3.org/2001/XMLSchema#string> .
_:genid-271498a3bdf441acb1bddd4f3559c9f2-node19fn63u4nx2 <http://www.w3.org/2000/10/swap/pim/contact#street> "21 rue Saint Honoré"^^<http://www.w3.org/2001/XMLSchema#string> .
_:genid-271498a3bdf441acb1bddd4f3559c9f2-node19fn63u4nx1 <http://www.w3.org/2000/10/swap/pim/contact#address> _:genid-271498a3bdf441acb1bddd4f3559c9f2-node19fn63u4nx2 .
_:genid-271498a3bdf441acb1bddd4f3559c9f2-node19fn63u4nx2 <http://www.w3.org/2000/10/swap/pim/contact#postalCode> "77300"^^<http://www.w3.org/2001/XMLSchema#string> .
<http://localhost:8888/#mycouch> <http://purl.org/goodrelations/v1#name> "Very Unstable Couch"^^<http://www.w3.org/2001/XMLSchema#string> .
so for some reason it adds http://localhost:8888 to the relative part instead of https://localhost:8443/2013/couch
is it some kind of default server location from play?
Henry Story
@bblfish
Mar 06 2015 18:40
did my patch help then?
Justas Ažna
@reederz
Mar 06 2015 18:40
it helped, but there's a small fix that was needed in rww-play
need to change to graph instead of relativeGraph
like here
but I don't know if it would have some overall impact
here's the end result:
[  7:39PM ]  [ justas@choedankal:~/Source/scala/workspace/jolocom/rww-play/test_www(jolocom✗) ]
 $ curl -k -i -H "Accept: application/n-triples" -X GET \   
   --cert ../eg/test-localhost.pem:test https://localhost:8443/2013/couch
HTTP/1.1 200 OK
Accept-Patch: application/sparql-update
Access-Control-Allow-Origin: *
Allow: OPTIONS, GET, HEAD, SEARCH, PUT, DELETE, PUT, PATCH
Content-Type: application/n-triples
ETag: "1425638154104|Success(857)"
Last-Modified: Fri, 06 Mar 2015 10:35:54 GMT
Link: <http://www.w3.org/ns/ldp#Resource>; rel=type, <couch.acl>; rel=acl
Content-Length: 1712

_:genid-229aaf6c571048d28b2a6c1e50ba26ba-node19fn63u4nx2 <http://www.w3.org/2000/10/swap/pim/contact#city> "Fontainebleau"^^<http://www.w3.org/2001/XMLSchema#string> .
<https://localhost:8443/2013/couch#mycouch> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://bblfish.net/2013/05/10/couch#Surf> .
_:genid-229aaf6c571048d28b2a6c1e50ba26ba-node19fn63u4nx1 <http://www.w3.org/2000/10/swap/pim/contact#address> _:genid-229aaf6c571048d28b2a6c1e50ba26ba-node19fn63u4nx2 .
_:genid-229aaf6c571048d28b2a6c1e50ba26ba-node19fn63u4nx2 <http://www.w3.org/2000/10/swap/pim/contact#street> "21 rue Saint Honoré"^^<http://www.w3.org/2001/XMLSchema#string> .
<https://localhost:8443/2013/couch#mycouch> <http://purl.org/goodrelations/v1#name> "Very Unstable Couch"^^<http://www.w3.org/2001/XMLSchema#string> .
<https://localhost:8443/2013/couch#mycouch> <http://purl.org/goodrelations/v1#color> "Red"^^<http://www.w3.org/2001/XMLSchema#string> .
_:genid-229aaf6c571048d28b2a6c1e50ba26ba-node19fn63u4nx2 <http://www.w3.org/2000/10/swap/pim/contact#country> "France"^^<http://www.w3.org/2001/XMLSchema#string> .
<https://localhost:8443/2013/couch#mycouch> <http://purl.org/goodrelations/v1#location> _:genid-229aaf6c571048d28b2a6c1e50ba26ba-node19fn63u4nx1 .
<https://localhost:8443/2013/couch#mycouch> <http://purl.org/goodrelations/v1#description> "Comfortable couch in Artist Stables"^^<http://www.w3.org/2001/XMLSchema#string> .
_:genid-229aaf6c571048d28b2a6c1e50ba26ba-node19fn63u4nx2 <http://www.w3.org/2000/10/swap/pim/contact#postalCode> "77300"^^<http://www.w3.org/2001/XMLSchema#string> .
<https://localhost:8443/2013/couch> <http://www.w3.org/ns/ldp#contains> <https://localhost:8443/2013/couch> .
thanks for your help
Justas Ažna
@reederz
Mar 06 2015 18:58
I made an issue on the small fix which is needed to get absulute URLs fully working at read-write-web/rww-play#149
taking off for now. Have a nice evening
Henry Story
@bblfish
Mar 06 2015 19:01
can you narrow down the error on one line?
Henry Story
@bblfish
Mar 06 2015 19:11
just saying because I am finding it difficult to see where the error lies
ah I see it’s the port number?
Justas Ažna
@reederz
Mar 06 2015 21:44
so the port number, protocol and the slug
I'll comment on the issue instead
or rather, I'll do it tomorrow- the internet here is terrible..