diff --git a/src/caoscrawler/crawl.py b/src/caoscrawler/crawl.py index 50fbcac90a09ff77087d0c11a79513ee1772d061..3b53b67802d509cbc7ed1aa7fab5c8b6bf5cb229 100644 --- a/src/caoscrawler/crawl.py +++ b/src/caoscrawler/crawl.py @@ -831,6 +831,16 @@ class Crawler(object): @staticmethod def replace_name_with_referenced_entity_id(prop: db.Property): + """changes the given property in place if it is a reference property that has a name as + value + + If the Property has a List datatype, each element is treated separately. + If the datatype is generic, i.e. FILE or REFERENCE, values stay unchanged. + If the value is not a string, the value stays unchanged. + If the query using the datatype and the string value does not uniquely identify an Entity, + the value stays unchanged. + If an Entity is identified, then the string value is replaced by the ID. + """ if get_list_datatype(prop.datatype) is None: # not a list if (isinstance(prop.value, str) and is_reference(prop.datatype) and prop.datatype != db.FILE and prop.datatype != db.REFERENCE): # datatype is a non-generic reference and value is a string