Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/generator/AppendAttributeGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public boolean appendAttributeInsertStatementValid(TypeQLInsert insert) {
if (insert == null) return false;
if (!insert.toString().contains("isa " + appendConfiguration.getMatch().getType())) return false;
for (Configuration.Definition.Attribute ownershipThingGetter : appendConfiguration.getMatch().getOwnerships()) {
if (!insert.toString().contains(", has " + ownershipThingGetter.getAttribute())) return false;
if (!insert.toString().contains("has " + ownershipThingGetter.getAttribute())) return false;
}
if (appendConfiguration.getInsert().getRequiredOwnerships() != null) {
for (Configuration.Definition.Attribute attribute : appendConfiguration.getInsert().getRequiredOwnerships()) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/generator/RelationGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public TypeQLInsert generateMatchInsertStatement(String[] row) {
// ENTITY & RELATION PLAYER BY ATTRIBUTE(s)
if (playerType(player).equals("byAttribute")) {
ThingVariable.Thing playerMatchStatement = getThingPlayerMatchStatementByAttribute(row, player, playerVar);
if (playerMatchStatement.toString().contains(", has")) {
if (playerMatchStatement.constraints().stream().anyMatch(ThingConstraint::isHas)) {
playerMatchStatements.add(playerMatchStatement);
playerVars.add(playerVar);
roleTypes.add(player.getRole());
Expand Down Expand Up @@ -186,7 +186,7 @@ private ArrayList<ThingVariable<?>> recursiveAssemblyMatchStatement(String[] row
//terminating condition - byAttribute player:
ArrayList<ThingVariable<?>> statements = new ArrayList<>();
ThingVariable<?> statement = getThingPlayerMatchStatementByAttribute(row, player, playerVar);
if (statement != null && statement.toString().contains(", has")) {
if (statement != null && statement.constraints().stream().anyMatch(ThingConstraint::isHas)) {
statements.add(statement);
}
return statements;
Expand Down