You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I installed VocabsEditor locally (a great tool indeed) and I tried importing the entire GEMET Concepts SKOS vocabulary version 4.2.3. There are many skos:prefLabels with language values such as: "en-US" e.g.:
and that was when I got the error from the job_status page:
{"exc_type": "DataError", "exc_message": ["value too long for type character varying(3)\n"], "exc_module": "django.db.utils"}
I modified models.py and for all CharFields with max_length=3 I changed it to max_length=10. Then I also modified forms.py, run makemigrations + migrate and importing worked just fine.
So, my suggestion would be that the maximum length of the language value could be longer. What the exact maximum value should be I can't tell precisely, but maybe this Best Practice RFC could be of help: https://www.rfc-editor.org/rfc/rfc5646 - hope it helps.
Cheers
The text was updated successfully, but these errors were encountered:
langtag = language
["-" script]
["-" region]
*("-" variant)
*("-" extension)
["-" privateuse]
language = 2*3ALPHA ; shortest ISO 639 code
["-" extlang] ; sometimes followed by
; extended language subtags
/ 4ALPHA ; or reserved for future use
/ 5*8ALPHA ; or registered language subtag
extlang = 3ALPHA ; selected ISO 639 codes
*2("-" 3ALPHA) ; permanently reserved
script = 4ALPHA ; ISO 15924 code
region = 2ALPHA ; ISO 3166-1 code
/ 3DIGIT ; UN M.49 code
variant = 5*8alphanum ; registered variants
/ (DIGIT 3alphanum)
extension = singleton 1*("-" (2*8alphanum))
; Single alphanumerics
; "x" reserved for private use
singleton = DIGIT ; 0 - 9
/ %x41-57 ; A - W
/ %x59-5A ; Y - Z
/ %x61-77 ; a - w
/ %x79-7A ; y - z
privateuse = "x" 1*("-" (1*8alphanum))
which means that the language tag can be of more or less arbitrary length because the variant, extension and (an internal part of) privateuse parts can be repeated any number of times but assuming all parts are used exactly once, it's something like 8 [language] + 5 [script] + 4 [region] + 9 [variant] + 16 [extension] + 11 [privateuse] = 53.
Hi,
I installed VocabsEditor locally (a great tool indeed) and I tried importing the entire GEMET Concepts SKOS vocabulary version 4.2.3. There are many
skos:prefLabel
s with language values such as:"en-US"
e.g.:<skos:prefLabel xml:lang="en-US">SOCIAL ASPECTS, ENVIRONMENTAL POLICY MEASURES</skos:prefLabel>
and that was when I got the error from the job_status page:
{"exc_type": "DataError", "exc_message": ["value too long for type character varying(3)\n"], "exc_module": "django.db.utils"}
I modified models.py and for all
CharField
s withmax_length=3
I changed it tomax_length=10
. Then I also modified forms.py, runmakemigrations + migrate
and importing worked just fine.So, my suggestion would be that the maximum length of the language value could be longer. What the exact maximum value should be I can't tell precisely, but maybe this Best Practice RFC could be of help: https://www.rfc-editor.org/rfc/rfc5646 - hope it helps.
Cheers
The text was updated successfully, but these errors were encountered: