These are chat archives for csarven/ldn

18th
Apr 2017
Dmitri Zagidulin
@dmitrizagidulin
Apr 18 2017 14:11
I ran into an issue with empty @ids on the JSON-LD playground before. the key here is that there's a 'base uri' sort of field, outside of the textbox where you input the jsonld
and that provides context for <> expansion
Melvin Carvalho
@melvincarvalho
Apr 18 2017 14:43
@dmitrizagidulin good point! However in a POST, im not sure the final base URI is known at that time. Also when signing that data (which may be useful in future) the playground at least seems to throw errors for me with the <> but not with blank node which can be algorithmically canonicalized.
Dmitri Zagidulin
@dmitrizagidulin
Apr 18 2017 14:47
so, regarding POST - isn't that an argument for using empty IDs? otherwise, what would you put there as a subject?
Sarven Capadisli
@csarven
Apr 18 2017 14:47
How is <> of a Turtle known to the implementation in a POST?
Melvin Carvalho
@melvincarvalho
Apr 18 2017 14:47
@dmitrizagidulin agree!
Sarven Capadisli
@csarven
Apr 18 2017 14:48
There is virtually no difference with "@id": "" in JSON-LD of a POST and <> in Turtle of a POST.
Melvin Carvalho
@melvincarvalho
Apr 18 2017 14:48
well one can be signed one cant
Sarven Capadisli
@csarven
Apr 18 2017 14:48
Signed?
Melvin Carvalho
@melvincarvalho
Apr 18 2017 14:49
do you have a signing tab in your playground?
Dmitri Zagidulin
@dmitrizagidulin
Apr 18 2017 14:49
wait, what? they're completely equivalent. why would one be able to be signed and the other not?
Melvin Carvalho
@melvincarvalho
Apr 18 2017 14:49
it's quite a cool feature
because to sign you need to canonicalize
we know how to canonicalize blank nodes, i dont think we know how to canonicalize <>
Dmitri Zagidulin
@dmitrizagidulin
Apr 18 2017 14:49
so why is the turtle <> able to be canonicalized?
Sarven Capadisli
@csarven
Apr 18 2017 14:49
The signing should happen after normalisation IMO
The playground is probably assuming that all IRIs are assigned
I presume that's a bug
Melvin Carvalho
@melvincarvalho
Apr 18 2017 14:51
the canonicalization algo i think that's in most use, and used in the playground, basically converts the RDF to N-quads, alphabeticalizes it, and converts bnodes to something like : _:b0
you cant normalize <> I dont think
I think notifications will be more useful when they are signed to prevent spam. Otherwise we will have inboxes like email and not be able to verify the sender.
its a pretty interesting problem
and actually one ill have to solve pretty soon!
so im motivated to find a good solution
@csarven why would you say it's a bug? Surely the <> is an unknown URI?
wouldnt it be wrong for a parser to 'guess' a uri if it's unknown?
Melvin Carvalho
@melvincarvalho
Apr 18 2017 14:57
relative URIs are really interesting in RDF
Sarven Capadisli
@csarven
Apr 18 2017 14:57
Because I think it shouldn't try to sign based on its raw value.
<> doesn't mean anything until it is parsed/canonicalised.
Just as when you import a Turtle file into an RDF store, it assigns something to it (or you pass a value for the base or whatever) before it making it into the store
It doesn't just error out because of <>
Melvin Carvalho
@melvincarvalho
Apr 18 2017 14:58
because you give it a base uri
i wonder if it's even RDF until then
Sarven Capadisli
@csarven
Apr 18 2017 14:59
Right
So, the signature should work with a canonical form.. not some raw
Melvin Carvalho
@melvincarvalho
Apr 18 2017 15:00
no a signature works with RDF
since the linked data notifications examples are not RDF (I think?) then it cant sign it
Sarven Capadisli
@csarven
Apr 18 2017 15:00
ARe you serious?
Sure.. whatever. They are not RDF.
Or not "5* LD"
Melvin Carvalho
@melvincarvalho
Apr 18 2017 15:01
I could be completely wrong there!
I guess it's too late to change now. But Im curious why authors would not want 5* LD in a specifications doc ...
I can see the use case of <> btw and also <#this>
Dmitri Zagidulin
@dmitrizagidulin
Apr 18 2017 15:03
how are linked data notifications not RDF?
Sarven Capadisli
@csarven
Apr 18 2017 15:03
How are the examples not "5* LD"?
and how do you generalise from that the LDN spec is not "5* LD"?
Is LDN preventing you from creating "5* LD" payloads?
If so, where?
Melvin Carvalho
@melvincarvalho
Apr 18 2017 15:04
wait what? im quoting what you said or was there a missing </sarcasm> tag :)
Sarven Capadisli
@csarven
Apr 18 2017 15:05
I don't understand the issue to be honest.
The examples are 100% valid JSON-LD.
Melvin Carvalho
@melvincarvalho
Apr 18 2017 15:06
i dont know the answer to that question, is a turtle file containing <> valid turtle and not valid rdf or valid turtle and valid rdf ... I really dont know the answer to that
Sarven Capadisli
@csarven
Apr 18 2017 15:06
Whether the signature algorithm at JSON-LD playground is pooping up or not is completely irrelevant.
What does Turtle with <> have anything to do with LDN (or its examples)?
Melvin Carvalho
@melvincarvalho
Apr 18 2017 15:07
Im not sure it's completely irrelevant, as the purpose of examples is to guide developers. And if the example throws an error in the most popular playground it may lead to confusion. It did for me at least, and I have some experience with LD. Im still a bit confused.
Turtle with <> is the same as @id : "" in JSON LD you said ...
Dmitri Zagidulin
@dmitrizagidulin
Apr 18 2017 15:09
ok, <> is valid turtle, and @id: "" is valid JSON-LD
Sarven Capadisli
@csarven
Apr 18 2017 15:09
There are about million reasons some implementation could be doing wrong with the valid JSON-LD examples.
Dmitri Zagidulin
@dmitrizagidulin
Apr 18 2017 15:10
(I know this cause I was hoping they weren't valid, which meant I didn't have to fix Sarven's bug in solid serialization.)
Sarven Capadisli
@csarven
Apr 18 2017 15:11
Not to mention that https://w3c-dvcg.github.io/ld-signatures/ is a CG draft.
So, if there is an invalid JSON-LD payload, happy to fix that in the spec.
The spec has examples where the id value is: "" or "/foo" or "#foo"
I think that's sufficient coverage, yes?
Melvin Carvalho
@melvincarvalho
Apr 18 2017 15:14
sure but it's called 'linked data' notifications, not 'json-ld' notifications ... im just curious as to whether the examples are RDF ... genuine question, I dont know
Sarven Capadisli
@csarven
Apr 18 2017 15:15
Ok, then, I'm telling you that they are valid RDF. If you are unsure, please go ahead and validate them.
Melvin Carvalho
@melvincarvalho
Apr 18 2017 15:16
thanks, its interesting to me as ill probably have to write similar specs and similar examples quite soon (eg for payments)
I always had thought in RDF you needed a base uri to turn a relative URI into an RDF URI Reference
Sarven Capadisli
@csarven
Apr 18 2017 15:19
Yes, called "LD" notifications because JSON-LD is the only minimum requirement for all applications to speak. If they can negotiate among themselves (and some of the ways are already mentioned in the spec) then that's completely open. So, for instance, two applications while knowing how to handle JSON-LD may completely and only communicate using Turtle.
Totally fine.
So, yes, I consider this to be "LD"... and not strictly JSON-LD
Just as LDP is not "Turtle+JSON-LD Platform"
There are rules for how base URI is determined.
Some syntaxes have a way to declare that.
e.g., @base .., base=".."..
if not found, it goes up the chain.. until it probably settles on the URL it is made aware of
That information it sort of "out of band"
It could be a valued passed into the software so that it is used as the base.
Whether that comes form a command-line parameter, or whatever is given to the library is something else.
Software is expected to know how to handle relative URLs.
Melvin Carvalho
@melvincarvalho
Apr 18 2017 15:23
I think you may have misunderstood my question. Or maybe you've answered it already, in which case I apologize! But to clarify my understanding is that <> and "@id" : "" are language specific part of turtle and JSON-LD. What I was unclear on was whether they are part of the RDF set of specifications. I think you've answered that they are, which is something I dindt know before. So thanks! :)
Sarven Capadisli
@csarven
Apr 18 2017 15:23
and ... the details of that is completely outside the scope here
Yes, to the best of my knowledge, they are.
Sorry, didn't mean to cause confusion either.
Melvin Carvalho
@melvincarvalho
Apr 18 2017 15:24
I suppose I should look at the LDP examples
<> a foaf:PersonalProfileDocument;
    foaf:primaryTopic <#me> ;
    dc:title 'Alice’s FOAF file' .

<#me> a foaf:Person;
    foaf:name 'Alice Smith'  .
interesting
that apostrophe looks a bit dangerous! :)
hmm they mix single and double quotes
Sarven Capadisli
@csarven
Apr 18 2017 15:27
I notice """ being used by some serializers
` is fine inside '
Melvin Carvalho
@melvincarvalho
Apr 18 2017 15:28
actually """ doesnt work too well in gold
Dmitri Zagidulin
@dmitrizagidulin
Apr 18 2017 15:29
oh interesting, I didn't realize single quotes is valid rdf string syntax.
(valid turtle, rather)
Sarven Capadisli
@csarven
Apr 18 2017 15:32
There are some constraints depending on the character: https://www.w3.org/TR/turtle/#turtle-literals
Sarven Capadisli
@csarven
Apr 18 2017 15:43
BTW, the error at JSON-LD with the signature tab doesn't appear to be accurate either. It is talking about an error with context if you leave id empty.. but if you have a value for id, it goes away.
The first bit seems more accurate "The data to sign is empty."
So, it should make sure to have a value for id beforehand.
Sarven Capadisli
@csarven
Apr 18 2017 16:03
@melvincarvalho @dmitrizagidulin FYI in IRC Freenode #json-ld just now:
[17:46:08] <csarven> The playground throws a processing error when "@id": ""
[17:46:45] <csarven> 'Error: [jsig.sign] The data to sign is empty. This error may be because a "@context" was not supplied in the input thereby causing any terms or prefixes to be undefined.'
[17:47:19] <csarven> In the "Signed with RSA" tab.
[17:47:25] <csarven> Which is a bit awkward.. if you add a value to id, error goes away
[17:47:53] <csarven> Is it possible that it should figure out the base URL for the empty value before going ahead with the canonicalisation?
[17:59:03] <dlongley> csarven: sounds like a bug -- like it's not using a default base URL like you said.
[18:00:33] <csarven> dlongley Thanks for confirming. The N-Quads tab for example uses http://json-ld.org/playground/
[18:02:48] <dlongley> sure, yeah some inconsistency bug in there somewhere :)
Melvin Carvalho
@melvincarvalho
Apr 18 2017 16:06
that's interesting, im unsure the playground should pull in its own URI
especially when that uri can be rather long in a permalink
would #this then become plaground#json#this
Sarven Capadisli
@csarven
Apr 18 2017 16:08
[18:04:11] <dlongley> csarven: did you have any other information other than "@id": ""?
[18:04:41] <csarven> Other? See this example: http://json-ld.org/playground/#startTab=tab-nquads&json-ld=%7B%22%40context%22%3A%7B%22pingback%22%3A%22http%3A%2F%2Fpurl.org%2Fnet%2Fpingback%2F%22%7D%2C%22%40id%22%3A%22%22%2C%22%40type%22%3A%22pingback%3AItem%22%2C%22pingback%3Asource%22%3A%7B%22%40id%22%3A%22http%3A%2F%2Fexample.net%2Fnote%23foo%22%7D%2C%22pingback%3Atarget%22%3A%7B%22%40id%22%3A%22http%3A%2F%2Fexample.org%2Farticle%23results%22%7D%7D
[18:05:26] <dlongley> yeah, ok, i see that you did .... yeah, i mean "other" properties such that some triples would be generated
[18:06:26] <dlongley> yeah, definitely looks buggy to me, i'm going to make a note of it on another issue that's still open for fixing false positive empty data-to-sign
Any way.. out of scope for LDN
Melvin Carvalho
@melvincarvalho
Apr 18 2017 16:09
relative uris are quite tricky