umd-mith / mishnah

Digital Mishnah
http://www.digitalmishnah.org/
8 stars 5 forks source link

Editor App #17

Open hlapin opened 6 years ago

hlapin commented 6 years ago

Editor app sorting not working properly

Sorting by input data does not work properly. Sorts the row headers but not the data. In the screenshot below, S00483 has the token "TEST" at the beginning of the target <ab> and it still appears where the alphabetically sorted tokens would be (i.e., P00001, P00002, S00483, ...), but the row headers reflects the query order (S00483 first)

image

hlapin commented 6 years ago

Problem is back. I think I understand what is happening but not how to fix. We default to the alphabetical order. the mishnahControllers.js app calls xquery by http request in line 32, but the content of the the "wits" parameter and/or variable is allowed to be the default one. The xquery module generates a list of witnesses from ref.xml or the index file as a query order, but I don't know how to return that to the js app.

raffazizzi commented 6 years ago

I think collatex returns the data in alphabetical order nonetheless. I wrote code to re-order the table and that's probably not doing what it should. See lines 57-70. We can look at it together tomorrow

hlapin commented 6 years ago

Yes, let's. I could not figure out how to get the initial request list back to the js.


Robert H. Smith Professor of Jewish Studies and Professor of History Department of History University of Maryland 2115 Francis Scott Key Hall College Park, MD 20742 301 405 4296 | hlapin@umd.edu www.digitalmishnah.org | www.eRabbinica.org Director Joseph and Rebecca Meyerhoff Program and Center forJewish Studies University of Maryland 4141 Susquehanna Hall College Park, MD 20742 301 405 4975 | jwst-contact@umd.edu www.jewishstudies.umd.edu

On Tue, Apr 10, 2018 at 4:56 PM, Raffaele Viglianti < notifications@github.com> wrote:

I think collatex returns the data in alphabetical order nonetheless. I wrote code to re-order the table and that's probably not doing what it should. See lines 57-70 https://github.com/umd-mith/mishnah/blob/exist/resources/editapp/mishnaControllers.js#L57. We can look at it together tomorrow

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/umd-mith/mishnah/issues/17#issuecomment-380243866, or mute the thread https://github.com/notifications/unsubscribe-auth/ABBRzeAgo0SsTfPRRQHuJPgOH5oXEUqFks5tnRyCgaJpZM4S3cOa .

hlapin commented 6 years ago

I think I figured out what is going on. passThru.xql serialized as json I changed this (following your earlier module, getTknsJson.xql) to

declare option output:method "text"; declare option output:media-type "text/javascript";

This seems to work, and does not affect the functioning of calls on the function from within exist.


Robert H. Smith Professor of Jewish Studies and Professor of History Department of History University of Maryland 2115 Francis Scott Key Hall College Park, MD 20742 301 405 4296 | hlapin@umd.edu www.digitalmishnah.org | www.eRabbinica.org Director Joseph and Rebecca Meyerhoff Program and Center forJewish Studies University of Maryland 4141 Susquehanna Hall College Park, MD 20742 301 405 4975 | jwst-contact@umd.edu www.jewishstudies.umd.edu

On Tue, Apr 10, 2018 at 4:56 PM, Raffaele Viglianti < notifications@github.com> wrote:

I think collatex returns the data in alphabetical order nonetheless. I wrote code to re-order the table and that's probably not doing what it should. See lines 57-70 https://github.com/umd-mith/mishnah/blob/exist/resources/editapp/mishnaControllers.js#L57. We can look at it together tomorrow

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/umd-mith/mishnah/issues/17#issuecomment-380243866, or mute the thread https://github.com/notifications/unsubscribe-auth/ABBRzeAgo0SsTfPRRQHuJPgOH5oXEUqFks5tnRyCgaJpZM4S3cOa .

hlapin commented 6 years ago

Editor app sorting not working properly

Still/again not working right. I will generate a set of test cases to examine.
Have put in some dummy tokens at the beginnings of <ab>s so we can test. A new <w> element is added in 1.1.1.1 and 1.1.1.2 whose text is the idno.

1.1.1.1:

image

1.1.1.2:    

image

hlapin commented 6 years ago

Editor app sorting not working properly

What if the xquery that generates the json for collatex actually returns an array:

array[0] = query order as comma-separated string or array  
array[1] = json for collatex    

Then we don't have to iterate through the json to extract order.

hlapin commented 6 years ago

Editor app sorting not working properly

Another, even simpler possibility: Assign a serial prefix to each witness when the data is sent to CollateX:

001-S07326    
002-S00483    
etc.    

The data automatically comes back sorted by query order.
No sorting required. The only thing we need to do at that point is truncate the prefix.

hlapin commented 6 years ago

Editor app sorting not working properly

@raffazizzi :
Changed CollateX input to add 001, 002 etc as prefixes to witnesses to force sort results in query order. The attached photo confirms correct order vs earlier example. Please have a look! image

Made minimal modifications to mishnahControllers.js and compare.xql to account for this. As you know, I had planned to rewrite the CollateX input to TEI apparatus format so I am not planning to do much else with the xq right now, but as I understand the code in the js app there is now some unnecessary sorting that I don't want to screw up.