Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add payload example using Webmention terms #63

Closed
aaronpk opened this issue Apr 12, 2017 · 5 comments
Closed

Add payload example using Webmention terms #63

aaronpk opened this issue Apr 12, 2017 · 5 comments

Comments

@aaronpk
Copy link
Member

aaronpk commented Apr 12, 2017

Given that Webmention is a W3C REC, and that LDN already has an example of sending a Pingback payload, it seems appropriate to add an example using Webmention as well.

I think the Webmention example payload would look like the following, given the Webmention namespace document at https://www.w3.org/ns/webmention

{
  "@context": { "wm": "https://www.w3.org/ns/webmention" }
  "@id": "",
  "wm:source": { "@id": "http://example.net/reply" },
  "wm:target": { "@id": "http://example.org/article" }
}
@rhiaro
Copy link
Member

rhiaro commented Apr 13, 2017

I dunno, it seems unlikely that anyone looking at the LDN spec is going to straight up want to send webmentions as JSON. They might be looking if they want to bridge between LDN and Webmention, in which case this example is already in http://w3c-social.github.io/social-web-protocols/#ldn-to-wm

@csarven
Copy link
Member

csarven commented Apr 13, 2017

The Pingback example is not particularly interesting or useful either. Okay to remove that if need to.

There is a sufficient number and variety of examples in the spec in any case.

@melvincarvalho
Copy link
Contributor

melvincarvalho commented Apr 14, 2017

Commenting only on the syntax of the example.

Is this correct?

"@id": "",

I think in this case you would want to have a blank node meaning a message that doesnt have a specific URI. In this case you could leave out the @id completely:

{
  "@context": { "wm": "https://www.w3.org/ns/webmention" }
  "wm:source": { "@id": "http://example.net/reply" },
  "wm:target": { "@id": "http://example.org/article" }
}

OR to avoid a round trip of the context lookup

{
  "https://www.w3.org/ns/webmention#source": { "@id": "http://example.net/reply" },
  "https://www.w3.org/ns/webmention#target": { "@id": "http://example.org/article" }
}

Whether or not this example is included, I'd be interested to see the valid syntax on this, as it's something I raised before. Let me know if you think that's correct. :)

@rhiaro
Copy link
Member

rhiaro commented Apr 14, 2017

@melvincarvalho if you want to debate the syntax of the examples in the spec, please open a new issue. For the record, either is correct, and both result in different semantics (no @id = blank node, empty @id = relative URI, run it through the JSON-LD playground if you're still not sure).

@aaronpk
Copy link
Member Author

aaronpk commented Apr 16, 2017

Okay, the SWP already document covers this. It will be good to get an updated version of that published.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants