BRGM / gml_application_schema_toolbox

GML Application Schema toolbox is a QGIS plugin allowing to manipulate OGC Complex Features
https://brgm.github.io/gml_application_schema_toolbox/
GNU General Public License v2.0
28 stars 18 forks source link

Relational mode (GMLAS) 1:N links #52

Open mhugo opened 6 years ago

mhugo commented 6 years ago

Stacktrace generated.

Details to come

sgrellet commented 6 years ago

-> connected to https://wfspoc.brgm-rec.fr/geoserver/ows -> choosing Feature type 'ef:EnvironmentalMonitoringFacility' -> WFS Options Limit to 1 feature(s) -> 'Download to': a temporary file or an explicit file path -> then 'Load from WFS layer' -> identify feature button on one of the points displayed 1/N links tab generates the following Python error 'Une erreur est survenue lors de l'exécution du code suivant: my_form_open( _qgis_featureform_48_48, _qgis_layer_environmenmonitoringfacility_legalbackground_legalbackground_3ae2fb09_7803_4723_9a8e_d072501fb0e1_48, _qgis_feature_20180122114002269)

Traceback (most recent call last): File "", line 1, in File "", line 3, in my_form_open File "C:/Users/grellets/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\gml_application_schema_toolbox\gui\qgis_form_custom_widget.py", line 72, in inject_custom_viewer_into_form xpath = no_ns(layer.customProperty("xpath", "")) File "C:/Users/grellets/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\gml_application_schema_toolbox\core\xml_utils.py", line 36, in no_ns i=s.find(':') AttributeError: 'NoneType' object has no attribute 'find''

Version de Python : 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)]

Version de QGIS : 2.99.0-Master 'Master', b4be39f98b

sgrellet commented 6 years ago

not testable on v1.2.0-rc2 because of #53

sgrellet commented 6 years ago

on v1.2.0-rc6 This URI : http://ressource.brgm-rec.fr/data/Piezometre/06512X0037/STREMY.2 Lead to the attached sqlLite DB : 20180417_EF_ST_REMY2.zip 1°/ identify feature button on one of the points displayed 2°/ 1/N links tab generates the following Python errors

Une erreur est survenue lors de l'exécution du code suivant: my_form_open( _qgis_featureform_36_36, _qgis_layer_environmenmonitoringfacility_legalbackground_legalbackground_68699336_7596_41c8_ab74_53cd3412ab71_36, _qgis_feature_20180417165822992)

Traceback (most recent call last): File "", line 1, in File "", line 4, in my_form_open File "C:/Users/grellets/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\gml_application_schema_toolbox\gui\qgis_form_custom_widget.py", line 126, in inject_href_buttons_into_form layout = find_label_layout(dialog, pkid) File "C:/Users/grellets/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\gml_application_schema_toolbox\gui\qgis_form_custom_widget.py", line 315, in find_label_layout if isinstance(it, QWidgetItem) and isinstance(it.widget(), QLabel) and it.widget().text().startswith(lbl_text): TypeError: startswith first arg must be str or a tuple of str, not NoneType

then ... Une erreur est survenue lors de l'exécution du code suivant: my_form_open( _qgis_featureform_78_78, _qgis_layer_environmmonitorifacility_observincapabili_observincapability_29b2f8cf_319a_42db_a129_06120f0ee1e2_78, _qgis_feature_20180417170043602) ...

then ... Une erreur est survenue lors de l'exécution du code suivant: my_form_open( _qgis_featureform_79_79, _qgis_layer_environmentalmonitoringfacility_reportedto_reportedto_28349bad_5807_4ada_a29f_79aafed504ba_79, _qgis_feature_20180417170050580) ...

Then ... Une erreur est survenue lors de l'exécution du code suivant: my_form_open( _qgis_featureform_80_80, _qgis_layer_environmentamonitoringfacility_hasobservation_hasobservation_04378ecc_c3c5_46db_8f05_510814abc9a5_80, _qgis_feature_20180417170055764) ...

Then ... Une erreur est survenue lors de l'exécution du code suivant: my_form_open( _qgis_featureform_81_81, _qgis_layer_environmentalmonitoringfacility_involvedin_involvedin_36f9f35f_6d37_46cd_89fb_599574920b77_81, _qgis_feature_20180417170059760) ...

Python : 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)] QGIS : 3.0.1-Girona Girona, a86bec25ebw

sgrellet commented 6 years ago

no more error raised using GMLAS toolbox plugin : v1.2.0-rc7 with http://ressource.brgm-rec.fr/data/Piezometre/06512X0037/STREMY.2

BUT still the content is not dynamically updated in form view in case you have an element that repeats itself (see ef:belongsTo and ef:hasObservation for that URI).

In tabular view ('basculer sur la vue tabulaire'), all the necessary info seems here (ex : networkfacility_pkid) but in form view ('basculer sur la vue formulaire'), when you chose one of the 8 elements for 'environmentalmonitoringfacility_belongsTo', nothing is updated on the right side (displayed 'Réseau patrimonial national de suivi quantitatif des eaux souterraines(RNESP)' and URI 'http://ressource.brgm-rec.fr/data/DispositifCollecte/0000000029"' and other remain displayed)

Version de Python : 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)] Version de QGIS : 3.0.1-Girona Girona, a86bec25eb

sgrellet commented 6 years ago

one addition, still using http://ressource.brgm-rec.fr/data/Piezometre/06512X0037/STREMY.2 the following XPath does not seem to be handled properly in the GUI in form mode (/wfs:FeatureCollection/wfs:member/ef:EnvironmentalMonitoringFacility/ef:observingCapability/ef:ObservingCapability) maybe it is due to the fact that we have a camelcase trick here (in the uml the association role and the featureType have the same name... which we can differentiate with camelCase writing). In the GUI, in form mode, there is no content in environmmonitorifacility_observincapabili_observincapability corresponding to the XML snippet below whereas all is in table 'observingcapability1'

... GMLAS toolbox plugin : v1.2.0-rc7 Version de Python : 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)] Version de QGIS : 3.0.1-Girona Girona, a86bec25eb
sgrellet commented 3 years ago

Error reproduced in the same environment as above Database properly created But same issue

Test cases run

Trying to ingest the same 'ST_REMY' data instance (same model) from the new URI generates another error -> will create the corresponding issue

sgrellet commented 3 years ago

Edit : there is actually no new error. It seems that our VPN tool was creating it. -> network aspect -> no new issue created (but still the former one is reproductible)