Comments (2)
Sorry for the somewhat outdated docs, I'll update that shortly. The DataHarmonizer build cycle has changed. Indeed when run in a /web/templates/[schema name]/ folder, linkml.py just produces a schema.json file from an existing schema.yaml file. (This pattern exists in all the template folders.)
This is from a recent correspondence (we have a separate approach with a tabular_to_data.py script but since you already have schema.yaml do this route:
Basic steps:
With a [schema name] of your choice:
Work in /web/templates/[schema name]/
- Add one almost empty file “export.js” to the same folder. It contains:
// A dictionary of possible export formats
export default {};
- Assemble 1 schema.yaml file by hand. It should be a merger of what you have for [your schema].yaml and some stuff below.
- Add one extra little bit specific to DataHarmonizer , namely the “dh_interface” stuff below that signals to DH to show the given class. Below we are using an AMBR class as an example:
classes:
dh_interface:
name: dh_interface
description: A DataHarmonizer interface
from_schema: https://example.com/AMBR
AMBR:
name: AMBR
description: The AMBR Project, led by the Harrison Lab at the University of Calgary,
is an interdisciplinary study aimed at using 16S sequencing as part of a culturomics
platform to identify antibiotic potentiators from the natural products of microbiota.
The AMBR DataHarmonizer template was designed to standardize contextual data
associated with the isolate repository from this work.
is_a: dh_interface
- You might want to add all the “types: {}” from one of the other specification schema.core.yaml file examples existing in /web/templates, since this allows DH things like the "provenance" slot, but this is not essential.
types:
WhitespaceMinimizedString:
name: 'WhitespaceMinimizedString'
typeof: string
description: 'A string that has all whitespace trimmed off of beginning and end, and all internal whitespace segments reduced to single spaces. Whitespace includes #x9 (tab), #xA (linefeed), and #xD (carriage return).'
base: str
uri: xsd:token
Provenance:
name: 'Provenance'
typeof: string
description: 'A field containing a DataHarmonizer versioning marker. It is issued by DataHarmonizer when validation is applied to a given row of data.'
base: str
uri: xsd:token
then with command prompt in that file’s template folder, run
python3 ../../../script/linkml.py -i schema.yaml
This will generate the schema.json file, it also adds a menu item for your specification by adjusting /web/templates/menu.js.
To test and run go to DH root folder and type (as documented on github main code page):
yarn dev
To build a stand alone set of JS files in /web/dist/
yarn build:web
These can then be zipped or copied separately to wherever you want to make them available.
Let me know if this works or if more info needs to be added to it! Then I'll revise docs.
Thanks!
from dataharmonizer.
Thank you @ddooley for the fast and detailed answer!
It did the trick though maybe a few clarifications could be added:
- the name of the folder in web/templates is the lower case version of the schema name. E..g for ambrfoo/FoO
- update the menu.json by changing display: false to display true.
- (in my case, I had to curate the different classes that were exported and select the one I wanted)
- go to localhost:8080 after
yarn dev
(do not try to open the index.html)
I can add them to PR and you can edit from there.
Thank very much!
from dataharmonizer.
Related Issues (20)
- Loading a template modifies root slot definitions HOT 1
- Enumerations with a large number of elements are cut off when displaying the entire list HOT 3
- DH should materialize LinkML dynamic enumerations and display the permissible values with hierarchy preserved HOT 1
- When DH creates menus from LinkML enums, it requires the presence of the optional `text` property HOT 3
- Transform URLs in help popup into clickable links HOT 5
- "Dates" collected by DataHarmonizer are datetime objects HOT 7
- Document the fact that DH JSON is a bare list and not compatible with LinkML tools as is HOT 2
- Implement time and datetime datatypes HOT 2
- Add column help sidebar to core library HOT 2
- Can't install HOT 5
- 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
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.