Skip to content

Commit d4767e7

Browse files
authored
Merge pull request #151 from rosette-api/ws-1693-permid-in-simple-response
WS-1693: Add PermID to Simple Response.
2 parents 00e1882 + 3a4f7d0 commit d4767e7

File tree

17 files changed

+84
-18
lines changed

17 files changed

+84
-18
lines changed

annotations/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<parent>
2020
<groupId>com.basistech.rosette</groupId>
2121
<artifactId>rosette-api-java-binding</artifactId>
22-
<version>1.13.101-SNAPSHOT</version>
22+
<version>1.13.103-SNAPSHOT</version>
2323
</parent>
2424
<artifactId>rosette-api-annotations</artifactId>
2525
<name>rosette-api-annotations</name>

api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<parent>
2020
<groupId>com.basistech.rosette</groupId>
2121
<artifactId>rosette-api-java-binding</artifactId>
22-
<version>1.13.101-SNAPSHOT</version>
22+
<version>1.13.103-SNAPSHOT</version>
2323
</parent>
2424
<artifactId>rosette-api</artifactId>
2525
<name>rosette-api</name>

api/src/test/java/com/basistech/rosette/api/RosetteAPITest.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014 Basis Technology Corp.
2+
* Copyright 2014-2019 Basis Technology Corp.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
2020
import com.basistech.rosette.api.common.AbstractRosetteAPI;
2121
import com.basistech.rosette.apimodel.CategoriesResponse;
2222
import com.basistech.rosette.apimodel.DocumentRequest;
23+
import com.basistech.rosette.apimodel.EntitiesOptions;
2324
import com.basistech.rosette.apimodel.EntitiesResponse;
2425
import com.basistech.rosette.apimodel.ErrorResponse;
2526
import com.basistech.rosette.apimodel.LanguageResponse;
@@ -280,6 +281,20 @@ public void testGetEntityLinked() throws IOException {
280281
}
281282
}
282283

284+
285+
@Test
286+
public void testGetEntityPermId() throws IOException {
287+
if (testFilename.endsWith("-entities_permid.json")) {
288+
DocumentRequest<EntitiesOptions> request = readValue(DocumentRequest.class);
289+
try {
290+
EntitiesResponse response = api.perform(AbstractRosetteAPI.ENTITIES_SERVICE_PATH, request, EntitiesResponse.class);
291+
verifyEntity(response);
292+
} catch (HttpRosetteAPIException e) {
293+
verifyException(e);
294+
}
295+
}
296+
}
297+
283298
@Test
284299
public void testIgnoredUnknownField() throws IOException {
285300
if ("unknown-field-entities.json".equals(testFilename)) {
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"content": "Toyota and Microsoft are large cap companies.",
3+
"language": "eng"
4+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"entities": [
3+
{
4+
"type": "ORGANIZATION",
5+
"mention": "Toyota",
6+
"normalized": "Toyota",
7+
"count": 1,
8+
"mentionOffsets": [
9+
{
10+
"startOffset": 0,
11+
"endOffset": 6
12+
}
13+
],
14+
"entityId": "Q53268",
15+
"linkingConfidence": 0.45885878,
16+
"permId": "4295876746"
17+
},
18+
{
19+
"type": "ORGANIZATION",
20+
"mention": "Microsoft",
21+
"normalized": "Microsoft",
22+
"count": 1,
23+
"mentionOffsets": [
24+
{
25+
"startOffset": 11,
26+
"endOffset": 20
27+
}
28+
],
29+
"entityId": "Q2283",
30+
"linkingConfidence": 0.76733641,
31+
"permId": "4295907168"
32+
}
33+
]
34+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
200

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
"mention": "Washington",
2121
"normalized": "Washington",
2222
"type": "LOCATION",
23-
"dbpediaType": "test1"
24-
23+
"dbpediaType": [
24+
"test1"
25+
]
2526
}
2627
]
2728
}

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717
"entityId": "Q1088831",
1818
"indocChainId": 2,
1919
"mention": "Washington",
20-
"dbpediaType": "test1"
20+
"dbpediaType": [
21+
"test1",
22+
"foo",
23+
"bar"
24+
]
2125
}
2226
]
23-
}
27+
}

common/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<parent>
2020
<groupId>com.basistech.rosette</groupId>
2121
<artifactId>rosette-api-java-binding</artifactId>
22-
<version>1.13.101-SNAPSHOT</version>
22+
<version>1.13.103-SNAPSHOT</version>
2323
</parent>
2424
<artifactId>rosette-api-common</artifactId>
2525
<name>rosette-api-common</name>

examples/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<groupId>com.basistech.rosette</groupId>
2222
<artifactId>rosette-api-java-binding</artifactId>
23-
<version>1.13.101-SNAPSHOT</version>
23+
<version>1.13.103-SNAPSHOT</version>
2424
</parent>
2525
<groupId>com.basistech.rosette</groupId>
2626
<artifactId>rosette-api-examples</artifactId>

0 commit comments

Comments
 (0)