Category Theory
Zulip Server
Archive

You're reading the public-facing archive of the Category Theory Zulip server.
To join the server you need an invite. Anybody can get an invite by contacting Matteo Capucci at name dot surname at gmail dot com.
For all things related to this archive refer to the same person.


Stream: event: Categories for AI

Topic: composing (knowledge) graphs


view this post on Zulip Barton Rhodes (Oct 10 2022 at 15:28):

When thinking about compositionality of graphs (e.g. recent Stanford Learning Workshop https://www.youtube.com/watch?v=GYW286H3SKw&t=24580s), especially the compositionality of two or more individual knowledge graphs, is the Topos Category as suggested in this 2018 paper https://ieeexplore.ieee.org/document/8609634 still the way?

view this post on Zulip Barton Rhodes (Oct 10 2022 at 15:28):

image.png for context about knowledge graphs, would appreciate any pointer to the right way of thinking about composing these

view this post on Zulip Matteo Capucci (he/him) (Oct 10 2022 at 15:51):

Hi @Barton Rhodes, pardon the pedantry, I moved this convo to a different topic so we can keep the other one for questions about Bruno's lecture.

view this post on Zulip Barton Rhodes (Oct 10 2022 at 16:00):

wow, topics are a game-changer

view this post on Zulip Barton Rhodes (Oct 10 2022 at 16:02):

Here for the pedantry! :)

view this post on Zulip Bruno Gavranović (Oct 10 2022 at 16:12):

I'll have to take a look at the resources you linked before giving a more informed answer. But I know David Spivak studied knowledge graphs in the form of Ologs

view this post on Zulip Matteo Capucci (he/him) (Oct 10 2022 at 16:13):

Re your question, I'm not very familiar with literature of categorical knowledge but the paper you cite seems to have rediscovered Spivak's work on Ologs and in general of 'categorical database theory'. The idea is the same: the ER schema of your databse/knowledge graph becomes a category, whose objects are entities and morphisms are freely generated by the relationships (so you have the relationships you started from, identities, and all possible composites thereof). Call this category K\cal K. Then you look at functors P:KSetP:\cal K \to \bf Set, where Set\bf Set is the category of sets and functions. These are called 'copresheaves' in pure category theory, but nevermind the name. The point is giving such a functor amounts to describing a databse instance for the schema you started with. Given an entity ee, you get a set P(e)P(e) which you think of as the rows of the table corresponding to ee. If you have a relationship ϕ:ee\phi : e \to e', then you get a function P(ϕ):P(e)P(e)P(\phi):P(e) \to P(e'), sending a given row in P(e)P(e) to the corresponding row in P(e)P(e). For instance, ee might be the entity 'employees' and ee' the entity 'managers'. The N:1 relation ϕ:ee\phi : e \to e' might then be 'isManagedBy'. Then P(ϕ)P(\phi) gets a row in the employees table P(e)P(e) and send it to the row corresponding to its manager, living in P(e)P(e') (for instance by looking up a foreign key).

This is the basics. As it happens in ACT, once you manage to have a fairly good description of something in categorical language, you can start to it with all kinds of constructions and see what happens (or viceversa: you start to see which things you need to model correspond to abstraclty). You can peek at the rest in Chapter 3 of *Seven sketches*!

view this post on Zulip Matteo Capucci (he/him) (Oct 10 2022 at 16:14):

Bruno Gavranovic said:

I'll have to take a look at the resources you linked before giving a more informed answer. But I know David Spivak studied knowledge graphs in the form of Ologs

:P you've beaten me to it!

view this post on Zulip Andrew Dudzik (Oct 10 2022 at 17:01):

I think I'd look at it differently. It sounds like we have a much simpler schema: we have an Entity table with no columns, a Relation table with no columns, and an Edge table with two Entity columns and one Relation column. So a knowledge graph as defined above is a copresheaf on this quiver: Screen-Shot-2022-10-10-at-17.39.16.png. Then if we want a monoidal structure on copresheaves we can specify one on the quiver and use something like Day convolution. (I think there are further technicalities, as you probably want to specify a composition law on R; I would use enriched categories for this)

view this post on Zulip Matteo Capucci (he/him) (Oct 10 2022 at 21:15):

@Andrew Dudzik did you want to answer to #practice: applied ct > Instance functors for monoidal categories ?

view this post on Zulip lawrence rowland (Oct 12 2022 at 09:07):

Table with no columns ? Newbie here doesn’t know what to do with that.

view this post on Zulip Bruno Gavranović (Oct 12 2022 at 14:29):

You can model that with an empty schema - i.e. a category with no objects or morphisms. Then any functor out of it is vacuously defined.

view this post on Zulip Spencer Breiner (Oct 13 2022 at 01:31):

I think a table with no columns should have a schema with one object & no nonidentity arrows. The table can still hold (indistinguishable) elements.

view this post on Zulip Andrew Dudzik (Oct 13 2022 at 07:27):

Matteo Capucci (he/him) said:

Andrew Dudzik did you want to answer to #practice: applied ct > Instance functors for monoidal categories ?

Does seem related but I can't work out what's being asked in that thread.

view this post on Zulip Andrew Dudzik (Oct 13 2022 at 07:31):

lawrence rowland said:

Table with no columns ? Newbie here doesn’t know what to do with that.

I meant no non-identity columns. In this description of knowledge graphs, both nodes and relations are just sets with no properties, while edges have references to other things.

view this post on Zulip Bruno Gavranović (Oct 13 2022 at 14:00):

Spencer Breiner said:

I think a table with no columns should have a schema with one object & no nonidentity arrows. The table can still hold (indistinguishable) elements.

Right - I suppose it's useful to make distinction between an empty table and a table with no columns (but existing data in the table) :+1: