Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing feature in Haskell's Excel importer #1465

Open
stefjoosten opened this issue Feb 3, 2024 · 1 comment
Open

Missing feature in Haskell's Excel importer #1465

stefjoosten opened this issue Feb 3, 2024 · 1 comment

Comments

@stefjoosten
Copy link
Contributor

stefjoosten commented Feb 3, 2024

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
Copy link
Contributor Author

@hanjoosten, I added two files, Issue1465Test.adl and Issue1465Test.xlsx to the directory testing/Sentinel/Tests/Nosentinel, to ensure that these files can go into the regression test set once this issue is fixed.

stefjoosten added a commit that referenced this issue Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant