Comments (1)
Hi,
I would suggest the following strategy to start with media type validation:
- Users should be allowed to use string as media type value like:
"mediaType":"application/json"
This corresponds to a widely adopted way of using media types.
-
The first step for validation would be to check that the providing string match IANA media type structure. The media type pattern can be seen in nexus/core/distribution and in nexus/core/mediatype schemas.
-
The second step would be to check that a provided media type is in a given list. Any schema can define a list of accepted values for a property. You can extends the distribution schema in you custom entity schema like this:
{
"shapes": [
{
"@id": "this:DistributionShape",
"@type": "sh:NodeShape",
"and": [
{
"node":"{{base}}/schemas/nexus/core/distribution/v0.1.0/shapes/DistributionShape"
},
{
"property": [
{
"path": "schema:mediaType",
"in": ["application/pdf","application/json"]
}
]
}
]
}
]
}
But this strategy comes with downsides:
- every time a new media type is added than a new schema version is needed.
- regex based validation is slow.
We can improve this strategy later by relying on types for media types.
from nexus-bbp-domains.
Related Issues (20)
- description of a media type. HOT 1
- register media-type HOT 1
- Use nxv:Schema as schema type
- Reused nexus/core and nexus/schemaorg schemas from nexus-kg
- Add e-feature extraction prov template HOT 1
- Unify context for nsg instances and schemas
- Rename bbp/core/entity schema to bbp/core/instance
- Provide test data for e-feature extraction activity
- Provide textual definition for the morphology domain classes
- How to attach "what is being modelled (ion channel, brain region,..." to a model (emodel, ...)" HOT 2
- Adapt TraceGeneration, StimulusExperiment and PatchedCell schemas for thalamus use case
- Add draft of prov template for morphology release
- Rename bbp/core/entity context
- Use BrainLocationShape in PatchedSlice schema HOT 1
- Define author property shape in Protocol schema
- Create a schema for imagestack description
- Create schemas linking reconstructed cell and morphology release
- Ability to update the entity in morphology integration script
- Ability to auto-complete the metadata in morphology integration script
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 nexus-bbp-domains.