Javascript, Convert data to correct JSON/CSV format required by app
New here? Learn about Bountify and follow @bountify to get notified of new bounties! x

Using this app:

You need to create a json/csv file that is compatible with the app, using the data below. In other words, you need to modify the data below so that is in a format that the js app can read it.

The idea is to visualize how node sequences connect with each other.
The value "connect_to_sequence" defines how sequence nodes should connect with each other node.

So for example, from node "Sequence 25", four arrows should go out into nodes with id 1,2,5,10.
From node "Sequence 1" an arrow should go into node with id 25 ("Sequence 25").

The data1, data2, data3, data4 should be show on the right sidebar when selected on "Selection Details":

"id": 25,
"name": "Sequence 25",
"connects_to_sequences": [1,2,5,10],
"data1": "Some data to show when selected 1",
"data2": "Some data to show when selected 2",
"data3": "Some data to show when selected 3",
"data4": "Some data to show when selected 4"
"id": 1,
"name": "Sequence 1",
"connects_to_sequences": [25],
"data1": "Some data to show when selected 5",
"data2": "Some data to show when selected 6",
"data3": "Some data to show when selected 7",
"data4": "Some data to show when selected 8"
"id": 2,
"name": "Sequence 2",
"connects_to_sequences": [1,10, 5],
"data1": "Some data to show when selected A",
"data2": "Some data to show when selected B",
"data3": "Some data to show when selected C",
"data4": "Some data to show when selected D"
"id": 10,
"name": "Sequence 10",
"connects_to_sequences": [25, 2],
"data1": "Some data to show when selected E",
"data2": "Some data to show when selected F",
"data3": "Some data to show when selected G",
"data4": "Some data to show when selected A"

Modify the above data in the format required by the app to display what is described above.

Do you want this json to be modified? So in short you want a JS function that has one parameter(bad json) then output (proper json)? If thats the case let me know
mashtullah 1 year ago
@mashtullah , Yes, that would be ok. There is an import feature on the app. The idea is that your output works on the app so I can display a graph
Chlegou 1 year ago
One last question, please give me the two samples, the bad json string and the expected output which is the good json string then i will make the function, pure JS or i can use JQuery?
mashtullah 1 year ago
the bad json is already in the bounty, and for good json you can export an example from the website app . and you can use whatever you want.
Chlegou 1 year ago
to export a sample good json format, there is a link in the bottom of the webapp to export the selected node. you only have to select a node and export it as a json format. then you have it.
Chlegou 1 year ago
awarded to georgefountain

Crowdsource coding tasks.

1 Solution

Winning solution

I guess your bounty is not as clear.

Maybe if you post it again someone else will solve it.

I can provide a partial answer showing a sample of "good" JSON,.
Although it doesn't solve the problem, I believe it is a good start. I found it outside the page by looking at a short sample of JSON data for ontology graph which is the graph you provided.

{ "@context": {
"rdf": "",
"rdfs": "",
"owl": "",
"express": "",
"defines": {
"@reverse": "rdfs:isDefinedBy"
"propertyOf": {
"@id": "rdfs:domain",
"@type": "@id"
"propertyOn": {
"@id": "rdfs:range",
"@type": "@id"
"@id": "express:",
"@type": "owl:Ontology",
"defines": [
{ "@id": "express:send",
"@type": "owl:ObjectProperty",
"rdfs:label": "Send to",
"rdfs:comment": "Send very very fast to the specified company",
"propertyOf": "express:Product",
"propertyOn": "express:Company"
{ "@id": "express:receive",
"@type": "owl:ObjectProperty",
"rdfs:label": "Receive product",
"rdfs:comment": "Receive the specified product very very fast",
"propertyOf": "express:Company",
"propertyOn": "express:Product"
{ "@id": "express:Company",
"@type": "owl:Class",
"rdfs:label": "Company",
"rdfs:comment": "A company or organization that might order products"
{ "@id": "express:Product",
"@type": "owl:Class",
"rdfs:label": "Product",
"rdfs:comment": "A product that may be sent to a company"

yes that what i'm looking for
Chlegou 1 year ago
this could help. thank you for that. if you get the perfect one please post it .
Chlegou 1 year ago