Skip to content

Commit be88813

Browse files
authored
Merge pull request #54 from yngwi/master
Changed API property names to be more correct
2 parents 55f78be + c2b9916 commit be88813

File tree

12 files changed

+55
-55
lines changed

12 files changed

+55
-55
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.5.2</version>
12+
<version>0.5.3</version>
1313
<name>nampi-backend</name>
1414
<description>The NAMPI backend</description>
1515

src/main/java/eu/nampi/backend/queryBuilder/HydraCollectionBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public void build(BiFunction<Model, QuerySolution, RDFNode> rowToNode) {
9595
.add("pageIndex", Hydra.pageIndex, Optional.empty())
9696
.add("type", RDF.type, params.getType());
9797
if (includeTypeAndText) {
98-
this.mapper.add("text", Api.textVar, params.getText());
98+
this.mapper.add("text", Api.textProp, params.getText());
9999
}
100100
this.mapper.insertTemplate().insertView(totalItems);
101101
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,12 @@ public class ActRepository {
129129
public String findAll(QueryParameters params, Lang lang, Optional<Resource> author,
130130
Optional<Resource> source) {
131131
HydraCollectionBuilder builder =
132-
hydraBuilderFactory.collectionBuilder(ENDPOINT_NAME, Core.act, Api.actOrderByVar, params);
132+
hydraBuilderFactory.collectionBuilder(ENDPOINT_NAME, Core.act, Api.actOrderByProp, params);
133133
ExprFactory ef = builder.ef;
134134

135135
// Add author query
136136
builder.mapper
137-
.add("author", Api.actAuthorVar, author);
137+
.add("author", Api.actAuthorProp, author);
138138
author.ifPresent(res -> {
139139
builder.coreData
140140
.addWhere(VAR_MAIN, Core.isAuthoredBy, VAR_AUTHOR)
@@ -143,7 +143,7 @@ public String findAll(QueryParameters params, Lang lang, Optional<Resource> auth
143143

144144
// Add source query
145145
builder.mapper
146-
.add("source", Api.actSourceVar, source);
146+
.add("source", Api.actSourceProp, source);
147147
source.ifPresent(res -> {
148148
Path path = PathFactory.pathSeq(PathFactory.pathLink(Core.hasSourceLocation.asNode()),
149149
PathFactory.pathLink(Core.hasSource.asNode()));

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ public class AspectRepository {
8484
key = "{#lang, #params.limit, #params.offset, #params.orderByClauses, #params.type, #params.text, #participant}")
8585
public String findAll(QueryParameters params, Lang lang, Optional<Resource> participant) {
8686
HydraCollectionBuilder builder = hydraBuilderFactory.collectionBuilder(ENDPOINT_NAME,
87-
Core.aspect, Api.aspectOrderByVar, params, false);
87+
Core.aspect, Api.aspectOrderByProp, params, false);
8888
ExprFactory ef = builder.ef;
8989

9090
// Add participant query
91-
builder.mapper.add("participant", Api.aspectParticipantVar, participant);
91+
builder.mapper.add("participant", Api.aspectParticipantProp, participant);
9292
participant.ifPresent(resParticipant -> {
9393
Path path = PathFactory.pathSeq(PathFactory.pathLink(Core.aspectIsUsedIn.asNode()),
9494
PathFactory.pathLink(Core.hasParticipant.asNode()));

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public class AuthorRepository {
7373
key = "{#lang, #params.limit, #params.offset, #params.orderByClauses, #params.type, #params.text}")
7474
public String findAll(QueryParameters params, Lang lang) {
7575
HydraCollectionBuilder builder = hydraBuilderFactory.collectionBuilder(ENDPOINT_NAME,
76-
Core.author, Api.authorOrderByVar, params);
76+
Core.author, Api.authorOrderByProp, params);
7777
return builder.query(ROW_MAPPER, lang);
7878
}
7979

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ public String findAll(QueryParameters params, Lang lang, Optional<String> dates,
282282
Optional<Property> participationType, Optional<Resource> place, Optional<Resource> author,
283283
Optional<Resource> source) {
284284
HydraCollectionBuilder builder = hydraBuilderFactory.collectionBuilder(ENDPOINT_NAME,
285-
Core.event, Api.eventOrderByVar, params, false);
285+
Core.event, Api.eventOrderByProp, params, false);
286286
ExprFactory ef = builder.ef;
287287
boolean hasDateSort = params.getOrderByClauses().containsKey("date");
288288
Order order = params.getOrderByClauses().getOrderFor("date").orElse(Order.ASCENDING);
@@ -295,14 +295,14 @@ public String findAll(QueryParameters params, Lang lang, Optional<String> dates,
295295
.addFilter(ef.regex(varSearchString, params.getText().get(), "i"));
296296
});
297297
// Place data
298-
builder.mapper.add("place", Api.eventPlaceVar, place);
298+
builder.mapper.add("place", Api.eventPlaceProp, place);
299299
builder.extendedData
300300
.addOptional(VAR_MAIN, Core.hasText, VAR_TEXT);
301301
place.ifPresent(resPlace -> builder.coreData.addWhere(placeWhere(false))
302302
.addFilter(ef.sameTerm(VAR_PLACE, resPlace)));
303303
// Participant data
304304
AtomicBoolean useParticipantWhere = new AtomicBoolean(false);
305-
builder.mapper.add("participant", Api.eventParticipantVar, participant);
305+
builder.mapper.add("participant", Api.eventParticipantProp, participant);
306306
participant.ifPresent(resParticipant -> {
307307
if (!useParticipantWhere.get()) {
308308
builder.coreData.addWhere(participantWhere(false));
@@ -311,7 +311,7 @@ public String findAll(QueryParameters params, Lang lang, Optional<String> dates,
311311
useParticipantWhere.set(true);
312312
});
313313
// Participant type data
314-
builder.mapper.add("participantType", Api.eventParticipantTypeVar, participantType);
314+
builder.mapper.add("participantType", Api.eventParticipantTypeProp, participantType);
315315
participantType.ifPresent(resType -> {
316316
if (!useParticipantWhere.get()) {
317317
builder.coreData.addWhere(participantWhere(false));
@@ -320,13 +320,13 @@ public String findAll(QueryParameters params, Lang lang, Optional<String> dates,
320320
useParticipantWhere.set(true);
321321
});
322322
// Participation type data
323-
builder.mapper.add("participationType", Api.eventParticipationTypeVar, participationType);
323+
builder.mapper.add("participationType", Api.eventParticipationTypeProp, participationType);
324324
participationType
325325
.ifPresent(resType -> builder.coreData.addWhere(VAR_MAIN, resType, VAR_PARTICIPANT));
326326

327327
AtomicBoolean useAspectWhere = new AtomicBoolean(false);
328328
// Aspect data
329-
builder.mapper.add("aspect", Api.eventAspectVar, aspect);
329+
builder.mapper.add("aspect", Api.eventAspectProp, aspect);
330330
aspect.ifPresent(resAspect -> {
331331
if (!useAspectWhere.get()) {
332332
builder.coreData.addWhere(aspectWhere(false));
@@ -335,7 +335,7 @@ public String findAll(QueryParameters params, Lang lang, Optional<String> dates,
335335
useAspectWhere.set(true);
336336
});
337337
// Aspect type data
338-
builder.mapper.add("aspectType", Api.eventAspectTypeVar, aspectType);
338+
builder.mapper.add("aspectType", Api.eventAspectTypeProp, aspectType);
339339
aspectType.ifPresent(resType -> {
340340
if (!useAspectWhere.get()) {
341341
builder.coreData.addWhere(aspectWhere(false));
@@ -344,21 +344,21 @@ public String findAll(QueryParameters params, Lang lang, Optional<String> dates,
344344
useAspectWhere.set(true);
345345
});
346346
// Aspect use type data
347-
builder.mapper.add("aspectUseType", Api.eventAspectUseTypeVar, aspectUseType);
347+
builder.mapper.add("aspectUseType", Api.eventAspectUseTypeProp, aspectUseType);
348348
aspectUseType.ifPresent(resType -> builder.coreData.addWhere(VAR_MAIN, resType, VAR_ASPECT));
349349
// Author data
350-
builder.mapper.add("author", Api.eventAuthorVar, author);
350+
builder.mapper.add("author", Api.eventAuthorProp, author);
351351
author.ifPresent(resAuthor -> builder.coreData.addWhere(actWhere(false))
352352
.addFilter(ef.sameTerm(VAR_AUTHOR, resAuthor)));
353353
// Source data
354-
builder.mapper.add("source", Api.eventSourceVar, source);
354+
builder.mapper.add("source", Api.eventSourceProp, source);
355355
source.ifPresent(resSource -> builder.coreData.addWhere(actWhere(false))
356356
.addFilter(ef.sameTerm(VAR_SOURCE, resSource)));
357357
// Dates data
358358
if (hasDateSort || dates.isPresent()) {
359359
builder.coreData.addWhere(datesWhere(order, VAR_DATE_REAL_SORT, VAR_DATE));
360360
}
361-
builder.mapper.add("dates", Api.eventDatesVar, dates);
361+
builder.mapper.add("dates", Api.eventDatesProp, dates);
362362
dates.ifPresent(datesString -> {
363363
DateRange dateRange = CONVERTER.convert(datesString);
364364
Optional<Expr> start =

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public class GroupRepository {
110110
public String findAll(QueryParameters params, Lang lang, Optional<Resource> partOf,
111111
Optional<Resource> hasPart) {
112112
HydraCollectionBuilder builder = hydraBuilderFactory.collectionBuilder(ENDPOINT_NAME,
113-
Core.group, Api.groupOrderByVar, params, false);
113+
Core.group, Api.groupOrderByProp, params, false);
114114
ExprFactory ef = builder.ef;
115115
builder.extendedData
116116
.addOptional(VAR_MAIN, Core.hasText, VAR_TEXT)
@@ -124,13 +124,13 @@ public String findAll(QueryParameters params, Lang lang, Optional<Resource> part
124124
.addFilter(ef.regex(varSearchString, params.getText().get(), "i"));
125125
});
126126
// Part of
127-
builder.mapper.add("partOf", Api.groupPartOfVar, partOf);
127+
builder.mapper.add("partOf", Api.groupPartOfProp, partOf);
128128
partOf.ifPresent(partOfType -> builder.coreData
129129
.addWhere(VAR_MAIN, Core.isPartOf, VAR_PART_OF)
130130
.addFilter(ef.sameTerm(VAR_PART_OF, partOfType))
131131
.addWhere(VAR_PART_OF, RDFS.label, VAR_PART_OF_LABEL));
132132
// Has part
133-
builder.mapper.add("hasPart", Api.groupHasPartVar, hasPart);
133+
builder.mapper.add("hasPart", Api.groupHasPartProp, hasPart);
134134
hasPart.ifPresent(hasPartType -> builder.coreData
135135
.addWhere(VAR_MAIN, Core.hasPart, VAR_HAS_PART)
136136
.addFilter(ef.sameTerm(VAR_HAS_PART, hasPartType))

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ private static final void addEvent(Model model, QuerySolution row, Resource main
129129
key = "{#lang, #params.limit, #params.offset, #params.orderByClauses, #params.type, #params.text, #aspect}")
130130
public String findAll(QueryParameters params, Lang lang, Optional<Resource> aspect) {
131131
HydraCollectionBuilder builder = hydraBuilderFactory.collectionBuilder(ENDPOINT_NAME,
132-
Core.person, Api.personOrderByVar, params, false);
132+
Core.person, Api.personOrderByProp, params, false);
133133
ExprFactory ef = builder.ef;
134134
// Add custom text select
135135
params.getText().ifPresent(text -> {
@@ -140,7 +140,7 @@ public String findAll(QueryParameters params, Lang lang, Optional<Resource> aspe
140140
.addFilter(ef.regex(varSearchString, params.getText().get(), "i"));
141141
});
142142
// Add aspect query
143-
builder.mapper.add("aspect", Api.personAspectVar, aspect);
143+
builder.mapper.add("aspect", Api.personAspectProp, aspect);
144144
aspect.ifPresent(resAspect -> {
145145
Path path = PathFactory.pathSeq(PathFactory.pathLink(Core.isMainParticipantIn.asNode()),
146146
PathFactory.pathLink(Core.usesAspect.asNode()));

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public class PlaceRepository {
8989
key = "{#lang, #params.limit, #params.offset, #params.orderByClauses, #params.type, #params.text}")
9090
public String findAll(QueryParameters params, Lang lang) {
9191
HydraCollectionBuilder builder = hydraBuilderFactory.collectionBuilder(ENDPOINT_NAME,
92-
Core.place, Api.placeOrderByVar, params, false);
92+
Core.place, Api.placeOrderByProp, params, false);
9393
ExprFactory ef = builder.ef;
9494
builder.extendedData
9595
.addOptional(VAR_MAIN, Core.hasText, VAR_TEXT)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public class SourceRepository {
7979
key = "{#lang, #params.limit, #params.offset, #params.orderByClauses, #params.type, #params.text}")
8080
public String findAll(QueryParameters params, Lang lang) {
8181
HydraCollectionBuilder builder = hydraBuilderFactory.collectionBuilder(ENDPOINT_NAME,
82-
Core.source, Api.sourceOrderByVar, params, false);
82+
Core.source, Api.sourceOrderByProp, params, false);
8383
ExprFactory ef = builder.ef;
8484

8585
// Add custom text select

0 commit comments

Comments
 (0)