Ampersand icon indicating copy to clipboard operation
Ampersand copied to clipboard

Missing feature in Haskell's Excel importer

Open stefjoosten opened this issue 1 year ago • 1 comments

What happened

Ampersand-v5.0.0 [feature/labels-in-ADL-files:662580d51] produces no compile-time errors nor warnings when compiling this script:

CONTEXT Issue1465Test IN DUTCH

CLASSIFY Auto ISA Voertuig
RELATION eigenaar [Voertuig * Persoon] [UNI,TOT]
RELATION aantalWielen [ Auto * Getal]  [UNI,TOT]

REPRESENT Getal TYPE INTEGER

POPULATION eigenaar CONTAINS
  [ ("wagen1", "Piet") ,
    ("boot2", "marie") ]
POPULATION aantalWielen CONTAINS
  [ ("wagen1", 3)  ]
ENDCONTEXT

However, when I compile this:

CONTEXT Issue1465Test IN DUTCH
INCLUDE "Issue1465Test.xlsx"
CLASSIFY Auto ISA Voertuig
RELATION eigenaar [Voertuig * Persoon] [UNI,TOT]
RELATION aantalWielen [ Auto * Getal]  [UNI,TOT]

REPRESENT Getal TYPE INTEGER
ENDCONTEXT

with this spreadsheet: afbeelding I get the following error:

PropertyRule for TOT_aantalWielen[Auto*Getal] which is defined at /Users/sjo00577/git/Ampersand/testing/Sentinel/Tests/NoSentinel/Issue1465Test.adl:5:1 error:
  There is a violation of RULE TOT_5610962804479243845:
    ("wagen1", "wagen1")
ExitFailure 10

What I expected

I expected this to work because the population in the spreadsheet is identical to the population in the first script.

Version of Ampersand that was used

Steps to reproduce

  1. Compile both scripts with "ampersand check"
  2. Notice that the first is correct and the second produces a violation of the totality.

Workaround

I found a workaround. When the concepts Auto and Voertuig are each given a separate sheet in Excel, the thing behaves correctly. However, I don't want to be forced to use this workaround. I want the obvious thing to work correctly too.

stefjoosten avatar Feb 03 '24 15:02 stefjoosten