Comments (5)
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.
Thanks @jbeezley. Happy for it to be KEGG.ORTHOLOGY
, as long as it's consistent.
from nmdc-schema.
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.
Update:
We are working on to implement this in LinkML. See tickets:
from nmdc-schema.
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)
- `berkeley-schema-fy24`: Implement migrator that removes slots from `nmdc:MassSpectrometry` documents
- review id_locus pattern HOT 6
- Migrations: Restore adapter method that was discarded during merge HOT 2
- define "soft schema freeze" along with exceptions framework HOT 3
- restore schema module independence tests HOT 1
- establish technical and social barriers to clever schema workarounds HOT 1
- nmdc-schema needs a more global mechanism for capturing ownership-like credit HOT 5
- remove unused Python code HOT 2
- `berkeley-schema-fy24`: Update migrators to use optimized adapter methods
- Make `ExtractionTarget` mutlivalued to accommodate MPLEX extractions HOT 1
- `berkeley-schema-fy24`: Implement migrator that merges some collections HOT 5
- Map 1:1 Database slots to PlannedProcess subclasses with depth of 1 HOT 1
- generate reports of all observed MIxS environmental triad slot values, within a given context HOT 1
- `Extraction` class lacks a constraint that indicates its expected usage
- reassess temporal modeling esp. for WorkflowChain HOT 1
- standardize quotation marks in schema and example data files HOT 2
- `berkeley-schema-fy24`: Make migrator that removes `MetagenomeAnnotation.gold_analysis_project_identifiers` field HOT 2
- backmerge issue with ID mention pattern constraints on WorkflowExecution HOT 3
- `berkeley-schema-fy24`: Implement migrator that adds `replaces` field to `WorkflowChain` documents HOT 1
- `berkeley-schema-fy24`: Delete obsolete code, including code obsoleted by Berkeley schema changes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nmdc-schema.