Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9057277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T14:24:50+00:00 2026-06-16T14:24:50+00:00

The output for the JSON data structure with 100 objects should look like this:

  • 0

The output for the JSON data structure with 100 objects should look like this:

[{
    "Value": "Sens1_001",
    "Parent": Null,
    "Child": {
        "Value": "Sens2_068",
        "Parent":"Sens1_001",
        "Child" : {
            "Value": "Sens3_034",
            "Parent": "Sen2_068",
            "Child": null,
            "z_cordinate": 5
                  },
        "z_cordinate": 0
            },
        "z_cordonate": -5
    },
{
    "Value": "Sens1_002",
    "Parent": Null,
    "Child": {
        "Value": "Sens2_037",
        "Parent":"Sens1_002",
        "Child" : {
            "Value": "Sens3_099",
                              "Parent": "Sen2_037",
                              "Child": null,
                              "z_cordinate": 5
                   },
             "z_cordinate": 0
             },
  "z_cordonate": -5
},
{
   "Value": "Sens1_003",
    "Parent": Null,
    "Child": {
        "Value": "Sens2_012",
        "Parent":"Sens1_003",
        "Child" : {
            "Value": "Sens3_054",
            "Parent": "Sen2_012",
            "Child": null,
            "z_cordinate": 5
                  },
        "z_cordinate": 0
             },   
        "z_cordonate": -5
},
.
.
. // till 100th object
{
    "Value": "Sens1_100",
    "Parent": Null,
    "Child": {
        "Value": "Sens2_001",
        "Parent":"Sens1_100",
        "Child" : {
            "Value": "Sens3_021",
            "Parent": "Sen2_001",
            "Child": null,
            "z_cordinate": 5
                  },
    "z_cordinate": 0
             },
    "z_cordonate": -5
}]  

NOTE: I Edited the sample looking object, please review one more time, I changed end braces to look like more an array rather normal object. JSON is secondary, my array should serve my purpose.

Purpose:

How Could I access the objects X.parent.child fashion. I’ve some knowledge but not enough to structure this object. I’m also planning to access the objects either ways, Grapndparent – Parent – Child and Me – Parent – Grandparent. How could I do that? The objects parent – child relationship should be meaningful rather random and moreover a parent can have more than one child.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T14:24:52+00:00Added an answer on June 16, 2026 at 2:24 pm

    Since all the ‘value’ key are unique, you can have it as the dictionary key.
    So design it like:

    {
     "Sens1_001": {
                   "value": "Sens1_001",
                   "parent": null,
                   "child": "Sen2_068",
                   "z_coordinate": 5
                  },
     "Sens2_068": {
                   "value": "Sens2_068",
                   "parent": "Sens1_001",
                   "child": "Sen3_098",
                   "z_coordinate": -5
                  }
     .
     .
     .
    }
    

    Once this dictionary ‘dict’ is ready, if you know the value of the grandparent, then:

    grandparent = dict[value];
    parent = dict[grandparent[child]];
    child = dict[parent[child]];
    

    Similarly if you know the child’s value,

    child = dict[value];
    parent = dict[child[parent]];
    grandparent = dict[parent[parent]];
    

    Tell me if you dont get it still.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have something like a json array output, it comes like : { data:
I'm trying to parse a JSON data structure but what I think should be
I have some json in this structure: {data:{1:file1.gif,2:file2.jpg}} // ... etc I am trying
Is it possible to output specific JSON data (exported from Firefox bookmarks) using PHP.
i am outputting json data from a php file (example of my output) {news:[{title:title
I have queried yahoo finance for historic data and have got JSon output. What
If i have a php file that outputs json data with numerical keys, like
I have a YQL output JSON string at this URL: YQL JSON I found
i have been having this trouble when trying to obtain json data. lets say
I want to create a data structure that will be parse as a JSON

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.