diff --git a/src/main/java/cz/cvut/kbss/termit/persistence/dao/VocabularyDao.java b/src/main/java/cz/cvut/kbss/termit/persistence/dao/VocabularyDao.java index dab8b0619..1e78b17d8 100644 --- a/src/main/java/cz/cvut/kbss/termit/persistence/dao/VocabularyDao.java +++ b/src/main/java/cz/cvut/kbss/termit/persistence/dao/VocabularyDao.java @@ -428,9 +428,7 @@ private TypedQuery createDetailedContentChangesQuery(Vocab BIND(CONCAT(?firstName, " ", ?lastName) as ?authorFullName) OPTIONAL { ?record ?hasChangedAttribute ?attribute . - OPTIONAL { - ?attribute ?hasRdfsLabel ?changedAttributeName . - } + ?attribute ?hasRdfsLabel ?changedAttributeName . } OPTIONAL { ?term ?inVocabulary ?vocabulary ; @@ -442,10 +440,10 @@ private TypedQuery createDetailedContentChangesQuery(Vocab } BIND(?termName as ?termNameVal) BIND(?authorName as ?authorNameVal) - BIND(?changedAttributeName as ?changedAttributeNameVal) - FILTER (!BOUND(?termNameVal) || CONTAINS(LCASE(?label), LCASE(?termName))) - FILTER (!BOUND(?authorNameVal) || CONTAINS(LCASE(?authorFullName), LCASE(?authorName))) - FILTER (!BOUND(?changedAttributeName) || !BOUND(?changedAttributeNameVal) || CONTAINS(LCASE(?changedAttributeName), LCASE(?attributeName))) + BIND(?attributeName as ?changedAttributeNameVal) + FILTER (!BOUND(?termNameVal) || CONTAINS(LCASE(?label), LCASE(?termNameVal))) + FILTER (!BOUND(?authorNameVal) || CONTAINS(LCASE(?authorFullName), LCASE(?authorNameVal))) + FILTER (!BOUND(?changedAttributeName) || !BOUND(?changedAttributeNameVal) || CONTAINS(LCASE(?changedAttributeName), LCASE(?changedAttributeName))) } ORDER BY DESC(?timestamp) ?attribute """, AbstractChangeRecord.class) .setParameter("changeContext", changeTrackingContextResolver.resolveChangeTrackingContext(vocabulary))