metadatacenter / cedar-artifact-library Goto Github PK
View Code? Open in Web Editor NEWTools for working with CEDAR model artifacts
License: Other
Tools for working with CEDAR model artifacts
License: Other
Based on additions to model described in metadatacenter/cedar-model-validation-library#140, add support for representing @language in the library.
Library is not correctly recording that a field or element is multi-instance
Generate REDCap-compliant Excel spreadsheets from CEDAR templates
Some very tentative code here org.metadatacenter.artifacts.redcap.TemplateSchemaArtifact2REDCapConvertor
but a lot of detail work remains.
Default values can be terms as well as strings (as far as I know). However, the parser only accepts default values that are strings.
Write a wiki entry detailing use of library for translating JSON Schema templates, elements and fields in to Java POJOs, for translating instances into POJOs, and (when ready) generating JSON Schema and JSON-LD from schema and instance POJOs, respectively.
Link to this wiki from CEDAR Developer Documentation page: https://github.com/metadatacenter/cedar-docs/wiki/CEDAR-technical-documentation
This is related to #6 but I would like the children to be ordered consistently, as defined in the UI element.
Based on additions to model described in metadatacenter/cedar-model-validation-library#138, metadatacenter/cedar-model-validation-library#139 add continuePreviousLine and recommendedValue in the library.
If fields or elements inside templates or elements have property associations, there is no way to retrieve the property IRIs.
The IRIs are enclosed inside the JSON Schema specification for the instance @context.
e.g., if a Study
template has a Study ID
field with a property association http://semantic-dicom.org/dcm#StudyID
the JSON Schema for the template will look as follows:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"title": "Study template schema",
"description": "Study template schema generated by the CEDAR Template Editor 2.6.19",
"properties": {
"@context": {
"type": "object",
....
"Study ID": {
"enum": [
"http://semantic-dicom.org/dcm#StudyID"
]
}
},
"required": [... ],
"additionalProperties": false
},
This library currently supports YAML as an export format for artifacts.
Add support for YAML import of artifacts.
Consider this before the library gets wider use. Obviously there's some element of personal taste here,
Some of the method names contain acronyms or abbreviations, for example, getJsonLDID
, that are akward to read but moreover, modern style guides (e.g. the Google one) in essence say acronyms should be CamelCased. So, consider CamelCasing these, for example, getJsonLdId
.
FWIW, a few years ago I would name things OWLClass
or IRI
but now I'd use OwlClass
and Iri
after falling into line with wider community guidelines.
There are a few cases where strings are escaped differently by the current Java and TypeScript libraries.
template-008
DIFF: regex escaping
template-023
DIFF: Java escapes >2,3,6-trichlorotoluene< as "2,3,6-trichlorotoluene"
template-029
DIFF: multiline content in several places
DIFF: Java escapes >no< as "no"
Carried over from cedar-artifact-library#21
The JSON below fails to parse because the parse is looking for an attribute called numTerms
. Not sure what this is.
{
"_valueConstraints": {
"requiredValue": false,
"multipleChoice": false,
"classes": [],
"branches": [],
"ontologies": [
{
"uri": "https://bioportal.bioontology.org/ontologies/MESH",
"acronym": "MESH",
"name": "MESH"
}
],
"literals": []
}
}
I need to convert RADx metadata in spreadsheets into CEDAR metadata instances. It would be helpful if the cedar-artifact-library could serialize spreadsheets into JSON-LD.
RuntimeException is used at the moment, which is too general for callers to catch and do anything with. I suggest ParseException or ProcessingException with fields for message, location etc.
Add support for setting and retrieving artifact annotatations
The following list from Atti details the outstanding renderings to be implemented to complete the YAML serialization of schema artifacts:
Template header and footer are missing . See template-007. I am using:
modelVersion: 1.6.0
header: Template header
footer: Template footer
createdOn: 2024-02-29T14:25:48-08:00
Static fields are not serialized properly, or at all. See template-004, template-009
Regex not serialized for text fields. See template-008
Provenance not serialized. Any template. I am using:
createdOn: 2024-03-11T15:26:26-07:00
createdBy: https://metadatacenter.org/users/c7dcc3ca-55fe-4ca8-b448-ab110bfe4c95
lastUpdatedOn: 2024-03-11T15:26:26-07:00
modifiedBy: https://metadatacenter.org/users/c7dcc3ca-55fe-4ca8-b448-ab110bfe4c95
Annotations not serialized. see template-027
annotations:
- name: https://datacite.com/doi
type: id
value: https://doi.org/10.82658/8vc1-qf27
or see field-001
annotations:
- name: https://datacite.com/doi
type: id
value: https://doi.org/10.82658/8vc1-abcd
- name: foo
type: value
value: bar
If the child name in properties is different than the schema:name, only the child name is used in yaml.
See template-26.
I added "key" as the first attribute. Then we have name. And altLabel
Name and key should be equal.
But they are not always
children:
- key: _text_field_
type: templateField
id: https://repo.metadatacenter.org/template-fields/9efde92f-63b9-427f-b071-36ea57de1b7e
name: Textfield
description: Help Text
modelVersion: 1.6.0
inputType: textfield
datatype: xsd:string
timeFormat: 12h is serialized, even if it is not in the JSON. See template-010
the field "Simple date" does not have inputTimeFormat in the source json (only 2 occurrences) but the resulting YAML has 3
checkbox currently has these. Do we need them? see template-018
multiple: true
minItems: 1
multipleChoice: true
for checkbox, these values are always like this.
list: if it is not multiple choice, it does not say it in the YAML. The json says that template-019
maybe, just for clarity, it should say
multipleChoice: true
list: if it is multiple, it says so in the JSON and the YAML, this is ok. See template-020
plus also specifies
multiple: true
minItems: 1
are these needed?
attribute-value See template-022. Do we need to say these?
multiple: true
minItems: 0
The different UI objects, ElementUI, TemplateUI, FieldUI have similar methods, but no common abstraction so I have to do instance checks and then casts to call methods. For example, when getting property order (TemplateUI and ElementUI) I cannot just call a getOrder method on the UI object.
Often I just want to get all chid artifacts of any given artifact. I typically do this for building a tree of a template. It would be convenient if there was a method (on Artifact) call getChildArtifacts
(or something similar) that returns a List<Artifact>
.
At the moment, I do something like this:
private List<SchemaArtifact> getChildren(SchemaArtifact schemaArtifact) {
var result = new ArrayList<SchemaArtifact>();
if(schemaArtifact instanceof TemplateSchemaArtifact tsa) {
result.addAll(tsa.getElementSchemas().values());
result.addAll(tsa.getFieldSchemas().values());
}
else if(schemaArtifact instanceof ElementSchemaArtifact esa) {
result.addAll(esa.getElementSchemas().values());
result.addAll(esa.getFieldSchemas().values());
}
return result;
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.