Open ghost opened 6 years ago
@j-dornbusch I'm wondering if you can expand on the issue you are having with an example of a label that is not translating.
Here are a few observations around language processing in QA.
lang=de
parameter to the request URL which will return any literals tagged with de
and any literals without a language tag. Authorities themselves have variable support for languages and QA is not able to rectify a lack of support in the data.This allows for a search with the query string in the specified language and returns results in the requested language
Examples:
This allows for a search with the query string in the specified language, but the results will be returned for the primary language only (almost always English)
Example:
QA can search other direct predicates (as seen in previous example), but does not at this time support cascading search to a bnode value. In this case, you cannot search using a query string in the alternate language. It will return 0 results.
<http://id.loc.gov/authorities/subjects/sh85118553> <http://www.loc.gov/mads/rdf/v1#hasCloseExternalAuthority> <http://d-nb.info/gnd/4066562-8> .
<http://d-nb.info/gnd/4066562-8> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.loc.gov/mads/rdf/v1#Authority> .
<http://d-nb.info/gnd/4066562-8> <http://www.loc.gov/mads/rdf/v1#authoritativeLabel> "Wissenschaft"@de .
http://id.loc.gov/authorities/names/n79021164.nt
There are more than a few authorities where the raw data does not include language tags on the literals.
If you have a specific authority you are trying to work with, we can look into what the data supports and whether an indexing change would allow for language search.
QA can support many more authorities than what comes with QA. Many of the examples here are from these additional authorities. You can see other supported linked data authorities at https://github.com/ld4p/linked_data_authorities.
@elrayle I am sorry to answer after such a long delay. We have created file based controlled vocabularies derived from Skos thesaurus. So the 'prefLabels' come with RDF langtags. The generated YAML file looks like this :
terms:
- id: http://data.ehess.fr/thes/airecult/aire8
term:
- '"Asie"@fr'
- '"Asia"@en'
- id: http://data.ehess.fr/thes/airecult/aire13
term:
- '"Britanniques (études)"@fr'
- '"British (studies)"@fr'
- id: http://data.ehess.fr/thes/airecult/aire26
term:
- '"Japon"@fr'
- '"Japan"@en'
- id: http://data.ehess.fr/thes/airecult/aire2
term:
- '"Allemandes (études)"@fr'
- '"German (studies)"@en'
- id: http://data.ehess.fr/thes/airecult/aire20
term:
- '"Europe sud-orientale"@fr'
# etc
A wrapper service is then needed to filter the appropriate language (and of course a helper or a renderer to remove the langtag before displaying the label).
def select_all_options(locale = :fr)
get_authority.all.map do |element|
[apply_language_preference(element[:label], locale), element[:id]]
end.sort_by {|element| element.first.downcase}
end
def get_authority
authority = Qa::Authorities::Local.subauthority_for(@vocabulary_identifier) unless authority
end
There seems to be no way to give labels in multiple languages. It's a problem when the underlying vocabulary is a skos vocabulary where preflabels have langtags. We can not adapt the display to the user's language preferences. Or, should we create a yaml file per language with a suffix and adapt the client code? Or replace the terms with i18n keys and put the labels in the internationalization files by adapting the code?