Skip to content

Commit 2b082c2

Browse files
authored
Merge pull request #200 from rosette-api/RCB-613-release-java-binding
RCB-613: removing genre field
2 parents 7681a2b + 07c01ca commit 2b082c2

File tree

13 files changed

+4
-207
lines changed

13 files changed

+4
-207
lines changed

api/src/test/mock-data/response/eng-url-entities.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
"mention": "Washington",
2121
"normalized": "Washington",
2222
"type": "LOCATION",
23-
"dbpediaType": "test1",
2423
"dbpediaTypes": [
2524
"test1"
2625
]

json/src/main/java/com/basistech/rosette/apimodel/jackson/AdmRequestMixin.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ protected AdmRequestMixin(
3636
@JsonProperty("profileId") String profileId,
3737
@JsonProperty("text") AnnotatedText text,
3838
@JsonProperty("options") Options options,
39-
@Deprecated @JsonProperty("genre") String genre,
4039
@JsonProperty("language") LanguageCode language
4140
) {
4241
//

json/src/main/java/com/basistech/rosette/apimodel/jackson/ApiModelMixinModule.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.basistech.rosette.apimodel.jackson;
1818

19-
import com.basistech.rosette.apimodel.Address;
2019
import com.basistech.rosette.apimodel.AddressSimilarityRequest;
2120
import com.basistech.rosette.apimodel.AdmRequest;
2221
import com.basistech.rosette.apimodel.ConfigurationRequest;
@@ -38,7 +37,6 @@
3837
* Jackson module to configure Json serialization and deserialization for the
3938
* Rosette API model.
4039
*/
41-
@SuppressWarnings("deprecation")
4240
public class ApiModelMixinModule extends AnnotatedDataModelModule {
4341

4442
public ApiModelMixinModule() {
@@ -69,8 +67,7 @@ public void setupModule(Module.SetupContext context) {
6967
context.setMixInAnnotations(NameDeduplicationRequest.class, NameDeduplicationRequestMixin.class);
7068
context.setMixInAnnotations(NameDeduplicationRequest.NameDeduplicationRequestBuilder.class,
7169
NameDeduplicationRequestMixin.NameDeduplicationRequestBuilderMixin.class);
72-
context.setMixInAnnotations(Address.class, AddressMixin.class);
73-
context.setMixInAnnotations(Address.AddressBuilder.class, AddressMixin.AddressBuilderMixin.class);
70+
7471
context.setMixInAnnotations(FieldedAddress.class, FieldedAddressMixin.class);
7572
context.setMixInAnnotations(FieldedAddress.FieldedAddressBuilder.class,
7673
FieldedAddressMixin.FieldedAddressBuilderMixin.class);

json/src/main/java/com/basistech/rosette/apimodel/jackson/DocumentRequestMixin.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ protected DocumentRequestMixin(
4747
@JsonProperty("content") Object content,
4848
@JsonProperty("contentUri") String contentUri,
4949
@JsonProperty("contentType") String contentType,
50-
@Deprecated @JsonProperty("genre") String genre,
5150
@JsonProperty("options") Options options
5251
) {
5352
//

json/src/test/data/EntitiesResponse.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"salience": 1.0,
1616
"confidence": 1.0,
1717
"linkingConfidence": 1.0,
18-
"dbpediaType": "test1",
1918
"dbpediaTypes": [
2019
"test1",
2120
"test2"

json/src/test/java/com/basistech/rosette/apimodel/ModelTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ void packageTest(boolean inputStreams) throws ClassNotFoundException, IOExceptio
134134
o1 = DocumentRequest.builder()
135135
.profileId(r.getProfileId())
136136
.language(r.getLanguage())
137-
.genre(r.getGenre())
138137
.content(r.getContent())
139138
.contentUri(r.getContentUri())
140139
.options(r.getOptions())

json/src/test/java/com/basistech/rosette/apimodel/PolymorphicRequestTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@ void testRequestTypes() throws Exception {
4242
Request request = mapper.readValue(json, new TypeReference<DocumentRequest<EntitiesOptions>>() { });
4343
assertEquals(DOC_REQUEST, request.getClass().getName());
4444

45-
json = "{\"content\": \"what is my type\", \"language\": \"eng\", \"options\": {\"includeDBpediaType\": true, \"calculateConfidence\": true}}";
45+
json = "{\"content\": \"what is my type\", \"language\": \"eng\", \"options\": {\"includeDBpediaTypes\": true, \"calculateConfidence\": true}}";
4646
request = mapper.readValue(json, new TypeReference<DocumentRequest<EntitiesOptions>>() { });
4747
assertEquals(DOC_REQUEST, request.getClass().getName());
4848
assertNull(((DocumentRequest<EntitiesOptions>) request).getOptions().getIncludePermID());
4949

50-
json = "{\"content\": \"what is my type\", \"language\": \"eng\", \"options\": {\"includeDBpediaType\": true, \"calculateConfidence\": true, \"includePermID\": true}}";
50+
json = "{\"content\": \"what is my type\", \"language\": \"eng\", \"options\": {\"includeDBpediaTypes\": true, \"calculateConfidence\": true, \"includePermID\": true}}";
5151
request = mapper.readValue(json, new TypeReference<DocumentRequest<EntitiesOptions>>() { });
5252
assertEquals(DOC_REQUEST, request.getClass().getName());
5353
assertTrue(((DocumentRequest<EntitiesOptions>) request).getOptions().getIncludePermID());
5454

55-
json = "{\"content\": \"what is my type\", \"language\": \"eng\", \"options\": {\"includeDBpediaType\": true, \"calculateConfidence\": true, \"includePermID\": false}}";
55+
json = "{\"content\": \"what is my type\", \"language\": \"eng\", \"options\": {\"includeDBpediaTypes\": true, \"calculateConfidence\": true, \"includePermID\": false}}";
5656
request = mapper.readValue(json, new TypeReference<DocumentRequest<EntitiesOptions>>() { });
5757
assertEquals(DOC_REQUEST, request.getClass().getName());
5858
assertFalse(((DocumentRequest<EntitiesOptions>) request).getOptions().getIncludePermID());

model/src/main/java/com/basistech/rosette/apimodel/Address.java

Lines changed: 0 additions & 126 deletions
This file was deleted.

model/src/main/java/com/basistech/rosette/apimodel/AdmRequest.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -38,40 +38,20 @@ public final class AdmRequest<O extends Options> extends Request {
3838
*/
3939
private final O options;
4040

41-
/**
42-
* @return genre
43-
*/
44-
@Deprecated
45-
private final String genre;
46-
4741
/**
4842
* @return language
4943
*/
5044
private final LanguageCode language;
5145

5246

53-
public AdmRequest(String profileId,
54-
AnnotatedText text,
55-
O options,
56-
LanguageCode language) {
57-
super(profileId);
58-
this.text = text;
59-
this.options = options;
60-
this.genre = null;
61-
this.language = language;
62-
}
63-
64-
6547
@Builder // workaround for inheritance https://github.com/rzwitserloot/lombok/issues/853
6648
public AdmRequest(String profileId,
6749
AnnotatedText text,
6850
O options,
69-
@Deprecated String genre,
7051
LanguageCode language) {
7152
super(profileId);
7253
this.text = text;
7354
this.options = options;
74-
this.genre = genre;
7555
this.language = language;
7656
}
7757
}

model/src/main/java/com/basistech/rosette/apimodel/CategoriesOptions.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
import lombok.Builder;
2121
import lombok.Value;
2222

23-
import javax.validation.constraints.Min;
24-
2523
/**
2624
* Categorization options
2725
*/
@@ -30,15 +28,6 @@
3028
@JacksonMixin
3129
public class CategoriesOptions extends Options {
3230

33-
/**
34-
* @deprecated
35-
* Users should use {@link singleLabel} to return only one result
36-
* or {@link scoreThreshold} to filter results based on raw score
37-
* @return number of categories
38-
*/
39-
@Min(1)
40-
private final Integer numCategories;
41-
4231
/**
4332
* Single label mode will return only the highest scoring category, regardless of score
4433
* If singleLabel is false, every category whose score exceeds the default

0 commit comments

Comments
 (0)