Skip to content

Commit

Permalink
feat(Date): Add Date schema
Browse files Browse the repository at this point in the history
  • Loading branch information
nokome committed Aug 20, 2019
1 parent 94c2a5f commit 008247f
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 6 deletions.
2 changes: 1 addition & 1 deletion schema/ContactPoint.schema.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
title: ContactPoint
'@id': schema:contactPoint
'@id': schema:ContactPoint
extends: Thing
role: tertiary
status: unstable
Expand Down
3 changes: 3 additions & 0 deletions schema/CreativeWork.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ properties:
'@id': schema:dateCreated
description: Date/time of creation.
anyOf:
- $ref: Date
- type: string
format: date
- type: string
Expand All @@ -45,6 +46,7 @@ properties:
'@id': schema:dateModified
description: Date/time of most recent modification.
anyOf:
- $ref: Date
- type: string
format: date
- type: string
Expand All @@ -60,6 +62,7 @@ properties:
# Although schema.org says expected values are `Date`, for
# consistency with `dateCreated` and `dateModified` we allow
# for `DateTime` as well.
- $ref: Date
- type: string
format: date
- type: string
Expand Down
19 changes: 19 additions & 0 deletions schema/Date.schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
title: Date
'@id': schema:Date
extends: Entity
role: tertiary
status: stable
category: metadata
description: A date encoded as a ISO 8601 string.
$comment: This
properties:
value:
'@id': 'schema:value'
description: The date as a ISO 8601 string.
anyOf:
- type: string
format: date
- type: string
format: date-time
required:
- value
4 changes: 3 additions & 1 deletion schema/Periodical.schema.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
title: Periodical
'@id': stencila:Periodical
'@id': schema:Periodical
extends: CreativeWork
role: secondary
status: unstable
Expand All @@ -11,6 +11,7 @@ properties:
description: The date this Periodical was first published.
type: string
anyOf:
- $ref: Date
- type: string
format: date
- type: string
Expand All @@ -20,6 +21,7 @@ properties:
description: The date this Periodical ceased publication.
type: string
anyOf:
- $ref: Date
- type: string
format: date
- type: string
Expand Down
6 changes: 3 additions & 3 deletions schema/PublicationIssue.schema.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
title: PublicationIssue
'@id': stencila:PublicationIssue
'@id': schema:PublicationIssue
extends: CreativeWork
role: secondary
status: unstable
category: metadata
description: |
A part of a successively published publication such as a periodical or publication
A part of a successively published publication such as a periodical or publication
volume, often numbered.
properties:
issueNumber:
Expand All @@ -29,6 +29,6 @@ properties:
pagination:
'@id': schema:pagination
description: |
Any description of pages that is not separated into pageStart and pageEnd;
Any description of pages that is not separated into pageStart and pageEnd;
for example, "1-6, 9, 55".
type: string
2 changes: 1 addition & 1 deletion schema/PublicationVolume.schema.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
title: PublicationVolume
'@id': stencila:PublicationVolume
'@id': schema:PublicationVolume
extends: CreativeWork
role: secondary
status: unstable
Expand Down

0 comments on commit 008247f

Please sign in to comment.