GithubHelp home page GithubHelp logo

Comments (5)

jbeezley avatar jbeezley commented on June 19, 2024

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.

from nmdc-schema.

jeffbaumes avatar jeffbaumes commented on June 19, 2024

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

from nmdc-schema.

dehays avatar dehays commented on June 19, 2024

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)

from nmdc-schema.

wdduncan avatar wdduncan commented on June 19, 2024

Update:
We are working on to implement this in LinkML. See tickets:

from nmdc-schema.

turbomam avatar turbomam commented on June 19, 2024

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!

from nmdc-schema.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.