Skip to content

Support for ArrayNodes in Entity Properties #215

@AndreasMeier12

Description

@AndreasMeier12

I am using version 2.0.1.

Context

I am working on interoperability between systems (mostly repositories and electronic lab notebooks). To this end, we want to include a schema describing the metadata in our RO-Crates.
Certain properties can have arrays as values, e.g. https://schema.org/domainIncludes. I would like to use them in my schema.

The problem

There is a way to pass ArrayNode as an argument to build an entity: edu.kit.datamanager.ro_crate.entities.AbstractEntity.AbstractEntityBuilder#addProperty(java.lang.String, com.fasterxml.jackson.databind.JsonNode)
Internally, this does not pass validation and the values are not written in the ro-crate-metadata.json.

In the documentation, I only see arrays for specific entities, e.g. edu.kit.datamanager.ro_crate.entities.data.WorkflowEntity.AbstractWorkflowEntityBuilder#addOutput.

Is there a way to add these values to my property for DataEntity in the form of an array?

Edit:
After trying some more things, I received the following output:

The property: 
[ {
  "@id" : "xsd:string"
} ]
does not comply with the flattened structure of the RO-Crate json document.

I see arrays inside data entities in RO-Crate's examples, e.g. encodingFormat taken from https://www.researchobject.org/ro-crate/specification/1.1/data-entities.html

{
    "@id": "1st-tool.cwl",
    "@type": "File",
    "name": "First executable tool",
    "description": "An example Common Workflow Language File",
    "contentSize": "120",
    "encodingFormat": ["text/plain", {"@id": "https://www.commonwl.org/v1.0/Workflow.html"}]
  }

Did I interpret the example correctly?

Suggestion

If this is not yet supported, would it be possible to add arrays as values?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions