Skip to main content

Hi,

I would like to read a json file from an url. Read only the schema and translate the schema to be the main attributes in my workspace. So I'm able to map another dataset onto the main attributes from the read json file. 

 

Example json dataset:

{
"json_featuretype" : "ExampleDataset1",
"Attribute1" : 100,
"Attribute2" : 5,
"Attribute3" : 0.7,
"json_geometry" : {
"type" : "LineString",
"coordinates" : <
y x,y ],
n x,y ]
]
}
},

After reading the schema I would like to see something like this in my attribute manager. FMEquestionI would like to automate this proces and not manually enter the attributes in a attributecreator/attributemanager. Since attributes can be added to the read json file from the url in the future. 

 

I tried reading the json url with the schema reader or the <schema> output port from the FeatureReader but so far I've been unable to translate the attribute{}.name values to be the main attributes. 

 

I'm curious if the FME community has a solution! Thanks!

@markvv​ I'm not quite sure what you're trying to accomplish. Do you need to rename the attributes? If you don't, then you should be able to use a Dynamic workflow. Otherwise the SchemaMapper might be a good choice, then you can rename your attributes in an external spreadsheet.


@markvv​ I'm not quite sure what you're trying to accomplish. Do you need to rename the attributes? If you don't, then you should be able to use a Dynamic workflow. Otherwise the SchemaMapper might be a good choice, then you can rename your attributes in an external spreadsheet.

Hi @Mark Stoakes​, yes the workflow is quite odd.. I'm working with 3 schema's. Source data is schema A. Then I want to map schema A on schema B. Schema B is a schema I'd like to extract from a json file from an url (only keeping the attribute names, no values). After that I want to map schema B on schema C. Schema C is final and will be my output. Basically my source data keeps the same data along the way, but changes it's schema/attribute names three times.

 

Using a dynamic workflow, as far as I know can only handle two schema's. And I would like to avoid writing to a temporarily dataset and use that to do B --> C.

The SchemaMapper could be an option, but then I have to keep track of the mapping outside of my workspace and I won't be able to use the json file from the url as input.

 

Mapping straight from schema A to schema C would be the most logical and efficiënt progress, but defeats the purpose why I'm making this workflow. You can see Schema B as my universal language. Schema A and schema C are different languages/systems who would like to communicate with each other, but need the universal language to make that connection.

 

I hope it's clear! Thanks!


@markvv​ You're effectively trying to create an ESB in a single workflow, using the JSON schema (B) as the 'common' schema. But, the mapping has to be done somewhere. If you want to map Name to FirstName, that has to be defined in AttributeManager or a SchemaMapper table or something.

My guess is you're looking at two mapping tables for SchemaMapper. A-B and then a second one B-C. If you don't want to do that outside FME then you're probably stuck with AttributeManager's


Reply