#bookbrainz

/

      • aphelion has quit
      • akashgp09 joined the channel
      • matterharz joined the channel
      • matterharz has quit
      • matterharz joined the channel
      • aphelion joined the channel
      • monkey
        Hi akashgp09 ! Can I help you with anything?
      • akashgp09
        Yes monkey
      • I have created tables and wrotes the orm models as well as the test cases. seems like it is working as expected.
      • i had doubt regarding the `relationship_attribute` table
      • Now that we have the `relationship_attribute_text_value` table do we really need the `relationship_attribute` table ?
      • I am unable to understand the use case of this table `relationship_attribute`
      • monkey
        That's the table that allows us to defined that a specific relationship has an attribute. Unless I'm missing something we can't do without it
      • akashgp09
        https://i.ibb.co/HYZsQ4P/Screenshot-from-2021-0... now that we have the `relationship_attribute_text_value` it forms the link between 'relationship` and `relationship_attribute_type` table
      • monkey
        That's correct. But in order to know which attributes a relationship has, we need that relationship_attribute table. That way we don't have to query for each possible attribute
      • That's going to be important down the line when we have more attributes
      • matterharz has quit
      • akashgp09
        . > But in order to know which attributes a relationship has, we need that relationship_attribute table. That way we don't have to query for each possible attribute
      • If i am not wrong the same thing can also be achieved using only the `relationship_attribute_text_value`
      • monkey
        OK, let me think it over again
      • akashgp09
        Will it be better if i push my code ? you can have a look it yourself by running the models and tests
      • monkey
        I guess it's more about trying to anticipate what the attributes will be used for in the future, so no rush to push the code if you're not ready
      • akashgp09
        yep Okay : )
      • matterharz joined the channel
      • monkey can you give some light on the min, max column on the table `relationship_type_attribute_type`
      • monkey
        akashgp09: while reviewing the schema for relationship attributes I realized we're missing something to track when a relationship attribute has changed. This is necessary with our revision system.
      • Say I change an item in a series from position "1" to position "2", how do we then record that as a revision change? How do we compare the two revisions? Sorry I missed that earlier; there are more changes needed to the schema.
      • We do indeed need that `relationship_attribute` with a few changes.
      • We are missing is a `relationship_attribute_set` table (similar to the relationship_set or alias_set tables) along with a `relationship_attribute_set__relationship_attribute` table (which links between rel_attr_set and rel_attr).
      • A new column on the `relationship` table will point to a relationship_attribute_set id.
      • Together they describe what attribute(s) a relationship has: relationship #123 has attribute_set #234 which contains relationship_attributes #456 and #567.
      • If one of the rel_attributes changes, we create a new rel_attribute and a new rel_attribute_set and in turn a new relationship and a new relationship_set.
      • That way we record all changes without losing any information and eventually we can revert revisions to a previous state.
      • Here's a diagram of what that would look like: https://usercontent.irccloud-cdn.com/file/I5vu4...
      • With these changes we do not link the relationship id to the `relationship_attribute_text_value`` anymore. Instead we use FKs to get the text_value associated with a specific `relationship_attribute` that belongs to a `relationship_attribute_set`
      • Same diagram with the `relationship_attribute_text_value` table: https://usercontent.irccloud-cdn.com/file/stR1a...
      • And to answer your question, I'll admit I still haven't wrapped my head around what the min/max columns on `relationship_type_attribute_type` will be used for, and we might end up dropping them.
      • I need to read some of the musicbrainz server code and figure that out.
      • The MB schema docs say this: "The link_type_attribute_type table […] specifies how many instances of the attribute (or one of its children) can be added to the particular [relationship] type in the min and max fields." I have still to fully understand how/if that will transfer to BookBrainz.
      • reosarevok
        monkey: the min-max will be needed if you have stuff where you need to select one or more of X. In MB it's stuff like instruments, which I guess doesn't translate to BB
      • I'd still suggest rather keep it in the schema and not use it yet than risk needing to schema change it in later, but dunno, maybe it just doesn't apply to books at all :)
      • monkey
        Thanks :) That's where I got to, trying to figure out if there would be a need for it in BB, but can't think of a good example. I was also on the "better have it and not use it than…" train.
      • A story written under different pseudonyms over time, maybe?
      • Can't really think of a clear-cut example.
      • CatQuest
        what exact thing is them in-max thing?
      • i mightthink of something
      • akashgp09
        Okay monkey thank you for the suggestions, will look into this : )
      • monkey
        Lots of flip-flopping on all this, I know it's making your job harder, so sorry about that :p
      • CatQuest
        like one or more of x, one or more of x liek what? an example in musicbrainz?
      • I'm *certain* there could be an use for something
      • even if our model doesn't even scope for that *now* it maybe in scope 10, 15 20 years from now
      • monkey
        CatQuest: An example in MB: an artist is a member of a band and plays multiple instruments in the band.
      • CatQuest
        aha
      • monkey
        (as opposed to a checkbox)
      • See that "original" and "eponymous" attributes have "0-1" because they're checkboxes while "instrument" is "0" because there can be more than one
      • CatQuest
        aaahh
      • hm
      • akashgp09
        not a problem moneky , I've you to help me out always : )
      • CatQuest
        if an author used several pseudonyms on the work?
      • if a foreword was written by several people
      • monkey
        Yeah, that's the one I thought of too.
      • I'm guessing foreword by multiple people = separate relationships, not multiple attributes on one relationship
      • CatQuest
        true
      • but we also group things like that in mb (appearance-wize)
      • and I duoon about min-maxing for that sort of thing
      • I think that it's better to have it and not use it thna having to schema to use it becasue we don't
      • we do need it some time in the future*
      • monkey
        Yeah, I suppose we all got to the same prudent conclusion :D
      • CatQuest
        what happes if it says 1-0 in thing on https://usercontent.irccloud-cdn.com/file/No574... ?
      • monkey
        I don't know if that can be the case, but reo should know
      • considering the schame columns are callde min an dmax, i suppose you can't have min > max ?
      • schema*
      • CatQuest
        schame schame schame
      • schame on you
      • monkey
        *ding ding*
      • CatQuest
        :DDD
      • monkey
        I cut my thumb so typing is a bit wonky today :p
      • CatQuest
        oh.! uff da! hope you recover soon!
      • cuts in the fingers are the worst
      • <-- would know
      • akashgp09 has quit
      • akashgp09 joined the channel
      • aphelion has quit
      • reosarevok
        I'm not sure if it even allows it, I've never tried
      • Since this is admin-only, it's more likely to be used mostly carefully
      • Mostly.
      • CatQuest
        mostly
      • :D
      • monkey
        Time to break test.mb then? :p
      • CatQuest
        YES
      • yvanzo joined the channel
      • matterharz has quit
      • akashgp09 has quit
      • Freso
      • shivam-kapila has quit
      • BenOckmore has quit
      • shivam-kapila joined the channel
      • BenOckmore joined the channel