Comments (2)
Let me see if I understand Mark's concern correctly. If I have a schema that implement's the typical LinkML container object pattern:
id: http://example.org/test
name: test
imports:
- linkml:types
prefixes:
linkml: https://w3id.org/linkml/
slots:
s1:
range: string
s2:
range: string
entries:
range: Entry
multivalued: true
classes:
Entry:
slots:
- s1
- s2
EntrySet:
tree_root: true
slots:
- entries
I could point DataHarmonizer to the Entry
class and it would show me an interface with two columns (for s1
and s2
). I could enter some data and then export that data to JSON through the interface. It would look something like:
[
{
"s1": "row 1 col 1",
"s2": "row 1 col 2",
},
{
"s1": "row 2 col 1",
"s2": "row 2 col 2",
}
]
The issue is that I can't validate that file as-is using linkml-validate
or using a generic JSON Schema validator and the JSON Schema derived from the LinkML schema. That's because LinkML doesn't really have a concept of an array at the root level -- hence the container object pattern.
So what Mark is saying is that if DataHarmonizer could somehow produce JSON that instead looks like:
{
"entries": [
{
"s1": "row 1 col 1",
"s2": "row 1 col 2",
},
{
"s1": "row 2 col 1",
"s2": "row 2 col 2",
}
]
}
Now we have an object at the root level. That object corresponds to the EntrySet
class in the schema and could be validated as such.
I don't have an exact proposal for how to resolve the situation, but it will probably involve a combination of logic to guess at the so-called container class and index slot (presumably via teaching DataHarmonizer to understand the tree_root
metaslot), as well as ways to specify them manually (see also: https://linkml.io/linkml/data/csvs.html).
from dataharmonizer.
Looking back on this, I think DH should input/output LinkML (JSON-LD) native JSON directly via browser, so need to understand the javascript required to do so. The existing "file -> Save as > .json" could be renamed to "file -> Save as > flat .json", and we could add a "file -> Save as > LinkML .json" option for the pure version. This avoids us having to use command line python tools as intermediary step.
@pkalita-lbl for comment.
(The LinkML data inlining options will come into play here later when we add 1-many data relations.)
from dataharmonizer.
Related Issues (20)
- Add column help sidebar to core library HOT 2
- Can't install HOT 5
- `linkml.py` does not generate a `schema.js` as expected but a `schema.json` HOT 2
- Schema not loading in DataHarmonizer (only Chrome and Edge; Firefox working) HOT 3
- Adding term normalization / ontology lookup feature to DataHarmonizer HOT 1
- parse() function appears to have repeated regular expression compilation?
- Validation(), specifically setDataAtCell(), can be made much more efficient by eliminating re-render on each column. HOT 2
- Handsontable 13.0.1 and Flatpickreditor.js date column cut/paste challenge HOT 2
- Compress image assets HOT 6
- Customizable Help Menu with Linkage to LinkML generated data model schema documentation HOT 1
- Dropdown picklists including print tags in latest release HOT 3
- Proposal: UI for working with non-enum multivalued slots HOT 2
- Changing the language should depend on the available user interface locales, not schema locales
- JSON Export HOT 3
- Tables should be exportable to a supported template language
- Rework "menu.json", "manifest.json" and "tabular_schema.py" script towards an integrated template publishing workflow
- Multi-sheet Excel export HOT 2
- Importing data and schema configuration from standard JSON file HOT 1
- LinkML scheme should have min/max values as integers rather than string representation of integers HOT 1
- DataHarmonizer has integer and decimal datatypes, but current code is saving these values as strings.
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 dataharmonizer.