Use-cases wanted! Adding dietary requirements to Schema.org/Person
I want Schema.org to add dietary requirements to the Person
specification. And I need your help!
Background
Schema.org is a metadata standard. You can include it on webpages to create structured, machine-readable data.
Here's a sample way of representing a Person:
JSON
{
"@context": "https://schema.org/",
"@type": "Person",
"name": "Albert Einstein",
"hasOccupation": [
{
"@type": "Occupation",
"name": "Professor of Physics",
"occupationLocation": {
"@type": "Country",
"name": "USA",
"sameAs": "https://www.wikidata.org/wiki/Q30"
}
}
]
}
Hopefully easy to follow. This is a Person
, they have a name
and an occupation
. That occupation
has a name
and is located in a country
. That country
has some linked data.
There are all sorts of properties we can associate with a Person
- birth and death dates, memberships, nationality, credentials, tax ID, and even weight! See Schema.org/Person for a full list.
One which I think would be useful is a person's diet.
Diet
Schema already has the concept of a RestrictedDiet
type. It lists things like Vegetarian, Halal, Kosher, Low Salt etc.
But it only applies to MenuItem
and Recipe
types. That is, I can mark up a restaurant's menu and say that this dish is Gluten Free, and that dish is Vegan friendly.
JSON
{
"@context": "http://schema.org",
"@type":"MenuItem",
"name":"Potato Skins",
"description":"Small serving of baked potato skins.",
"offers":{
"@type":"Offer",
"price":"4.49",
"priceCurrency":"GBP"
},
"suitableForDiet":[
{
"@type": "GlutenFreeDiet"
},
{
"@type": "VeganDiet"
}
]
}
My Use Cases
I maintain a personal contact site. I tell people my name, address, occupation, etc. I also want to inform other people that I am vegetarian.
- On a social network, it might be nice to have an (optional) feature where people give their dietary preferences.
- My Jewish and Muslim friends might want to automatically filter out the pork casserole recipes people post.
- My address book might suggest a restaurant which caters for my guests' preferences.
- An encyclopædia can show dietary restrictions of famous people.
- An airline could - with permission - read your social profile to select your meal for a flight.
Sample
Here's how I think it could work:
JSON
{
"@context": "https://schema.org/",
"@type": "Person",
"name": "Terence Eden",
"restrictedDiet": "http://schema.org/VegetarianDiet"
}
That is, just add restrictedDiet
as a valid property of Person
. I suppose it could be hasDiet
or dietaryPreference
or similar.
Your Use Cases
If you want to add your own use cases, or just think this is a good idea, please leave a comment on GitHub.com/schemaorg/schemaorg/issues/1996
Neil says:
Difficult Guest says:
Guest says: