A logico-algebraic framework for ontologies