Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can GDAL GMLAS handle local reference xlink:href="# #31

Closed
sgrellet opened this issue Aug 10, 2017 · 5 comments
Closed

Can GDAL GMLAS handle local reference xlink:href="# #31

sgrellet opened this issue Aug 10, 2017 · 5 comments
Assignees
Labels
bug Houston, we've a problem!

Comments

@sgrellet
Copy link
Member

Importing one of the 3 URIs below
http://ressource.brgm-rec.fr/data/EntiteHydroGeol/113AI01
http://ressource.brgm-rec.fr/data/EntiteHydroGeol/121AU
http://ressource.brgm-rec.fr/data/EntiteHydroGeol/121AT30

GDAL GMLAS identifies properly the various information elements.
However the GUI is not able from the 'identify' action on the mappedfeature the link to the other tables.
Is the driver capable of handling the <gsmlb:specification xlink:href="# structure (ex : <gsmlb:specification xlink:href="#EntiteHydroGeol.121AT30"/> in the last URI ) ?

@rouault
Copy link
Collaborator

rouault commented Aug 10, 2017

Regarding http://ressource.brgm-rec.fr/data/EntiteHydroGeol/121AT30

$ ogrinfo GMLAS:test.xml -oo remove_unused_layers=yes mappedfeature 

OGRFeature(mappedfeature):1
  id (String) = MappedFeature.234
[...]
  specification_href (String) = #EntiteHydroGeol.121AT30
[...]

So the GMLAS driver only recognizes the specification link as a generic string.

The reason is that the gsmlb:specification element is defined as such

                                        <element name="specification" type="gml:FeaturePropertyType" minOccurs="0">
                                                <annotation>
                                                        <documentation>The specification association links an instance of MappedFeature to the GFI_Feature being mapped. In a geological map, MappedFeatures are used to represent GeologicFeatures, but other features from other domains could be represented.</documentation>
                                                        <appinfo>
                                                                <targetElement xmlns="http://www.opengis.net/gml/3.2">null:GFI_Feature</targetElement>
                                                        </appinfo>
                                                </annotation>
                                        </element>

So there's no direct connection with a gwml2:GW_Aquifer element.
To be able to do that connection, that would require adding an initial pass to the driver that would create a map from gml:id to their belonging element, and a map from xlink:href values to their belonging elements, so that you finally you can establish existing relationships between both and feed that into the schema analyzer

@sgrellet
Copy link
Member Author

Supporting this xlink:href="# pattern is a must have to me as it is often used.
Do you see a way to 'patch' this on the client side before having this implemented in the GMLAS driver ?

sgrellet added a commit that referenced this issue Nov 7, 2017
@sgrellet
Copy link
Member Author

sgrellet commented Nov 7, 2017

@rouault
Copy link
Collaborator

rouault commented Dec 7, 2017

Implemented in GDAL trunk r40973

$ ogrinfo GMLAS:GWML2.xml  -oo remove_unused_layers=yes -oo remove_unused_fields=yes -oo expose_metadata_layers=yes -al | less
[...]
OGRFeature(mappedfeature):1
  id (String) = MappedFeature.234
  resolutionrepresentativefraction (Integer) = 50000
  mappingframe_href (String) = http://resource.geosciml.org/feature/brgm/EarthBedrockSurface
  specification_href (String) = #EntiteHydroGeol.121AT30
  specification_abstractfeature_gw_aquifer_pkid (String) = EntiteHydroGeol.121AT30
[...]
OGRFeature(_ogr_fields_metadata):2592
  layer_name (String) = mappedfeature
  field_index (Integer) = 53
  field_name (String) = specification_abstractfeature_gw_aquifer_pkid
  field_xpath (String) = gsml:MappedFeature/gsml:specification/gwml2:GW_Aquifer
  field_type (String) = string
  field_is_list (Integer(Boolean)) = 0
  field_min_occurs (Integer) = 0
  field_max_occurs (Integer) = 1
  field_category (String) = PATH_TO_CHILD_ELEMENT_WITH_LINK
  field_related_layer (String) = gw_aquifer
[...]
OGRFeature(_ogr_layer_relationships):853
  parent_layer (String) = mappedfeature
  parent_pkid (String) = id
  parent_element_name (String) = specification_abstractfeature_gw_aquifer_pkid
  child_layer (String) = gw_aquifer
  child_pkid (String) = id
[...]

kwrobot pushed a commit to aashish24/gdal-svn that referenced this issue Dec 7, 2017
@sgrellet
Copy link
Member Author

sgrellet commented Dec 8, 2017

I'll test it when pushed to gdal-dev in OsGeo4W.
Currently I have access to gdal-dev 2.3.0-40977

@Guts Guts assigned sgrellet and unassigned rouault and mhugo Dec 2, 2020
@Guts Guts added the bug Houston, we've a problem! label Dec 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Houston, we've a problem!
Projects
None yet
Development

No branches or pull requests

4 participants