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

add ABNF #23

Closed
jscancella opened this issue Dec 13, 2019 · 3 comments
Closed

add ABNF #23

jscancella opened this issue Dec 13, 2019 · 3 comments

Comments

@jscancella
Copy link
Contributor

@jscancella jscancella commented Dec 13, 2019

As a more formal way of specifying the bagit-profile specification I wrote it up in ABNF. Can we add it to the generated ReSpec?

The Augmented Backus-Naur Form (ABNF) rules provided below are non-normative. If there is a discrepancy between requirements in the normative sections and the ABNF, the requirements in the normative sections prevail. Some definiations use the core rules as defined in [RFC5234].

Bagit Profile Json file:

profile                     = "{" profile-info bag-info manifests-required fetch-allowed serialization serialization-types tag-manifests tags-allowed tags-required bagit-version "}"

profile-info                = DQUOTE "BagIt-Profile-Info" DQUOTE ":" "{" profile-identifier profile-version profile-organization-name profile-name profile-email profile-description profile-version "},"
profile-identifier          = DQUOTE "BagIt-Profile-Identifier" DQUOTE ":" DQUOTE <absolute-URI, see [RFC3986], Section 4.3> DQUOTE ","
profile-version             = DQUOTE "BagIt-Profile-Version" DQUOTE ":" version ","
profile-organization-name   = DQUOTE "Source-Organization" DQUOTE ":" value ","
profile-name                = DQUOTE "Contact-Name" DQUOTE ":" value ","
profile-email               = DQUOTE "Contact-Email" DQUOTE ":" email-address ","
email-address               = DQUOTE 1*( atext / "." ) "@" ldh-str 1*( "." ldh-str ) DQUOTE <see [RFC5322] and [RFC1034]>
profile-description         = DQUOTE "External-Description" DQUOTE ":" value ","
profile-version             = DQUOTE "Version" DQUOTE ":" version ","
version                     = DQUOTE 1*DIGIT "." 1*DIGIT DQUOTE

bag-info                    = DQUOTE "Bagit-Info" DQUOTE ":" "{" info-organization info-address info-name info-phone info-email info-description info-identifier info-size info-group-identifier info-count info-sender-identifier info-sender-description info-date info-payload-oxum "},"
info-organization           = DQUOTE "Source-Organization" DQUOTE ":" requirements ","
info-address                = DQUOTE "Organization-Address" DQUOTE ":" requirements ","
info-name                   = DQUOTE "Contact-Name" DQUOTE ":" requirements ","
info-phone                  = DQUOTE "Contact-Phone" DQUOTE ":" requirements ","
info-email                  = DQUOTE "Contact-Email" DQUOTE ":" requirements ","
info-description            = DQUOTE "External-Description" DQUOTE ":" requirements ","
info-identifier             = DQUOTE "External-Identifier" DQUOTE ":" requirements ","
info-size                   = DQUOTE "Bag-Size" DQUOTE ":" requirements ","
info-group-identifier       = DQUOTE "Bag-Group-Identifier" DQUOTE ":" requirements ","
info-count                  = DQUOTE "Bag-Count" DQUOTE ":" requirements ","
info-sender-identifier      = DQUOTE "Internal-Sender-Identifier" DQUOTE ":" requirements ","
info-sender-description     = DQUOTE "Internal-Sender-Description" DQUOTE ":" requirements ","
info-date                   = DQUOTE "Bagging-Date" DQUOTE ":" requirements ","
info-payload-oxum           = DQUOTE "Payload-Oxum" DQUOTE ":" requirements
requirements                = "{" required values "}"
required                    = DQUOTE "required" DQUOTE ":" DQUOTE boolean DQUOTE ","
boolean                     = DQUOTE ("true" / "false") DQUOTE
values                      = DQUOTE "values" DQUOTE ":" "[" values-list "]"
values-list                 = value *("," value )
value                       = DQUOTE 1*WSP DQUOTE

manifests-required          = DQUOTE "Manifests-Required" DQUOTE ":" "[" manifest-list "]" ","
manifest-list               = manifest *("," manifest)
manifest                    = DQUOTE 1*[a-z0-9] DQUOTE 

fetch-allowed               = DQUOTE "Allow-Fetch.txt" DQUOTE ":" boolean ","
serialization               = DQUOTE "Serialization"  ":" DQUOTE ( "forbidden" / "required" / "optional" ) DQUOTE ","
serialization-types         = DQUOTE "Accept-Serialization" DQUOTE ":" "[" serialization-type-list "]" ","
serialization-type-list     = serialization-type *("," serialization-type )
serialization-type          = value
tag-manifests               = DQUOTE "Tag-Manifests-Required" DQUOTE ":" "[" manifest-list "]" ","
manifest-list               = manifest *("," manifest)
tags-allowed                = DQUOTE "Tag-Files-Allowed" DQUOTE ":" "[" tag-file-list "]" ","
tag-list                    = tag-file *("," tag-file)
tag-file                    = value     
tags-required               = DQUOTE "Tag-Files-Required" DQUOTE ":" "[" tag-file-list "]" ","
bagit-version               = DQUOTE "Accept-BagIt-Version" DQUOTE ":" "[" version-list "]" ","
version-list                = version *("," version)
@tdilauro

This comment has been minimized.

Copy link
Member

@tdilauro tdilauro commented Dec 16, 2019

@jscancella It appears that the above ABNF does not capture the spec changes from #21 that were accepted and merged into master last week.

@jscancella

This comment has been minimized.

Copy link
Contributor Author

@jscancella jscancella commented Dec 17, 2019

@tdilauro you are right, sorry. I updated the ABNF rules, can you look them over again to see if I missed anything?

@tdilauro

This comment has been minimized.

Copy link
Member

@tdilauro tdilauro commented Dec 18, 2019

@jscancella It looks like the changes in #24 do indeed capture the new tokens. I'll make future comments on that PR.

@ruebot ruebot closed this in 15eb5ac Mar 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.