GithubHelp home page GithubHelp logo

cedar-artifact-library's People

Contributors

egyedia avatar jkyu avatar martinjoconnor avatar yancao77 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

cedar-artifact-library's Issues

Provide abstraction for different UI objects

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.

Provide a common method for getting child artifacts

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;
}

No way to get property associations for enclosed fields or elements

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
    },

CamelCase Acronyms/Abbreviations (Minor Style Issue)

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.

Parsing of value constraints fails due to `numTerms` attribute being required

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": []
  }
}

Support YAML artifact import

This library currently supports YAML as an export format for artifacts.

Add support for YAML import of artifacts.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.