This does not work with custom datatypes, neither with declare_datatype before this statement, nor with define_in_ontology.
The only solution I see at the moment is to add the IRI with _universal_abbrev_datatype in the base.py like 'locstring'. Any idea?
Edit: I found another workaround where the code does not need to be customized.
The solution is to declare the required Datatype class within the namespace and then pass it to the property restriction: