Skip to content

Clarifying and formalizing PropertyValueSpecification to allow options #176

@samuelgoto

Description

@samuelgoto

http://schema.org/PropertyValueSpecification
http://schema.org/potentialAction

Back in April we wrote down [2] on the action spec [1] a mechanism to allow enumerations of possible values that goes in -inputs, but we never formalized it in the schema.

This is coming back on a few threads (one of them with Michael/Alex from Yandex, CC-ed, the other goes hand in hand with the RsvpAction proposal), so it feels about time we formalize it.

We would like to make the following proposal to formalize [2] in [1]: add a valueOption property to PropertyValueSpecification of type Thing with the following comment:

"An enumeration of options that can be used as a value for the -input property associated with the specification. The type of the options is expected to match the types allowed in the property where the -input annotation is attached. The value passed to entry points is the id of the entity."

Here [0] is one example where this appears. [0] would give users to pick between a finite list of car models and would contruct target URLs like the following:

http://www.cars.com/ford/escape
http://www.cars.com/ford/focus

Here [3] is another example of what that would look like if we wanted to limit the options a webmaster accepts as rsvp responses.

[0]

<script type="application/ld+json"> { "@context": "http://schema.org/", "@type": "WebSite", "url": "http://www.cars.com/", "potentialAction": { "@type": "SearchAction", "target": "http://www.cars.com/ford/{model}", "query": { "@type": "Car", "model-input" : { "@type": "PropertyValueSpecification", "valueRequired": true, "valueName": "model", "valueOption": [{ "@type" : "ProductModel", "@id" : "focus", "name" : "Ford Focus" }, { "@type" : "ProductModel", "@id" : "escape", "name" : "Ford Escape" }] } } } } </script>

[1] https://www.w3.org/wiki/images/1/10/PotentialActionsApril11.pdf

[2]
It should also be noted that ifoth a property and its -input annotation are present, the value of the un-annotated propertyshould be treated as the allowed options for input (similar to in HTML) unless the Input indicates that the value is also readonly, in which [3] target template expands to things like: http://www.eventbrite.com/events/123/rsvp?response=yes http://www.eventbrite.com/events/123/rsvp?response=nope <script type="application/ld+json"> { "@context": "http://schema.org/", "@type": "Event", "potentialAction": { "@type": "RsvpAction", "target": "http://www.eventbrite.com/response={response}", "rsvpResponse-input" : { "@type": "PropertyValueSpecification", "valueRequired": true, "valueName": "response", "valueOption": [{ "@type" : "RsvpAttedanceYes", "@id" : "yes", "name" : "Yep, I'm coming" }, { "@type" : "RsvpAttedanceNo", "@id" : "nope", "name" : "Nope, buzy" }] } } </script>

Metadata

Metadata

Assignees

Labels

no-issue-activityDiscuss has gone quiet. Auto-tagging to encourage people to re-engage with the issue (or close it!).schema.org vocabGeneral top level tag for issues on the vocabularytype:tricky problemHard problems, including modeling / vocabulary and infrastructural aspects (eg fiction, probability)

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions