Skip to content
This repository was archived by the owner on Jan 28, 2025. It is now read-only.
This repository was archived by the owner on Jan 28, 2025. It is now read-only.

[Bug] Corese sparql binds multiples NOW() value in one query #168

@MaillPierre

Description

@MaillPierre

Issue Description:

During one query, if NOW() is bound to a variable in the results, the variable will have as many values as the number of milliseconds taken to execute the query.

Steps to Reproduce:

  1. Create test_query.rq containg:
PREFIX pav: <http://purl.org/pav/>

CONSTRUCT {
    <> pav:lastUpdateOn ?date .
}
WHERE {
    ?s ?p ?o .
    BIND(NOW() AS ?date)
}
  1. Execute the following query, you can replace the target with any large enough file:
    java -jar corese-command-4.5.0.jar sparql -q test_query.rq -i https://raw.githubusercontent.com/Wimmics/IndeGx/main/catalogs/all_catalog_edited.ttl

  2. The result will look something like:

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix pav: <http://purl.org/pav/> .

<> pav:lastUpdateOn "2024-01-10T11:06:04.503+01:00"^^xsd:dateTime ;
  pav:lastUpdateOn "2024-01-10T11:06:04.504+01:00"^^xsd:dateTime ;
  pav:lastUpdateOn "2024-01-10T11:06:04.505+01:00"^^xsd:dateTime ;
  pav:lastUpdateOn "2024-01-10T11:06:04.506+01:00"^^xsd:dateTime ;
  pav:lastUpdateOn "2024-01-10T11:06:04.507+01:00"^^xsd:dateTime ;
  pav:lastUpdateOn "2024-01-10T11:06:04.508+01:00"^^xsd:dateTime ;
  pav:lastUpdateOn "2024-01-10T11:06:04.509+01:00"^^xsd:dateTime ;
  pav:lastUpdateOn "2024-01-10T11:06:04.510+01:00"^^xsd:dateTime .

Expected Behavior:
The result should contain only one binding for NOW(), either at the start of the execution or at the end, at the developer's discretion. This is the behavior expected by the SPARQL 1.1 standard

Note to Developers:

Correcting this bug could slightly speed up querying because this implies a lot of unnecessary calls to the NOW() function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions