Skip to content

Commit

Permalink
Only force the first term on a tertiary fact type to not be an attribute
Browse files Browse the repository at this point in the history
Change-type: patch
  • Loading branch information
otaviojacobi committed Dec 3, 2024
1 parent a157902 commit 4b780c8
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lf-to-abstract-sql-prep.ometajs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4b780c8

Please sign in to comment.