Skip to content
This repository has been archived by the owner on Jan 27, 2022. It is now read-only.

Commit

Permalink
refactor(Schema): Don't use .schema.yaml extension
Browse files Browse the repository at this point in the history
Using this extension mimicked a pure JSON Schema but was unecessary and causes unecssaary complications elsewhere
  • Loading branch information
nokome committed Jul 22, 2019
1 parent f03c2e1 commit 0972799
Show file tree
Hide file tree
Showing 47 changed files with 129 additions and 134 deletions.
4 changes: 2 additions & 2 deletions schema/Article.schema.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
title: Article
'@id': schema:Article
extends: CreativeWork.schema.yaml
extends: CreativeWork
role: primary
status: unstable
properties:
Expand All @@ -9,7 +9,7 @@ properties:
description: |
The computational environment in which the document should be executed.
allOf:
- $ref: Environment.schema.yaml
- $ref: Environment

required:
# See Google's list of required properties at
Expand Down
2 changes: 1 addition & 1 deletion schema/AudioObject.schema.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
title: AudioObject
'@id': schema:AudioObject
extends: MediaObject.schema.yaml
extends: MediaObject
role: secondary
status: stable
description: |
Expand Down
18 changes: 9 additions & 9 deletions schema/BlockContent.schema.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
title: BlockContent
description: Block content.
anyOf:
- $ref: CodeBlock.schema.yaml
- $ref: CodeChunk.schema.yaml
- $ref: Heading.schema.yaml
- $ref: List.schema.yaml
- $ref: ListItem.schema.yaml
- $ref: Paragraph.schema.yaml
- $ref: QuoteBlock.schema.yaml
- $ref: Table.schema.yaml
- $ref: ThematicBreak.schema.yaml
- $ref: CodeBlock
- $ref: CodeChunk
- $ref: Heading
- $ref: List
- $ref: ListItem
- $ref: Paragraph
- $ref: QuoteBlock
- $ref: Table
- $ref: ThematicBreak
4 changes: 2 additions & 2 deletions schema/Brand.schema.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
title: Brand
'@id': schema:Brand
extends: Thing.schema.yaml
extends: Thing
role: tertiary
status: unstable
description: |
Expand All @@ -13,7 +13,7 @@ properties:
anyOf:
- type: string
format: uri
- $ref: ImageObject.schema.yaml
- $ref: ImageObject
reviews:
'@id': schema:review
description: |
Expand Down
2 changes: 1 addition & 1 deletion schema/Code.schema.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
title: Code
'@id': stencila:Code
extends: Thing.schema.yaml
extends: Thing
role: secondary
status: stable
description: Inline code.
Expand Down
2 changes: 1 addition & 1 deletion schema/CodeBlock.schema.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
title: CodeBlock
'@id': stencila:CodeBlock
extends: Code.schema.yaml
extends: Code
role: secondary
status: stable
description: A code block.
Expand Down
4 changes: 2 additions & 2 deletions schema/CodeChunk.schema.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
title: CodeChunk
'@id': stencila:CodeChunk
extends: SoftwareSourceCode.schema.yaml
extends: SoftwareSourceCode
role: secondary
status: unstable
description: |
Expand All @@ -12,4 +12,4 @@ properties:
Outputs from executing the chunk.
type: array
items:
$ref: Node.schema.yaml
$ref: Node
4 changes: 2 additions & 2 deletions schema/CodeExpr.schema.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
title: CodeExpr
'@id': stencila:CodeExpr
extends: SoftwareSourceCode.schema.yaml
extends: SoftwareSourceCode
role: secondary
status: unstable
description: An expression.
properties:
value:
'@id': schema:value
allOf:
- $ref: Node.schema.yaml
- $ref: Node
2 changes: 1 addition & 1 deletion schema/Collection.schema.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
title: Collection
'@id': schema:Collection
extends: CreativeWork.schema.yaml
extends: CreativeWork
role: secondary
status: stable
description: |
Expand Down
2 changes: 1 addition & 1 deletion schema/ContactPoint.schema.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
title: ContactPoint
'@id': schema:contactPoint
extends: Thing.schema.yaml
extends: Thing
role: tertiary
status: unstable
description: A contact point—for example, a R&D department. https://schema.org/ContactPoint.
Expand Down
26 changes: 13 additions & 13 deletions schema/CreativeWork.schema.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
title: CreativeWork
'@id': schema:CreativeWork
extends: Thing.schema.yaml
extends: Thing
role: base
status: stable
description: |
Expand All @@ -13,8 +13,8 @@ properties:
type: array
items:
anyOf:
- $ref: Person.schema.yaml
- $ref: Organization.schema.yaml
- $ref: Person
- $ref: Organization
citations:
'@id': schema:citation
description: |
Expand All @@ -24,15 +24,15 @@ properties:
items:
anyOf:
- type: string
- $ref: CreativeWork.schema.yaml
- $ref: CreativeWork
content:
# We have added "content" because the existing schema.org property "text" implies
# only unstructured text content.
'@id': stencila:content
description: The structured content of this creative work c.f. property `text`.
type: array
items:
$ref: Node.schema.yaml
$ref: Node
dateCreated:
'@id': schema:dateCreated
description: Date/time of creation.
Expand Down Expand Up @@ -70,22 +70,22 @@ properties:
Persons who edited the CreativeWork.
type: array
items:
$ref: Person.schema.yaml
$ref: Person
funders:
'@id': schema:funder
description: |
Person or organisation that funded the CreativeWork.
type: array
items:
anyOf:
- $ref: Person.schema.yaml
- $ref: Organization.schema.yaml
- $ref: Person
- $ref: Organization
isPartOf:
'@id': schema:isPartOf
description: |
An item or other CreativeWork that this CreativeWork is a part of.
allOf:
- $ref: CreativeWork.schema.yaml
- $ref: CreativeWork
licenses:
'@id': schema:license
description: |
Expand All @@ -95,7 +95,7 @@ properties:
anyOf:
- type: string
format: uri
- $ref: CreativeWork.schema.yaml
- $ref: CreativeWork
parts:
# The name "parts" seems more intuitive for users and developers than schema.orgs's "hasParts".
# We provide the latter as an alias.
Expand All @@ -107,14 +107,14 @@ properties:
such as Articles, Datatables, Tables and more.
type: array
items:
$ref: CreativeWork.schema.yaml
$ref: CreativeWork
publisher:
'@id': schema:publisher
description: |
A publisher of the CreativeWork.
anyOf:
- $ref: Person.schema.yaml
- $ref: Organization.schema.yaml
- $ref: Person
- $ref: Organization
text:
'@id': schema:text
description: The textual content of this creative work.
Expand Down
4 changes: 2 additions & 2 deletions schema/Datatable.schema.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
title: Datatable
'@id': stencila:Datatable
extends: CreativeWork.schema.yaml
extends: CreativeWork
role: primary
status: experimental
description: A table of data.
Expand All @@ -9,6 +9,6 @@ properties:
description: TODO
type: array
items:
$ref: DatatableColumn.schema.yaml
$ref: DatatableColumn
required:
- columns
4 changes: 2 additions & 2 deletions schema/DatatableColumn.schema.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
title: DatatableColumn
'@id': stencila:DatatableColumn
extends: Thing.schema.yaml
extends: Thing
role: secondary
status: experimental
properties:
Expand All @@ -11,7 +11,7 @@ properties:
description: The schema to use to validate data in the column.
type: object
allOf:
- $ref: DatatableColumnSchema.schema.yaml
- $ref: DatatableColumnSchema
values:
description: The values of the column.
type: array
Expand Down
2 changes: 1 addition & 1 deletion schema/DatatableColumnSchema.schema.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
title: DatatableColumnSchema
'@id': stencila:DatatableColumnSchema
extends: Thing.schema.yaml
extends: Thing
role: tertiary
status: experimental
properties:
Expand Down
2 changes: 1 addition & 1 deletion schema/Delete.schema.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
title: Delete
'@id': stencila:Delete
extends: Mark.schema.yaml
extends: Mark
role: secondary
status: stable
description: Content that is marked for deletion
Expand Down
2 changes: 1 addition & 1 deletion schema/Emphasis.schema.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
title: Emphasis
'@id': stencila:Emphasis
extends: Mark.schema.yaml
extends: Mark
role: secondary
status: stable
description: Emphasised content.
Expand Down
8 changes: 4 additions & 4 deletions schema/Environment.schema.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
title: Environment
'@id': stencila:Environment
extends: Thing.schema.yaml
extends: Thing
role: primary
status: experimental
description: A computational environment.
Expand All @@ -10,19 +10,19 @@ properties:
description: Other environments that this environment extends by adding or removing packages.,
type: array
items:
$ref: Environment.schema.yaml
$ref: Environment
adds:
'@id': stencila:adds
description: The packages that this environment adds to the base environments listed under `extends` (if any).,
type: array
items:
$ref: SoftwareSourceCode.schema.yaml
$ref: SoftwareSourceCode
removes:
'@id': stencila:removes
description: The packages that this environment removes from the base environments listed under `extends` (if any).,
type: array
items:
$ref: SoftwareSourceCode.schema.yaml
$ref: SoftwareSourceCode
environmentSource:
'@id': stencila:environmentSource
description: |
Expand Down
4 changes: 2 additions & 2 deletions schema/Heading.schema.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
title: Heading
'@id': stencila:Heading
extends: Thing.schema.yaml
extends: Thing
role: secondary
status: experimental
description: Heading
Expand All @@ -13,7 +13,7 @@ properties:
description: Content of the heading.
type: array
items:
$ref: InlineContent.schema.yaml
$ref: InlineContent
required:
- depth
- content
4 changes: 2 additions & 2 deletions schema/ImageObject.schema.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
title: ImageObject
'@id': schema:ImageObject
extends: MediaObject.schema.yaml
extends: MediaObject
role: secondary
status: stable
description: |
Expand All @@ -16,4 +16,4 @@ properties:
description: |
Thumbnail image of this image.
allOf:
- $ref: ImageObject.schema.yaml
- $ref: ImageObject
4 changes: 2 additions & 2 deletions schema/Include.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: |
A directive to include content from an external source (e.g. file, URL) or content.
role: secondary
status: experimental
extends: Thing.schema.yaml
extends: Thing
properties:
source:
description: The source of the content.
Expand All @@ -19,6 +19,6 @@ properties:
description: The content to be included.
type: array
items:
$ref: Node.schema.yaml
$ref: Node
required:
- source
20 changes: 10 additions & 10 deletions schema/InlineContent.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ anyOf:
- type: integer
- type: number
- type: string
- $ref: Emphasis.schema.yaml
- $ref: Strong.schema.yaml
- $ref: Delete.schema.yaml
- $ref: Subscript.schema.yaml
- $ref: Superscript.schema.yaml
- $ref: Quote.schema.yaml
- $ref: Code.schema.yaml
- $ref: CodeExpr.schema.yaml
- $ref: Link.schema.yaml
- $ref: ImageObject.schema.yaml
- $ref: Emphasis
- $ref: Strong
- $ref: Delete
- $ref: Subscript
- $ref: Superscript
- $ref: Quote
- $ref: Code
- $ref: CodeExpr
- $ref: Link
- $ref: ImageObject
4 changes: 2 additions & 2 deletions schema/Link.schema.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
title: Link
'@id': stencila:Link
extends: Thing.schema.yaml
extends: Thing
role: secondary
status: unstable
description: A link.
Expand All @@ -9,7 +9,7 @@ properties:
'@id': stencila:content
type: array
items:
$ref: InlineContent.schema.yaml
$ref: InlineContent
target:
'@id': stencila:target
type: string
Expand Down
Loading

0 comments on commit 0972799

Please sign in to comment.