AlgebraicJulia / Catlab.jl

A framework for applied category theory in the Julia language
https://www.algebraicjulia.org
MIT License
614 stars 58 forks source link

Uniqueness of names in schemas #828

Open KevinDCarlson opened 1 year ago

KevinDCarlson commented 1 year ago

Daniel Filonik suggests making it so that the same name can be used for more than one attribute in a schema. This is common in databases, for instance multiple tables might have an "address" column.

epatters commented 1 year ago

Having names be unique only within each hom-set is definitely a feature I've often found myself wanting. We might even have an old issue about this; I can't remember.

Implementation might be tricky because the assumption of global uniqueness of names in the schema is probably implicitly made all over the codebase.

filonik-cmu commented 1 year ago

Perhaps there is a way this could be implemented such that global uniqueness remains intact? I am thinking of some kind of "name mangling" that would automatically prepend the domain (which I am doing these days manually), i.e. turn :name into :Person_name. It's not pretty, but it might get the job done while minimizing changes to the codebase.