- From: Dietrich Schulten <ds@escalon.de>
- Date: Mon, 13 Oct 2014 09:38:34 +0200
- To: "public-vocabs@w3.org" <public-vocabs@w3.org>
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I wonder how a client should process the input constraints described at http://schema.org/docs/actions.html. Given the latest pull request by elf Pavlik [1], a possible response-request pair could be: Response: { "@context": "http://schema.org", "@type": "ReviewAction", "target": { "@type": "EntryPoint", "urlTemplate": "https://api.example.com/review", "encodingType": "application/ld+json", "contentType": "application/ld+json" }, "object" : { "@type": "Movie", "url-input": "required", }, "result": { "@type": "Review", "url-output": "required", "reviewBody-input": "required", "reviewRating": { "ratingValue-input": "required" } } } Request: POST https://api.example.com/review { "@context": "http://schema.org", "@type": "ReviewAction", "object" : { "@id": "http://example.com/movies/123" }, "result": { "@type": "Review", "reviewBody": "yada, yada, yada", "reviewRating": { "ratingValue": "4" } } } So apparently the processing rule is: if the encoding type of an entry point is application/ld+json, build the response by creating an action object like the one in the response. Keep all attributes which do not end in -input, but ignore the target attribute. Remove every -output attribute. Replace every -input attribute on a nested object by an attribute-value pair which satisfies the input constraints. Apply every "top-level" -input attribute found on the action to the variables of the urlTemplate of the entry point. My questions: - - Is that correct? - - Is it a requirement that a client posts an Action object? Or would it also be possible to post only data needed to create a Review object, maybe as x-www-form-urlencoded or application/json? That might be more in line with existing ReST services, which do not expect an action object. - - has it already been discussed what would be the processing rules for an x-www-form-urlencoded or application/json POST or PUT request? - - Do you think such processing rules for json-ld, form-urlencoded and application/json should be added to http://schema.org/docs/actions.html? If so, I could provide a pull request. Best regards, Dietrich [1] https://github.com/rvguha/schemaorg/pull/123 - -- Dietrich Schulten Escalon System-Entwicklung Bubenhalde 10 74199 Untergruppenbach -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iEYEARECAAYFAlQ7gXoACgkQuKLNitGfiZMDswCePWyxXEpHjMgS38izWxwcxAjP 5n4AoJ3+362HNQ3VZ6OnwxNKDer7kcCV =MPeP -----END PGP SIGNATURE-----
Received on Monday, 13 October 2014 07:39:06 UTC