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

Provide regular expression values for slots' patterns #9

Closed
wdduncan opened this issue Apr 7, 2021 · 5 comments
Closed

Provide regular expression values for slots' patterns #9

wdduncan opened this issue Apr 7, 2021 · 5 comments
Assignees
Labels

Comments

@wdduncan
Copy link
Contributor

wdduncan commented Apr 7, 2021

Need a list of regexs to check data.

@jbeezley
Copy link

jbeezley commented Apr 8, 2021

We could bikeshed about regexes all day. I think these are generally good compromises in terms of complexity and restrictiveness. There are other sorts of strings we could pattern match as well, such as dates, attributes with units, etc. but I think these things are better left to the parsers doing the normalization.

DOI:

^10.\d{4,9}/[-._;()/:A-Za-z0-9]+$

URL:

^https?://(-\.)?([^\s/?\.#-]+\.?)+(/[^\s]*)?$

The following come from https://microbiomedata.github.io/nmdc-metadata/identifiers/:

KO term:

(?i)^KEGG.ORTHOLOGY:D\d{5}$

@jeffbaumes You had noted the desire to make this just KO:, but it is actually defined by an official CURIE prefix at https://registry.identifiers.org/registry/kegg.orthology.

ENVO term (all the terms I have in my database contain at least 7 digits):

(?i)^ENVO:\d{7,}$

ID's in general

^\w+:\S+$

One thing about the (?i) inline modifier used above... I'm not sure if the namespace is intended to be case insensitive or not. If not, it should be removed. If so, I will need to normalize the namespace during ingestion.

@jeffbaumes
Copy link

Thanks @jbeezley. Happy for it to be KEGG.ORTHOLOGY, as long as it's consistent.

@dehays
Copy link
Contributor

dehays commented Apr 8, 2021

wrt dates - JSON Schema has a date-time which validates to RFC 3339 - so I don't believe we need to apply our own regex to dates. https://json-schema.org/draft/2020-12/json-schema-validation.html#rfc.section.7.3.1 (date-time has been in JSON Schema longer than this draft, I think the date and time are added in JSON Schema 7)

@wdduncan
Copy link
Contributor Author

@turbomam turbomam added the envo label Feb 16, 2023
@turbomam turbomam changed the title do regex - on raw values Provide regular expression values for slots' patterns Aug 28, 2023
@turbomam
Copy link
Collaborator

This issue is closed by the presence of https://linkml.io/linkml-model/docs/pattern/ in the LinkML metamodel, although I do recommend more pattern bikeshedding!

@turbomam turbomam changed the title Provide regular expression values for slots' patterns Provide regular expression values for slots' patterns Aug 28, 2023
turbomam added a commit that referenced this issue Feb 21, 2024
Add WorkflowChain class and valid data example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants