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

Issue 469 - Create distinct fields for different cases of birth date #498

Merged
merged 4 commits into from
Aug 30, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions schemas/context/person.example.1.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,5 @@
"xdm:lastName": "Doe",
"xdm:fullName": "Jane F. Doe"
},
"xdm:birthMonth": 1,
"xdm:birthDay": 3,
"xdm:birthYear": 1996,
"xdm:gender": "female"
"xdm:birthDate": "1996-01-03"
}
9 changes: 9 additions & 0 deletions schemas/context/person.example.2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"xdm:name": {
"xdm:firstName": "Jane",
"xdm:middleName": "F",
"xdm:lastName": "Doe",
"xdm:fullName": "Jane F. Doe"
},
"xdm:birthDayAndMonth": "01-03"
}
157 changes: 87 additions & 70 deletions schemas/context/person.schema.json
Original file line number Diff line number Diff line change
@@ -1,74 +1,91 @@
{
"meta:license": [
"Copyright 2017 Adobe Systems Incorporated. All rights reserved.",
"This work is licensed under a Creative Commons Attribution 4.0 International (CC BY 4.0) license",
"you may not use this file except in compliance with the License. You may obtain a copy",
"of the License at https://creativecommons.org/licenses/by/4.0/"
],
"$id": "https://ns.adobe.com/xdm/context/person",
"$schema": "http://json-schema.org/draft-06/schema#",
"title": "Person",
"type": "object",
"meta:extensible": true,
"meta:auditable": true,
"description":
"An individual person. May represent a person acting in various roles, such as a customer, contact, or owner.",
"definitions": {
"person": {
"properties": {
"xdm:name": {
"title": "Full name",
"$ref": "https://ns.adobe.com/xdm/context/person-name",
"description": "The person's full name"
},
"xdm:birthDay": {
"title": "Birth day",
"type": "integer",
"description": "The day of the month a person was born (1-31).",
"minimum": 1,
"maximum": 31
},
"xdm:birthMonth": {
"title": "Birth month",
"type": "integer",
"description": "The month of the year a person was born (1-12).",
"minimum": 1,
"maximum": 12
"meta:license": [
"Copyright 2017 Adobe Systems Incorporated. All rights reserved.",
"This work is licensed under a Creative Commons Attribution 4.0 International (CC BY 4.0) license",
"you may not use this file except in compliance with the License. You may obtain a copy",
"of the License at https://creativecommons.org/licenses/by/4.0/"
],
"$id": "https://ns.adobe.com/xdm/context/person",
"$schema": "http://json-schema.org/draft-06/schema#",
"title": "Person",
"type": "object",
"meta:extensible": true,
"meta:auditable": true,
"description": "An individual person. May represent a person acting in various roles, such as a customer, contact, or owner.",
"definitions": {
"person": {
"properties": {
"xdm:name": {
"title": "Full name",
"$ref": "https://ns.adobe.com/xdm/context/person-name",
"description": "The person's full name"
},
"xdm:birthDay": {
"title": "Birth day",
"type": "integer",
"description": "The day of the month a person was born (1-31).",
"minimum": 1,
"maximum": 31,
"meta:status": "deprecated"
},
"xdm:birthMonth": {
"title": "Birth month",
"type": "integer",
"description": "The month of the year a person was born (1-12).",
"minimum": 1,
"maximum": 12,
"meta:status": "deprecated"
},
"xdm:birthDate": {
"title": "Birth Date",
"type": "string",
"format": "date",
"description": "The full date a person was born."
},
"xdm:birthDayAndMonth": {
"title": "Birth Date",
"type": "string",
"pattern": "[0-1][0-9]-[0-9][0-9]",
"description": "The day and month a person was born, in the format MM-DD. This field should be used when the day and month of a person's birth is known, but not the year."
},
"xdm:birthYear": {
"title": "Birth year",
"type": "integer",
"description": "The year a person was born including the century (yyyy, e.g 1983). This field should be used when only the person's age is known, not the full birth date.",
"minimum": 1,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this minimum for a birth year reasonable ? I mean, if we set limits, shouldn't those limits be meaningful ?

In other words, is a birth year of, say, 67, reasonable for our XDM use cases ? And why would -100 (the assumed birth year of Julius Caesar) not be ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this needs work. This definition will let folks move forward, we should improve this under a new issue.

"maximum": 32767
},
"xdm:gender": {
"title": "Gender",
"type": "string",
"enum": [
"male",
"female",
"not_specified",
"non_specific"
],
"meta:enum": {
"male": "Male",
"female": "Female",
"not_specified": "Not Specified",
"non_specific": "Nonspecific"
},
"description": "Gender identity of the person.\n",
"default": "not_specified"
}
}
}
},
"allOf": [
{
"$ref": "https://ns.adobe.com/xdm/common/extensible#/definitions/@context"
},
"xdm:birthYear": {
"title": "Birth year",
"type": "integer",
"description":
"The year a person was born including the century (yyyy, e.g 1983).",
"minimum": 1,
"maximum": 32767
{
"$ref": "#/definitions/person"
},
"xdm:gender": {
"title": "Gender",
"type": "string",
"enum": ["male", "female", "not_specified", "non_specific"],
"meta:enum": {
"male": "Male",
"female": "Female",
"not_specified": "Not Specified",
"non_specific": "Nonspecific"
},
"description": "Gender identity of the person.\n",
"default": "not_specified"
{
"$ref": "https://ns.adobe.com/xdm/common/auditable"
}
}
}
},
"allOf": [
{
"$ref": "https://ns.adobe.com/xdm/common/extensible#/definitions/@context"
},
{
"$ref": "#/definitions/person"
},
{
"$ref": "https://ns.adobe.com/xdm/common/auditable"
}
],
"meta:status": "experimental"
}
],
"meta:status": "experimental"
}