Fork me on GitHub

Hi @john ! I have an almost philosophical question for you on ontologies (or for anyone who happens to read this). Imagine a system composed of a “core library” and an interface. Let’s say that the core library defines an ontology (its internal language), and let’s say that the interface extends that ontology with additional concepts. For example, the core library may have a representation for a “person” in its ontology, and the interface may extend that representation by adding a property, “profile-picture”, which is specific to the interface.


Now here comes the question: how should equality behave?


From the core’s perspective, a “person” does not have a “profile-picture”; that’s an interface-specific concept that the core isn’t aware of (“profile-picture” is not part of the properties of a “person” in the core’s ontology)


However, if I use Clojure’s notion of value equality (`=`) to compare two person maps in the core, two persons with different profile pictures will not be considered equal (since they are different maps)


It’s more of a philosophical question than a pragmatic question I think, but what I am really wondering is, should two entities be considered equal in the core if all their properties specified in the core’s ontology are equal regardless of any additional properties not in the core’s ontology?


From a “human perspective”, it seems that two entities should be considered equal if all the properties in “my ontology” are equal, since I cannot extrapolate as to what other properties the entity might have. e.g. if I look at two cubes, I will consider them equal if all the properties in my ontology are equal (e..g they have the same size, the same colour, etc).

Alex Miller (Clojure team)12:04:41

In oo langs like Java you have to resolve the question of “what is equality” for every single class, which I find is both exhausting and the source of many subtle bugs

☝️ 8

@hmaurer Because you say you're extending core, I would think you would be violating the contract of core by not extending the same equality semantics into the extension. If the extension is smart enough to not break equality expectations throughout the program, that could be useful similar to how metadata is useful in Clojure without affecting equality. Or you could create a conditional equality system, where comparators are used optionally, depending on time, space, location or other factors. But, philosophically speaking, "ontology" is such a generic term that it doesn't have to talk about equality at all (to alex's point). Any language can be seen as an ontology. Any set of connected facts can be seen as an ontology. So the dos and don'ts of ontologies are entirely context dependent, based on what you want to accomplish and the domain you're modeling.


you could build an axiomatic system with an ontology. To get really philosophical with it: can we really claim a right or wrong way to talk about right and wrong? With respect to this universe, it would appear there are more and less efficient ways to express certain ontologies. But in a transuniversal, purely logical sense, it wouldn't appear as though there can be a "right way" to define an ontology. Ontologies that efficiently express relationships in one mathematical context will be necessarily inefficient at expressing relationships in at least one other corollary context.


@hmaurer perhaps along the lines of what you're describing, out of the jet propulsions laboratory:

Chris Bidler19:04:30

@hmaurer To pull this waaaaay down to the level of reasoning by implementation details, I think the key is the phrase > equal in the core

Chris Bidler19:04:52

so you could define a protocol Person to model the core ontology and a second protocol ProfiledUser for example, and then define an isEqual on each of them. Implementing structures (`defrecord` et. al) would have to choose what to do in their implementation of isEqual in each of their conformances to Person and ProfiledUser, though this does lead to the issue @alexmiller brings up where you have to keep track of n implementations of equality. Swift, the new-ish Apple language, has a lot of interesting literature about using protocols and protocol extensions to reason about ontology and structure orthogonally to the type system that might be worth reading about as an interesting contrast to just doing map equality or writing out a bunch of isEqual, compareTo, etc. that specify what you consider to be worthy of comparison.

Alex Miller (Clojure team)19:04:30

Clojure’s notion of equality is based on Baker’s “egal” paper in case you’re interested in reading other stuff


Hey, weird question: anyone use cryogen to blog?


Context: I started a blog using cryogen, posted a link on linkedin and it looks a bit sad because of no leading photo - but it’s a coding blog, so there won’t be any photos. If anyone out there uses cryogen, have you got any tips on how to make the link look better?


Brilliant, thank you!


So it requires an image - do you know if there is a service that would create an image from a title of an article? Or is the best practice just to add something like a favicon (except larger)?