WE HAVE SUNSET THIS LISTSERV - Join us at collectionspace@lyrasislists.org
View all threadsHi all,
I'm trying hard to save a BC date in the dateearliestscalarvalue of the structuredate component, without success.
Looking at PostgreSQL documentationhttp://www.postgresql.org/docs/9.1/static/datatype-datetime.html#DATATYPE-DATETIME-DATE-TABLE, I can see that the date input for a BC date has to follow this format:
"January 8, 99 BC"
But after saving my object, when I look at the related field in the database, I find this value:
"0099-01-08 00:00:00" - the reference to BC is lost.
Does somebody have an idea on this problem?
Thank you by advance.
Best regards,
Sébastien
Sébastien Brossard
IT-Udvikler
sebastien.brossard@smk.dkmailto:3sebastien.brossard@smk.dkT
Tmailto:3sebastien.brossard@smk.dkT +45 3374 8483
Statens Museum for Kunst
Sølvgade 48-50
DK-1307 København K
T +45 3374 8494
F +45 3374 8404
smk.dkhttp://smk.dk/
[Logo_mail]
Hi Sébastien,
With sincere apologies for the much delayed response ...
It appears to be possible to store a BC data in the
dateEarliestScalarValue field of a structured date, at least via the
Services REST APIs.
By sending a payload that includes a negative value for the year, where
the "year 2 BC must be written as -0001, the year 3 BC must be written as
-0002 etc." - apparently an ISO 8601 convention (
http://www.tondering.dk/claus/cal/iso8601.php#bcdates) - the value gets
stored in the database in the BC era.
For instance, with SMK's contributed CitationAuthority, a structured date
that includes this value
<dateEarliestScalarValue>-0098-01-08</dateEarliestScalarValue>
gets stored in the database with the requisite year and date. That is,
when viewed via psql, a query in the nuxeo database for "select
dateearliestscalarvalue from structureddategroup" returns, for that record
(notwithstanding the likely nonsensical time value):
0099-01-07 16:00:00 BC
However, it appears that when retrieved via a subsequent GET request to
the services, that era is missing from the value in the response payload,
even though the value is still correctly stored in the database:
<dateEarliestScalarValue>0099-01-08T00:00:00Z</dateEarliestScalarValue>
I'll make a JIRA bug report for that issue; thanks very much for calling
this to our attention.
Aron
P.S. There may be other remaining bugs around handling of BC / BCE dates as
well. For instance, although CSPACE-2810 introduced some BC date handling
features for calendar dates,
https://github.com/collectionspace/ui/pull/161/files, at a quick first
glance, I'm not seeing one of these changes in current UI master; another
thing to check on further ...
--
<publicationDate> <dateEarliestSingleQualifier /> <scalarValuesComputed>true</scalarValuesComputed> <dateLatestDay /> <dateLatestYear /> <dateAssociation /> <dateEarliestSingleEra /> <dateDisplayDate>2001</dateDisplayDate> <dateEarliestSingleCertainty /> <dateLatestEra /> <dateEarliestSingleQualifierValue /> <dateLatestCertainty /> <dateEarliestSingleYear>2001</dateEarliestSingleYear> <dateLatestQualifier /> <dateLatestQualifierValue /> <dateEarliestSingleQualifierUnit /> <datePeriod /> <dateEarliestScalarValue>-0098-01-08</dateEarliestScalarValue> <dateLatestMonth /> <dateNote /> <dateLatestScalarValue /> <dateLatestQualifierUnit /> <dateEarliestSingleDay /> <dateEarliestSingleMonth /> </publicationDate>On Wed, May 22, 2013 at 7:15 AM, Sébastien Brossard <
Sebastien.Brossard@smk.dk> wrote:
Hi all,****
I’m trying hard to save a BC date in the dateearliestscalarvalue of the
structuredate component, without success.****
Looking at PostgreSQL documentationhttp://www.postgresql.org/docs/9.1/static/datatype-datetime.html#DATATYPE-DATETIME-DATE-TABLE,
I can see that the date input for a BC date has to follow this format:****
“January 8, 99 BC”****
But after saving my object, when I look at the related field in the
database, I find this value:****
“0099-01-08 00:00:00” – the reference to BC is lost.****
Does somebody have an idea on this problem?****
Thank you by advance.****
Best regards,****
Sébastien****
Sébastien Brossard**
IT-Udvikler**
sebastien.brossard@smk.dk 3sebastien.brossard@smk.dkT**
T 3sebastien.brossard@smk.dkT +45 3374 8483****
Statens Museum for Kunst****
Sølvgade 48-50****
DK—1307 København K****
T +45 3374 8494****
F +45 3374 8404****
smk.dk****
[image: Logo_mail]****
Talk mailing list
Talk@lists.collectionspace.org
http://lists.collectionspace.org/mailman/listinfo/talk_lists.collectionspace.org
Hi Aron,
Thank you for your answer.
Yes, it appears to be possible. Chris (Pott) found out that it was actually possible to save a BC date in the db, but looking at the value with Dbvisualizer, the BC disappeared from the date.
There's definitively something strange about this BC data. We don't have time to investigate further this problem now, but it's in good position on our priority list.
We had spotted also this limitation of calendar dates - same as above, it's on our to-do list.
Best regards,
Sébastien
Fra: aronroberts@gmail.com [mailto:aronroberts@gmail.com] På vegne af Aron Roberts
Sendt: 3. juni 2013 22:31
Til: Sébastien Brossard
Cc: talk@lists.collectionspace.org
Emne: Re: [Talk] StructureDate - dateearliestscalarvalue / datelatestscalarvalue fields BC
Hi Sébastien,
With sincere apologies for the much delayed response ...
It appears to be possible to store a BC data in the dateEarliestScalarValue field of a structured date, at least via the Services REST APIs.
By sending a payload that includes a negative value for the year, where the "year 2 BC must be written as -0001, the year 3 BC must be written as -0002 etc." - apparently an ISO 8601 convention (http://www.tondering.dk/claus/cal/iso8601.php#bcdates) - the value gets stored in the database in the BC era.
For instance, with SMK's contributed CitationAuthority, a structured date that includes this value
<dateEarliestScalarValue>-0098-01-08</dateEarliestScalarValue>
gets stored in the database with the requisite year and date. That is, when viewed via psql, a query in the nuxeo database for "select dateearliestscalarvalue from structureddategroup" returns, for that record (notwithstanding the likely nonsensical time value):
0099-01-07 16:00:00 BC
However, it appears that when retrieved via a subsequent GET request to the services, that era is missing from the value in the response payload, even though the value is still correctly stored in the database:
<dateEarliestScalarValue>0099-01-08T00:00:00Z</dateEarliestScalarValue>
I'll make a JIRA bug report for that issue; thanks very much for calling this to our attention.
Aron
P.S. There may be other remaining bugs around handling of BC / BCE dates as well. For instance, although CSPACE-2810 introduced some BC date handling features for calendar dates, https://github.com/collectionspace/ui/pull/161/files, at a quick first glance, I'm not seeing one of these changes in current UI master; another thing to check on further ...
--
<publicationDate> <dateEarliestSingleQualifier /> <scalarValuesComputed>true</scalarValuesComputed> <dateLatestDay /> <dateLatestYear /> <dateAssociation /> <dateEarliestSingleEra /> <dateDisplayDate>2001</dateDisplayDate> <dateEarliestSingleCertainty /> <dateLatestEra /> <dateEarliestSingleQualifierValue /> <dateLatestCertainty /> <dateEarliestSingleYear>2001</dateEarliestSingleYear> <dateLatestQualifier /> <dateLatestQualifierValue /> <dateEarliestSingleQualifierUnit /> <datePeriod /> <dateEarliestScalarValue>-0098-01-08</dateEarliestScalarValue> <dateLatestMonth /> <dateNote /> <dateLatestScalarValue /> <dateLatestQualifierUnit /> <dateEarliestSingleDay /> <dateEarliestSingleMonth /> </publicationDate>On Wed, May 22, 2013 at 7:15 AM, Sébastien Brossard <Sebastien.Brossard@smk.dkmailto:Sebastien.Brossard@smk.dk> wrote:
Hi all,
I'm trying hard to save a BC date in the dateearliestscalarvalue of the structuredate component, without success.
Looking at PostgreSQL documentationhttp://www.postgresql.org/docs/9.1/static/datatype-datetime.html#DATATYPE-DATETIME-DATE-TABLE, I can see that the date input for a BC date has to follow this format:
"January 8, 99 BC"
But after saving my object, when I look at the related field in the database, I find this value:
"0099-01-08 00:00:00" - the reference to BC is lost.
Does somebody have an idea on this problem?
Thank you by advance.
Best regards,
Sébastien
Sébastien Brossard
IT-Udvikler
sebastien.brossard@smk.dkmailto:3sebastien.brossard@smk.dkT
Tmailto:3sebastien.brossard@smk.dkT +45 3374 8483tel:%2B45%203374%208483
Statens Museum for Kunst
Sølvgade 48-50
DK-1307 København K
T +45 3374 8494tel:%2B45%203374%208494
F +45 3374 8404tel:%2B45%203374%208404
smk.dkhttp://smk.dk/
[Logo_mail]
Talk mailing list
Talk@lists.collectionspace.orgmailto:Talk@lists.collectionspace.org
http://lists.collectionspace.org/mailman/listinfo/talk_lists.collectionspace.org