Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update database variable #189

Merged
merged 6 commits into from
Jan 17, 2024
Merged

update database variable #189

merged 6 commits into from
Jan 17, 2024

Conversation

peterstadler
Copy link
Member

and update output options to fix #186

and update output options
@peterprovaznik
Copy link
Collaborator

With the caveat that I don't really feel qualified to assess the quality and correctness of the output, it mostly looks good using the issue-186 image. I have tried all the queries listed on the help page and they do result in output that looks plausible. However ...

  • location_index.xq errors ("string concatenation operator is not available before XQuery 3.0 [at line 24, column 32 ...]"), most likely due to the use of || in a file that declares version 1.0 of XQuery
  • images in list_incipit_graphics.xq are not shown correctly due to a missing ../ (<img src="../../resources/images/demo_incipits/lowres/cnw_002_1_1.png"> works when I change it in DevTools)
  • the help file mentions http://my_server_name.org/storage/tools/title_index?c=CNW at the top when it should be modules rather than storage; also I had to use ?c=Demo to get results, might consider changing that as well.

added URL parameter to all queries and fixed the example link
which was failing with "HTTP ERROR 500 javax.servlet.ServletException: javax.servlet.ServletException: An error occurred while processing request to /modules/tools/location_index.xq: An error occurred: class org.exist.xquery.value.ValueSequence cannot be cast to class org.exist.dom.persistent.NodeSet (org.exist.xquery.value.ValueSequence and org.exist.dom.persistent.NodeSet are in unnamed module of loader 'app')"
@peterstadler
Copy link
Member Author

Many thanks @peterprovaznik again for the thorough review!
I addressed and fixed the issues in my latest commits – would you mind to have another look?

While most fixes are straight forward the latest (167618c) introduces some more changes since I realized that the failing query could be rewritten to simplify things thanks to XQuery-3.0 "group by". Yet, I'm not 100% sure what the desired result is and whether I was able to reproduce it…

@peterprovaznik
Copy link
Collaborator

Looks good. As for the location_index.xq, which contains the group-by, I get the following output:

Screenshot from 2024-01-15 17-27-51

I would understand these numbers to be all the entries in the Demo collection (<work>/<identifier label="Demo">) which have this location, so it would probably be better to have each identifier only once. (I think this could be achieved with something like return $numbers => distinct-values() => string-join(', ') in line 102.) What do you think?

@peterstadler
Copy link
Member Author

peterstadler commented Jan 15, 2024

many thanks for the improvement @peterprovaznik ! I just pushed it and now it looks much cleaner:

Bildschirmfoto 2024-01-15 um 22 12 45

Copy link
Collaborator

@peterprovaznik peterprovaznik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell the index queries are now working as described on the help page.

@dikastes dikastes merged commit 6d999b7 into develop Jan 17, 2024
6 checks passed
@dikastes dikastes deleted the issue-186 branch January 17, 2024 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix tools for generating indexes
3 participants