From 4b780c84daa5798ed38f41076fb81dabc202cf36 Mon Sep 17 00:00:00 2001 From: Otavio Jacobi Date: Tue, 3 Dec 2024 09:12:22 -0300 Subject: [PATCH] Only force the first term on a tertiary fact type to not be an attribute Change-type: patch --- lf-to-abstract-sql-prep.ometajs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lf-to-abstract-sql-prep.ometajs b/lf-to-abstract-sql-prep.ometajs index 0e6279d..a71894b 100644 --- a/lf-to-abstract-sql-prep.ometajs +++ b/lf-to-abstract-sql-prep.ometajs @@ -201,13 +201,11 @@ LF2AbstractSQLPrep.defaultAttributes = function(termOrFactType, attrsFound, attr this.primitives[actualFactType[1]] = false; } // Tertiary or higher fact type else if(actualFactType.length > 4) { - // The terms in a tertiary or higher fact type cannot become attributes. - for(var i = 1;i < actualFactType.length; i+=2) { - if(!this.attributes.hasOwnProperty(actualFactType[i]) || this.attributes[actualFactType[i]] !== false) { - this.SetHelped(); - } - this.attributes[actualFactType[i]] = false; + // The first term in a tertiary or higher fact type cannot become an attribute. + if(!this.attributes.hasOwnProperty(actualFactType[1]) || this.attributes[actualFactType[1]] !== false) { + this.SetHelped(); } + this.attributes[actualFactType[1]] = false; } } break;