sikher / gurbanidb

An API for the Sikh Scriptures using the Laravel PHP framework
https://api.sikher.com
18 stars 4 forks source link

Data for bani classified as Saloks needs reorganization #6

Open irvanjitsingh opened 9 years ago

irvanjitsingh commented 9 years ago

The bani that is classified as Guru Tegh Bahadhur Ji's Saloks, Bhagat Kabeer Ji's Saloks, etc. are all attached to a single hymn ID. This may have been by design can be useful in some cases but there should be a better way to organize the Saloks, such as an additional salok ID attached to the pangtis that are in a Salok, so that specific Saloks can be retrieved without pulling them all. This can probably be achieved by limiting the results in the hymn to line numbers within a range of the searched-for pangti but that would be hackish and not guaranteed to be correct.

jasdeepkhalsa commented 9 years ago

Could you give some examples of this?

irvanjitsingh commented 9 years ago

From Salok Mahalla 9: Gun Gobind Gaeou Nahee, Janam Akaarath Keen || Kahu Nanak Har Bhaj Manaa, Jih Bidh Jal Ko Meen.

Those are two pangtis (lines), and together, they are a Salok (couplet). Salok Mahalla 9 is a collection of the Saloks. In the case of Salok Mahalla 9 however, when we read them we usually read them all together as one bani. But most search engines will only give you the above Salok if you searched for that first line (Gun Gobind Gaeou Nahee). Right now, GurbaniDB has the same hymn ID associated with all of Salok Mahalla 9, and that doesn't need to change. But what I'm suggesting is a Salok ID so that you can have the above Salok have salokID=1, the next Salok have salokID=2 and so on. So it would look like: Salok Collection X: hymnID=XXX, salokID=1 through XX. Salok IDs can be either unique, or simply an indication of where in the hymn the particular salok is. A salokID would be shared by two lines (the two above for example).

jasdeepkhalsa commented 9 years ago

It's a very good idea. I think what I would like to do though is to look at meta data at a higher level than just the Shaloks (couplets) as I'm sure there's many situations where inside one hymn there are sub-hymns like this. Otherwise it may be a waste of memory just to add an additional column for shaloks.

sukhpalsingh commented 8 years ago

instead of salok id, what about having column which will be listing the line number as in Shri Guru Granth Sahib. e.g. ਆਦਿ ਸਚੁ ਜੁਗਾਦਿ ਸਚੁ ॥ and ਹੈ ਭੀ ਸਚੁ ਨਾਨਕ ਹੋਸੀ ਭੀ ਸਚੁ ॥੧॥ should be line one and not two different lines. so we can add 1 for these two scriptures in the database.

This will be same for saloks or any other shabads and will be helpful to retrieve all the panktis for a single line.

It will be same in the above case in which each salok line is group of two scriptures in the database so will have same line id and can be retrieve together.

jasdeepkhalsa commented 8 years ago

@sukhpalsingh This is a great solution, having an optional line column for these kind of situations will be perfect. In the cases where a line number does exist, it can take priority over the hymn id