virtuoso-opensource icon indicating copy to clipboard operation
virtuoso-opensource copied to clipboard

Issue with updating quadruples in Virtuoso quad store when changing object from `xsd:gYearMonth` to `xsd:date`

Open arcangelo7 opened this issue 1 year ago • 3 comments

There appears to be a bug in Virtuoso quad store when attempting to update a quadruple where the object is a literal of type xsd:gYearMonth and the new object is a literal of type xsd:date with the same year and month, but adding the day as "01". The issue does not occur when the new literal is of a completely different date or when the day is set to any other value, such as "02".

Steps to Reproduce

  1. Insert a quadruple with a xsd:gYearMonth literal object. For example:
INSERT DATA {
  GRAPH <https://w3id.org/oc/meta/br/09110435/graph> { 
    <https://w3id.org/oc/meta/br/09110435> 
    <http://prismstandard.org/namespaces/basic/2.0/publicationDate> 
    "2024-10"^^<http://www.w3.org/2001/XMLSchema#gYearMonth> . 
  }
}
  1. Try to update the quadruple by deleting the previous one and inserting a new one with a xsd:date literal where the day is set to "01":
DELETE { 
  GRAPH <https://w3id.org/oc/meta/br/09110435/graph> { 
    <https://w3id.org/oc/meta/br/09110435> 
    <http://prismstandard.org/namespaces/basic/2.0/publicationDate> 
    "2024-10"^^<http://www.w3.org/2001/XMLSchema#gYearMonth> . 
  } 
};
INSERT { 
  GRAPH <https://w3id.org/oc/meta/br/09110435/graph> { 
    <https://w3id.org/oc/meta/br/09110435> 
    <http://prismstandard.org/namespaces/basic/2.0/publicationDate> 
    "2024-10-01"^^<http://www.w3.org/2001/XMLSchema#date> . 
  } 
};

Expected Behavior:

  • The quadruple with the gYearMonth literal should be deleted.
  • The new quadruple with the date literal should be inserted.

Actual Behavior:

  • No changes are made to the quad store.
  • The original quadruple remains unchanged, and the new quadruple is not inserted.

Additional Information:

  • If the new literal is a date with a day other than "01" (e.g., "2024-10-02"), the update works as expected.
  • The issue appears to specifically affect the transition from gYearMonth to date when the day is set to "01".

Environment:

  • virtuoso-opensource version 07.20.3240 on Linux (x86_64-ubuntu_focal-linux-gnu) Single Server Edition (480 GB total memory, 238 MB memory in use)

arcangelo7 avatar Oct 21 '24 22:10 arcangelo7

Your test case works for me following the steps provided, with the Virtuoso open source Version 07.20.3240-pthreads for Linux as of Jul 3 2024 (a4349d4df) build I have, with the following triple added to the database:

s	p	o
https://w3id.org/oc/meta/br/09110435	http://prismstandard.org/namespaces/basic/2.0/publicationDate	
2024-10-01

What additional data might exist in the database as mine is pretty much an empty database ?

Was your Virtuoso binary compiled by yourself ?

You might want to try with our prebuilt Linux binary available at:

https://github.com/openlink/virtuoso-opensource/releases/download/v7.2.13/virtuoso-opensource.x86_64-generic_glibc25-linux-gnu.tar.gz

HughWilliams avatar Oct 22 '24 21:10 HughWilliams

We have determined that this issue appears to be timezone related, as I can recreate with EDT timezone, whereas not with my default UTC timezone. We are looking into this...

HughWilliams avatar Oct 23 '24 15:10 HughWilliams

I closed this issue by mistake

pkleef avatar Nov 08 '24 14:11 pkleef