Skip to main content

Good morning!

I need to export data from a WFS to a GML. The data is INSPIRE compliant, so I'm using the INSPIRE GML Writer.

This is what I'm getting for the "nationalLevel" attribute:

<au:nationalLevel xlink:href="http://inspire.ec.europa.eu/codelist/AdministrativeHierarchyLevel/6thOrder"/>

And this is what the person using the GML wants:

<au:nationalLevel xlink:href="http://inspire.ec.europa.eu/codelist/AdministrativeHierarchyLevel/6thOrder">6thOrder</au:nationalLevel>

I thought that wasn't a big deal. I just added the following attribute to the writer:

0684Q00000ArBPrQAN.png

I use an AttributeManager transformer to set the "nationalLevel" value.

But the GML hasn't changed at all.

Does anyone know how I could achieve what the user wants? I don't know if I'm doing something wrong in my workspace or I'm missing some concept about the INSPIRE GML, but I'm stuck.

The workspace I'm using is also attached.

FME 2017.1 (32 bits)

Thanks for any help provided!!

Welcome to the wonderful world of EU INSPIRE namespace versions. For some reason, INSPIRE namespace versions were changed from v3.0 to v4.0 in 2015 in a way that was not backwards compatible. This makes it a challenge if you want to work with both versions - so it's not surprising you ran into some trouble here.

To keep things more concise, I'll limit my response here to the nationalLevel issue raised here. There are 2 valid formats for this. The v3.0 form is:

<au:nationalLevel>6thOrder</au:nationalLevel>

the v4.0 form is: 

<au:nationalLevel xlink:href="http://inspire.ec.europa.eu/codelist/AdministrativeHierarchyLevel/6thOrder"/>

The form you are attempting to write is not valid according to either schema, since it combines both forms. Notice that if you turn on Validate = Yes on the writer you will get a number of errors.

0684Q00000ArKBYQA3.png

INSPIRE Theme and Namespace selection

Above is a screen shot of INSPIRE theme selection that shows these 2 namespaces for AdministrativeUnits. Interestingly, if you just set the writer namespace to "Administrative Units (v3.0)" on your workspace, you will get the v3.0 form (value="6thOrder") above you are looking for. If you change it back to  "Administrative Units (v4.0)", you will get the v4.0 xlink:href form, which is what we would expect.

However, it is important to note that the schema shown in the 'Feature Type - User Attributes' screen shot above is not valid according to any INSPIRE schema. I'm not sure how it was obtained - perhaps manually modified. For GML application schema based writing, we do not recommend editing the destination schema. Rather, you should import the schema from the selected theme and namespace which causes FME to read the schema definition directly from the appropriate XSD. 

If you import the destination feature type schema from "Administrative Units (v3.0)", you will get the fields: 

nationalLevel

nationalLevel.codeSpace

If you import the destination feature type schema from "Administrative Units (v4.0)", you will get the fields: 

nationalLevel.owns

nationalLevel.nilReason

nationalLevel.xlink_href

nationalLevel.xlink_title

nationalLevel.gml_remoteSchema

Note that neither of the v3.0 fields occur in the v4.0 schema. 

For more info on how to write INSPIRE GML see the tutorial at: https://knowledge.safe.com/articles/1321/eu-inspire-initiative-tutorial.html


Welcome to the wonderful world of EU INSPIRE namespace versions. For some reason, INSPIRE namespace versions were changed from v3.0 to v4.0 in 2015 in a way that was not backwards compatible. This makes it a challenge if you want to work with both versions - so it's not surprising you ran into some trouble here.

To keep things more concise, I'll limit my response here to the nationalLevel issue raised here. There are 2 valid formats for this. The v3.0 form is:

<au:nationalLevel>6thOrder</au:nationalLevel>

the v4.0 form is: 

<au:nationalLevel xlink:href="http://inspire.ec.europa.eu/codelist/AdministrativeHierarchyLevel/6thOrder"/>

The form you are attempting to write is not valid according to either schema, since it combines both forms. Notice that if you turn on Validate = Yes on the writer you will get a number of errors.

0684Q00000ArKBYQA3.png

INSPIRE Theme and Namespace selection

Above is a screen shot of INSPIRE theme selection that shows these 2 namespaces for AdministrativeUnits. Interestingly, if you just set the writer namespace to "Administrative Units (v3.0)" on your workspace, you will get the v3.0 form (value="6thOrder") above you are looking for. If you change it back to  "Administrative Units (v4.0)", you will get the v4.0 xlink:href form, which is what we would expect.

However, it is important to note that the schema shown in the 'Feature Type - User Attributes' screen shot above is not valid according to any INSPIRE schema. I'm not sure how it was obtained - perhaps manually modified. For GML application schema based writing, we do not recommend editing the destination schema. Rather, you should import the schema from the selected theme and namespace which causes FME to read the schema definition directly from the appropriate XSD. 

If you import the destination feature type schema from "Administrative Units (v3.0)", you will get the fields: 

nationalLevel

nationalLevel.codeSpace

If you import the destination feature type schema from "Administrative Units (v4.0)", you will get the fields: 

nationalLevel.owns

nationalLevel.nilReason

nationalLevel.xlink_href

nationalLevel.xlink_title

nationalLevel.gml_remoteSchema

Note that neither of the v3.0 fields occur in the v4.0 schema. 

For more info on how to write INSPIRE GML see the tutorial at: https://knowledge.safe.com/articles/1321/eu-inspire-initiative-tutorial.html

Thanks!

 

 

I will pass this to the person requesting the mixed version. It never occurred to me to check the 3.0 version.

 

 


A bit of thread necromancy and hijacking...

@deanatsafe - thanks for the reply to the OP question. Can you tell me what the .owns element/attribute is actually doing? I note that it is specified as xml_boolean, so what is the true/false value referring to? I'm working on the Soil theme and within the schema there are examples like soilPlotType.owns, observedProfile.owns and locatedOn.owns that I can't figure out how I should populate.


A bit of thread necromancy and hijacking...

@deanatsafe - thanks for the reply to the OP question. Can you tell me what the .owns element/attribute is actually doing? I note that it is specified as xml_boolean, so what is the true/false value referring to? I'm working on the Soil theme and within the schema there are examples like soilPlotType.owns, observedProfile.owns and locatedOn.owns that I can't figure out how I should populate.

Check if this helps: https://inspire.ec.europa.eu/forum/discussion/view/183049/gml-attributes-owns


A bit of thread necromancy and hijacking...

@deanatsafe - thanks for the reply to the OP question. Can you tell me what the .owns element/attribute is actually doing? I note that it is specified as xml_boolean, so what is the true/false value referring to? I'm working on the Soil theme and within the schema there are examples like soilPlotType.owns, observedProfile.owns and locatedOn.owns that I can't figure out how I should populate.

That is very helpful, thanks @oscard. Seems like I'm not the only one who is confused!

From reading some of the replies on that thread, another question I had was how to reference related objects e.g. a soilPlot is part of a soilSite. Do you know if using the xref attribute (as given in one of the examples) is the correct way to do it?


That is very helpful, thanks @oscard. Seems like I'm not the only one who is confused!

From reading some of the replies on that thread, another question I had was how to reference related objects e.g. a soilPlot is part of a soilSite. Do you know if using the xref attribute (as given in one of the examples) is the correct way to do it?

I'm no expert, but I think using the xref is the way to go


I'm no expert, but I think using the xref is the way to go

Thanks again @oscard. I can't find much for the Soil theme datasets, but I was reviewing a couple of land use datasets on the INSPIRE geoportal and one of them uses the xref attribute in this way.


Reply