Skip to content

Playing around with possible output schema definitions #11

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all 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
8 changes: 8 additions & 0 deletions examples/Extractor-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,13 @@ supported_filetypes:
Example Extractor can parse example-filetype once in a blue moon.
template:
input_type: example
supported_output_schemas:
- schema:
description: >-
The fields in the output example extractor follows the JSONSchema linked
below.
href: >-
https://example.com/schema.json

license:
uri: https://example.com
31 changes: 30 additions & 1 deletion schemas/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ classes:
attributes:
id:
description: >-
A reference to the registered Datatractor `FileType->id` for this file
A reference to the registered Datatractor `FileType->id` for this
file
type.
description:
description: Free-text description of caveats or instructions specific
Expand Down Expand Up @@ -133,6 +134,34 @@ classes:
multiple output `FileTypes`. Defaults to the `FileType->id` for
each supported output file type.

SchemaDescription:
description: >-
A human-readable schema definition, with a reference to a machine-actionable
schema definition if available.
attributes:
description:
description: >-
A human-readable description of the schema and its usage.
href:
description: >-
A URL or URI for the schema definition.

OutputSchema:
description: >-
A human-readable specification of the schema that the output of an `Extractor`.
attributes:
supported_filetypes:
range: SupportedFileType
multivalued: true
required: false
description: >-
The file types that this schema can be used for; defaults to all
if not provided.
schema:
required: true
range: SchemaDescription


Usage:
description: >-
A machine-actionable specification of a set of usage instructions of the
Expand Down
11 changes: 11 additions & 0 deletions schemas/extractor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,17 @@ classes:
These should match `FileTypes` present in the registry. They can
be specified on extractor execution using the templates described
in the `Extractor->Usage->command` slot, [see the `Usage` class](Usage.md).
supported_output_schemas:
multivalued: true
required: false
range: OutputSchema
description: >-
A description of the schema that a extractor output can follow;
this may be scoped per file type, or a global schema that works
for all file types.
This should refer to any machine-actionable schema definition,
for example, JSONSchema, XMLSchema, or it may refer to a
self-describing format such as JSON-LD or RDF.
source_repository:
description: >-
A URL or URI for a source code repository associated with this
Expand Down
Loading