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

CSV metadata table unreachable #22

Closed
lucagiovannini7 opened this issue Jul 21, 2023 · 3 comments
Closed

CSV metadata table unreachable #22

lucagiovannini7 opened this issue Jul 21, 2023 · 3 comments
Assignees

Comments

@lucagiovannini7
Copy link
Member

As of now, it is not possible to download the csv metadata table at https://dracor.org/api/corpora/fre/metadata/csv. The JSON table is working, though. Error message:

HTTP ERROR 500 javax.servlet.ServletException: javax.servlet.ServletException: An error occurred while processing request to /exist/restxq/v0/corpora/fre/metadata/csv: err:XPTY0004 checking function parameter 1 in call string-join(untyped-value-check[xs:anyAtomicType, for <697> $c in $api:metadata-columns return <698> if ( count($m($c)) = 0 ) then "" else dutil:csv-escape(untyped-value-check[xs:string, $m($c)]) ], "",""): XPTY0004: The actual cardinality for parameter 1 does not match the cardinality declared in the function's signature: dutil:csv-escape($string as xs:string) xs:string. Expected cardinality: exactly one, got 2. [at line 698, column 74, source: /db/apps/dracor-v0/modules/api.xqm] In function: dutil:csv-escape(xs:string) [698:51:/db/apps/dracor-v0/modules/util.xqm] api:get-corpus-meta-data-csv(item()) [732:3:/db/apps/dracor-v0/modules/api.xqm] api:corpus-meta-data-csv-endpoint(item()) [-1: -1:/db/apps/dracor-v0/modules/api.xqm]

@cmil
Copy link
Member

cmil commented Aug 1, 2023

The immediate cause of the problem is that for each play we currently provide two URLs for the digital source, one is an HTML page and there other the actual TEI from Théâtre Classique. See for instance:

<bibl type="digitalSource">
<name>Théâtre Classique</name>
<idno type="URL">http://theatre-classique.fr/pages/programmes/edition.php?t=../documents/ABEILLE_ARGELIE.xml</idno>
<idno type="URL">http://theatre-classique.fr/pages/documents/ABEILLE_ARGELIE.xml</idno>

This is unexpected in the XQuery and causes the exception.

While this should be caught on the API level, the question remains whether it makes sense to keep these two digital source URLs. I would suggest to loose the reference to the HTML page and just keep the TEI URL, since these are actually the documents we use for the import to FreDraCor. What do you think @lehkost?

cmil added a commit to dracor-org/dracor-api that referenced this issue Aug 1, 2023
@cmil cmil self-assigned this Aug 1, 2023
@cmil
Copy link
Member

cmil commented Aug 1, 2023

@lucagiovannini7 The exception is fixed in version 0.91.1 of the API. We should still fix the TEI.

@cmil
Copy link
Member

cmil commented Aug 1, 2023

I created a new issue to take care of the URLs, so we can close this one.

@cmil cmil closed this as completed Aug 1, 2023
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

No branches or pull requests

2 participants