Elgg icon indicating copy to clipboard operation
Elgg copied to clipboard

Add "weight" field to the relationships table (Trac #4462)

Open elgg-gitbot opened this issue 13 years ago • 9 comments

Original ticket http://trac.elgg.org/ticket/4462 on 42313745-09-15 by ewinslow, assigned to unknown.

Elgg version: 1.8

This was discussed already at length in the community (http://community.elgg.org/pg/forum/topic/830706/entity-list-spec/), but under the term "priority" which may have been an unfortunately loaded term. I thought I'd bring it up again since I see this as having application outside custom-ordering for collections.

The Elgg data model is basically a graph. Entities are the nodes. Metadata are the attributes. Relationships are the edges.

Weighted edges are a well-studied facet of graphs in CS because of their varied useful applications. The fact that the most obvious application at present for Elgg is ordering the members in a collection is just a coincidence. There are definitely more, and I think we can be justified in saying that having weighted edges in our graph model is not a hack -- unless the entire study of weighted graphs is a study of hacks.

The default weight of each edge would be 1. I don't have a preference ATM for floats vs ints.

elgg-gitbot avatar Feb 16 '13 19:02 elgg-gitbot

cash wrote on 42422820-07-01

I don't think adding something to the relationships table is a good way to handle the use case of entity lists. Without that use case, I want to see other use cases to motivate adding a weight to the relationships. There are other graph models and if we were going to move away from our simple one, I'd be much more inclined to go for property graphs rather than just adding a single weight to each edge. My position right now is to stick with what we have.

elgg-gitbot avatar Feb 16 '13 19:02 elgg-gitbot

ewinslow wrote on 42422979-05-21

We already have a property graph, it's just that we haven't implemented the ability for users to have arbitrary key/value pairs associated with a relationship like we have with entities. I'd like to keep it that way.

One use-case is recommendations -- if I want the system to go through and recommend topics or people of potential interest to a user, a weight field would necessary.

Another use-case could be tracking the relatedness of two posts.

In both of these cases I can delegate to some third party software to do the analysis and give me the rankings, but then store the results as relationships that are easily sortable without having to re-compute the results, or create new tables, or whatever.

I want to scratch the "integer" requirement though. That would be too limiting, I think. Using floats would allow us to store percentages, which are helpful for recommendations.

elgg-gitbot avatar Feb 16 '13 19:02 elgg-gitbot

Title changed from Add integer "weight" field to the relationships table to Add "weight" field to the relationships table by ewinslow on 42422979-05-21

elgg-gitbot avatar Feb 16 '13 19:02 elgg-gitbot

cash wrote on 42425040-05-23

We don't support a full property graph as we're missing properties on the edges. See http://markorodriguez.com/2011/02/08/property-graph-algorithms/

I prefer either keeping it like it is or adding full blown property support on edges. Basically, if we're going to go through the effort of changing relationships, let's go all the way.

elgg-gitbot avatar Feb 16 '13 19:02 elgg-gitbot

ewinslow wrote on 42426060-02-07

The gap between adding a single, sensible field and supporting arbitrary fields feels pretty large to me, both in terms of implementation effort and in terms of effect on performance.

Also, adding a weight field would not preclude us from adding arbitrary property support later on. Even if we did have arbitrary property support, I think it would make sense to have weights without requiring joins, much like all entities have certain properties not stored as metadata.

elgg-gitbot avatar Feb 16 '13 19:02 elgg-gitbot

Milestone changed to Long Term Discussion by brettp on 43030281-05-10

elgg-gitbot avatar Feb 16 '13 19:02 elgg-gitbot

Hi, weight is an interesting aspect when it enables social network analysis. Then a whole new world will open to Elgg. Now we have userpoints and fivestar ratings. With social analysis this could really make a "unique selling point". The challenge will then be how to do the social network analysis. I heard of Rapidminer.

Tauvic avatar Feb 27 '13 12:02 Tauvic

So in https://docs.google.com/a/elgg.org/document/d/1R3v_bYno6fw8mV5_GDW93uTI0pvR9S4yQ-BHMKTz1zs/edit we would add "weight" to list_items. Seems like the savings of normalization would make that cheap.

mrclay avatar Feb 09 '15 22:02 mrclay

I still think this would be valuable. Still feel the same way as my last comment on this thread

ewinslow avatar Feb 10 '15 00:02 ewinslow