Skip to content

Nested JSON parsing using two data source iterators #210

@sRam1404

Description

@sRam1404

Issue type: ❓ Question

This is a continuation of the issue #67 in my opinion.

I tried out the solution provided by @pheyvaer along with the sample data on that issue using Matey and the output linked data seems off and might not have been what the original poster was probably looking for. I was expecting ex:Smith_Bland to only be associated with ex:John, but the solution with the equal function does not seem the right match.

I would like to know if there are more examples and documentation for parsing nested JSON structures, because I clicked through a few of the examples inside /yarrrml-parser/test, but I don't know which might be the correct one to follow.

Also, I have seen the list of RMLMapper functions. Where can I look for examples of how these are used inside YARRRML?

Coming to the problem at hand, I have a nested JSON object that has the following structure and I would like to:

  • Get the following data under report-content and assign it to the data property of an instance of class Requirement.
    • id
    • requirement_text
    • priority
  • Get the data in the JSON path $.report_content[*].additional_identifiers[1] and continue to assign this information to the appropriate data property in the corresponding instance of class Requirement.
    • name
    • type
    • url

I would be grateful for your help and suggestions. Thanks in advance! :-)

{
    "report-content": [
        {
            "category": "requirement",
            "id": "REQ-001",
            "additional_identifiers": [
                {
                    "name": "PersonXYZ",
                    "type": "Customer Representative",
					"stakeholders": "EntityA"

                },
                {
                    "name": "Label for REQ-001",
                    "type": "Customer Requirement",
                    "url": "https://somelinkToRequirementsManagementTool.com"
                }
            ],
            "requirement_text": "This is a dummy requirement that is needed for some reason.",
            "priority": "High"
        },
        {
            "category": "requirement",
            "id": "REQ-002",
            "additional_identifiers": [
                {
                    "name": "PersonABC",
                    "type": "Customer Representative",
					"stakeholders": "EntityA, EntityB"
                },
                {
                    "name": "Label for REQ-002",
                    "type": "Customer Requirement",
                    "url": "https://somelinkToRequirementsManagementTool.com"
                }
            ],
            "requirement_text": "This is a dummy requirement that is needed for some reason.",
            "priority": "Medium"
        }
    ]
}

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