AKSW / OntoWiki

Semantic data wiki as well as Linked Data publishing engine
https://ontowiki.net
204 stars 51 forks source link

Improper import of xmlschema:gYear property #220

Closed frodeseverin closed 10 years ago

frodeseverin commented 11 years ago

I am on OntoWiki with Virtuoso backend (virtuoso 6.1).

I use xmlshema:date and xmlschema:gYear to represent birth dates and death dates. gYear is used in cases where only the gregorian year is known. However gYear seems to be improperly imported into the database when I use 'Add data to knowledgebase'.

Upon import OntoWiki adds '-01-01T00:00:00+02:00' to the gregorian year, althoug this is not mentioned in the Turtle data source.

In my .ttl files the property is coded such:

<http://data.bbib.no/BFO/sofie_bull_oevrevik> a schema:Person ;
    schema:birthDate "1902"^^<http://www.w3.org/2001/XMLSchema#gYear> ;
    schema:deathDate "2001"^^<http://www.w3.org/2001/XMLSchema#gYear> ;

The information is stored such after import:

ns2:sofie_bull_oevrevik ns1:altName "Øvrevik, Sofie Bull Grieg" ;
                        schema:birthDate "1902-01-01T00:00:00+02:00"^^xsd:gYear ;
                        schema:deathDate "2001-01-01T00:00:00+02:00"^^xsd:gYear ;

Contrast this with the information for H.C. Andersen:

Source

<http://data.bbib.no/BFO/h_c_andersen> a schema:Person ;
    schema:birthDate "1805-04-02"^^<http://www.w3.org/2001/XMLSchema#date> ;
    schema:deathDate "1875-08-04"^^<http://www.w3.org/2001/XMLSchema#date> ;

Imported

ns2:h_c_andersen ns1:altName "Andersen, Hans Christian" ;
                 schema:birthDate "1805-04-02"^^xsd:date ;
                 schema:deathDate "1875-08-04"^^xsd:date ;
white-gecko commented 11 years ago

I can also reproduce this problem

white-gecko commented 11 years ago

According to http://www.w3.org/TR/xmlschema-2/#gYear “gYear represents a gregorian calendar year. … e.g. lexical 1999 to represent the whole year 1999 …” so it shouldn't be replaced by just one day of the year

frodeseverin commented 11 years ago

Thanks for clarifying. This is exactly what I ment to say.

My post was a little dull on that point, and also a little bloated with details.

white-gecko commented 11 years ago

maybe someone can find out if this is a virtuoso issue or an ontowiki issue. Either by testing it with MySQL back-end or by loading such data directly to virtuoso.

knudmoeller commented 10 years ago

Just stumbled over this thread (while looking for the cause of a similar problem querying DBpedia): the problem seems to be directly Virtuoso-related. See this mail: https://www.mail-archive.com/virtuoso-users@lists.sourceforge.net/msg04612.html

white-gecko commented 10 years ago

This is a virtuoso issue (so I will close it here). I've checked this by directly importing gYear data into virtuoso and exporting it afterwards. I could see the same behavior as described by @frodeseverin .

As a workaround I'm also reading the datatype to implement an exception in the site-extensions date helper: https://github.com/AKSW/site.ontowiki/blob/develop/helpers/Date.php