diff --git a/_modules/apis_core/utils/rdf.html b/_modules/apis_core/utils/rdf.html index 533c07242..889916f32 100644 --- a/_modules/apis_core/utils/rdf.html +++ b/_modules/apis_core/utils/rdf.html @@ -128,11 +128,14 @@
matching_definition = None
for key, definition in configs.items():
if definition.get("filter_sparql", False):
- if bool(graph.query(definition["filter_sparql"])):
- logger.info(f"Found {key} to match the Uri")
- matching_definition = definition
- matching_definition["filename"] = str(key)
- break
+ try:
+ if bool(graph.query(definition["filter_sparql"])):
+ logger.info("Found %s to match the Uri", key)
+ matching_definition = definition
+ matching_definition["filename"] = str(key)
+ break
+ except Exception as e:
+ logger.error("filter_sparql in %s led to: %s", key, e)
model_attributes = dict()
if matching_definition:
attributes = matching_definition.get("attributes", [])
@@ -145,7 +148,7 @@ Source code for apis_core.utils.rdf
model_attributes[str(key)] = str(value)
else:
raise AttributeError(f"No matching definition found for {uri}")
- return definition, model_attributes
+ return matching_definition, model_attributes