Skip to content

Commit 0c935d8

Browse files
authored
Merge pull request #46 from yngwi/master
Fix incorrect handling of other event participants in updates
2 parents a08a941 + e2b3367 commit 0c935d8

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</parent>
1010
<groupId>eu.nampi</groupId>
1111
<artifactId>backend</artifactId>
12-
<version>0.3.0</version>
12+
<version>0.3.1</version>
1313
<name>nampi-backend</name>
1414
<description>The NAMPI backend</description>
1515

src/main/java/eu/nampi/backend/repository/EventRepository.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -539,13 +539,13 @@ public void delete(UUID id) {
539539
Node varDatePredicate = NodeFactory.createVariable("datePredicate");
540540
Node varDateObject = NodeFactory.createVariable("dateObject");
541541
builder
542-
.addFilter(ef.in(
543-
varHasDatePredicate,
544-
Core.hasDate, Core.takesPlaceNotEarlierThan,
545-
Core.takesPlaceNotLaterThan, Core.takesPlaceOn))
546542
.addOptional(new WhereBuilder()
547543
.addWhere(VAR_MAIN, varHasDatePredicate, varDate)
548-
.addWhere(varDate, varDatePredicate, varDateObject))
544+
.addWhere(varDate, varDatePredicate, varDateObject)
545+
.addFilter(ef.in(
546+
varHasDatePredicate,
547+
Core.hasDate, Core.takesPlaceNotEarlierThan,
548+
Core.takesPlaceNotLaterThan, Core.takesPlaceOn)))
549549
.addDelete(VAR_MAIN, varHasDatePredicate, varDate)
550550
.addDelete(varDate, varDatePredicate, varDateObject);
551551
// Delete act
@@ -576,9 +576,9 @@ public InsertResult insert(Optional<UUID> optionalId, Lang lang, List<Resource>
576576
builder.validateType(Core.actor, participant.getObject());
577577
participant.getPredicate().ifPresentOrElse(predicate -> {
578578
builder.validateNotSubnode(Core.hasMainParticipant, predicate);
579-
builder.validateSubnode(Core.hasParticipant, predicate);
579+
builder.validateSubnode(Core.hasOtherParticipant, predicate);
580580
builder.addInsert(builder.root, predicate, participant.getObject());
581-
}, () -> builder.addInsert(builder.root, Core.hasParticipant, participant.getObject()));
581+
}, () -> builder.addInsert(builder.root, Core.hasOtherParticipant, participant.getObject()));
582582
});
583583
// Event aspects
584584
aspects.forEach(aspect -> {

src/main/java/eu/nampi/backend/vocabulary/Core.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ protected static final Property property(String local) {
4040
public static final Property hasLatitude = property("has_latitude");
4141
public static final Property hasLongitude = property("has_longitude");
4242
public static final Property hasMainParticipant = property("has_main_participant");
43+
public static final Property hasOtherParticipant = property("has_other_participant");
4344
public static final Property hasPart = property("has_part");
4445
public static final Property hasParticipant = property("has_participant");
4546
public static final Property hasSortingDate = property("has_sorting_date");

0 commit comments

Comments
 (0)