Skip to content

Commit

Permalink
Merge pull request #87 from opengisch/fix_smart1_baskets
Browse files Browse the repository at this point in the history
Fix topic request, to list them even when no table is implemented by …
  • Loading branch information
signedav authored Feb 28, 2024
2 parents 527526d + a352886 commit 40d271c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions modelbaker/dbconnector/gpkg_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,11 +823,11 @@ def get_topics_info(self):
MA.attr_value as bid_domain,
{relevance}
FROM T_ILI2DB_CLASSNAME as CN
JOIN T_ILI2DB_TABLE_PROP as TP
LEFT JOIN T_ILI2DB_TABLE_PROP as TP
ON CN.sqlname = TP.tablename
LEFT JOIN T_ILI2DB_META_ATTRS as MA
ON substr( CN.IliName, 0, instr(substr( CN.IliName, instr(CN.IliName, '.')+1), '.')+instr(CN.IliName, '.')) = MA.ilielement and MA.attr_name = 'ili2db.ili.bidDomain'
WHERE topic != '' and TP.setting != 'ENUM'
WHERE topic != '' and ( TP.setting != 'ENUM' or TP.setting IS NULL )
""".format(
# it's relevant, when it's not extended
# relevance is emitted by going recursively through the inheritance table. If nothing on this topic is extended, it is relevant. Otherwise it's not.
Expand Down
4 changes: 2 additions & 2 deletions modelbaker/dbconnector/mssql_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -951,11 +951,11 @@ def get_topics_info(self):
PARSENAME(cn.iliname,2) as topic,
ma.attr_value as bid_domain
FROM {schema}.t_ili2db_classname as cn
JOIN {schema}.t_ili2db_table_prop as tp
LEFT JOIN {schema}.t_ili2db_table_prop as tp
ON cn.sqlname = tp.tablename
LEFT JOIN {schema}.t_ili2db_meta_attrs as ma
ON CONCAT(PARSENAME(cn.iliname,3),'.',PARSENAME(cn.iliname,2)) = ma.ilielement AND ma.attr_name = 'ili2db.ili.bidDomain'
WHERE PARSENAME(cn.iliname,3) != '' and tp.setting != 'ENUM'
WHERE PARSENAME(cn.iliname,3) != '' and ( tp.setting != 'ENUM' OR tp.setting IS NULL )
""".format(
schema=self.schema
)
Expand Down
4 changes: 2 additions & 2 deletions modelbaker/dbconnector/pg_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -978,11 +978,11 @@ def get_topics_info(self):
ma.attr_value as bid_domain,
{relevance}
FROM {schema}.t_ili2db_classname as cn
JOIN {schema}.t_ili2db_table_prop as tp
LEFT JOIN {schema}.t_ili2db_table_prop as tp
ON cn.sqlname = tp.tablename
LEFT JOIN {schema}.t_ili2db_meta_attrs as ma
ON CONCAT((string_to_array(cn.iliname, '.'))[1],'.',(string_to_array(cn.iliname, '.'))[2]) = ma.ilielement and ma.attr_name = 'ili2db.ili.bidDomain'
WHERE array_length(string_to_array(cn.iliname, '.'),1) > 2 and tp.setting != 'ENUM'
WHERE array_length(string_to_array(cn.iliname, '.'),1) > 2 and ( tp.setting != 'ENUM' or tp.setting IS NULL )
""".format(
schema=self.schema,
relevance="""
Expand Down

0 comments on commit 40d271c

Please sign in to comment.