Skip to content

Commit a566f85

Browse files
rahulvudutalaMarkLogic Builder
authored andcommitted
DHFPROD-3581: Renaming properties to match ES naming conventions
1 parent 28bcdbb commit a566f85

File tree

6 files changed

+40
-40
lines changed

6 files changed

+40
-40
lines changed

marklogic-data-hub/src/main/resources/ml-modules/root/data-hub/5/data-services/entitySearch/getMatchingPropertyValues.api

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"functionName": "getMatchingPropertyValues",
33
"params": [
44
{
5-
"name": "entityIRI",
5+
"name": "entityTypeId",
66
"datatype": "string"
77
},
88
{

marklogic-data-hub/src/main/resources/ml-modules/root/data-hub/5/data-services/entitySearch/getMatchingPropertyValues.sjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const lib = require('/data-hub/5/impl/hub-es.sjs');
22

3-
var entityIRI;
3+
var entityTypeId;
44
var propertyPath;
55
var referenceType;
66
var pattern;
@@ -15,7 +15,7 @@ if(referenceType === 'element') {
1515
} else if(referenceType === 'collection') {
1616
query = cts.collectionReference();
1717
} else {
18-
let rangeIndexPath = lib.getPropertyRangePath(entityIRI, propertyPath);
18+
let rangeIndexPath = lib.getPropertyRangePath(entityTypeId, propertyPath);
1919
query = cts.pathReference(rangeIndexPath);
2020
}
2121

marklogic-data-hub/src/main/resources/ml-modules/root/data-hub/5/data-services/entitySearch/getMinAndMaxPropertyValues.api

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"functionName": "getNumericFacetsRange",
2+
"functionName": "getMinAndMaxPropertyValues",
33
"params": [
44
{
5-
"name": "entityIRI",
5+
"name": "entityTypeId",
66
"datatype": "string"
77
},
88
{

marklogic-data-hub/src/main/resources/ml-modules/root/data-hub/5/data-services/entitySearch/getMinAndMaxPropertyValues.sjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const lib = require('/data-hub/5/impl/hub-es.sjs');
22

3-
var entityIRI;
3+
var entityTypeId;
44
var propertyPath;
55
var referenceType;
66

@@ -12,13 +12,13 @@ let rangeValues = {
1212
};
1313

1414
if(!referenceType || referenceType === "") {
15-
referenceType = lib.getPropertyReferenceType(entityIRI, propertyPath);
15+
referenceType = lib.getPropertyReferenceType(entityTypeId, propertyPath);
1616
}
1717

1818
if(referenceType === 'element') {
1919
query = cts.elementReference(propertyPath);
2020
} else {
21-
let rangeIndexPath = lib.getPropertyRangePath(entityIRI, propertyPath);
21+
let rangeIndexPath = lib.getPropertyRangePath(entityTypeId, propertyPath);
2222
query = cts.pathReference(rangeIndexPath);
2323
}
2424

marklogic-data-hub/src/test/ml-modules/root/test/suites/data-hub/5/data-services/entitySearch/getMatchingPropertyValuesTest.sjs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
const test = require("/test/test-helper.xqy");
22

3-
function invokeService(entityIRI, propertyPath, referenceType, pattern, limit) {
3+
function invokeService(entityTypeId, propertyPath, referenceType, pattern, limit) {
44
return fn.head(xdmp.invoke(
55
"/data-hub/5/data-services/entitySearch/getMatchingPropertyValues.sjs",
66
{
7-
"entityIRI": entityIRI,
7+
"entityTypeId": entityTypeId,
88
"propertyPath": propertyPath,
99
"referenceType": referenceType,
1010
"pattern": pattern,
@@ -15,9 +15,9 @@ function invokeService(entityIRI, propertyPath, referenceType, pattern, limit) {
1515

1616
// Uncomment the tests when DHFPROD-4494 bug is resolved.
1717
/*function testMatchingValuesStartingWithPattern() {
18-
let entityIRI = "http://marklogic.com/EntitiesSearchEntity-0.0.1/EntitiesSearchEntity";
18+
let entityTypeId = "http://marklogic.com/EntitiesSearchEntity-0.0.1/EntitiesSearchEntity";
1919
let propertyPath = "numStrEntityProp/strCityProp";
20-
const result = invokeService(entityIRI, propertyPath, "path", "doc2", 10);
20+
const result = invokeService(entityTypeId, propertyPath, "path", "doc2", 10);
2121
return [
2222
test.assertEqual(2, result.length),
2323
test.assertTrue(result.includes("doc2City1Prop")),
@@ -26,9 +26,9 @@ function invokeService(entityIRI, propertyPath, referenceType, pattern, limit) {
2626
}
2727
2828
function testMatchingValuesWithPatternInBetween() {
29-
let entityIRI = "http://marklogic.com/EntitiesSearchEntity-0.0.1/EntitiesSearchEntity";
29+
let entityTypeId = "http://marklogic.com/EntitiesSearchEntity-0.0.1/EntitiesSearchEntity";
3030
let propertyPath = "numStrEntityProp/strCityProp";
31-
const result = invokeService(entityIRI, propertyPath, "path", "city", 10);
31+
const result = invokeService(entityTypeId, propertyPath, "path", "city", 10);
3232
return [
3333
test.assertEqual(4, result.length),
3434
test.assertTrue(result.includes("doc2City1Prop")),
@@ -39,9 +39,9 @@ function testMatchingValuesWithPatternInBetween() {
3939
}
4040
4141
function testMatchingValuesOnRangePathOneLevelNesting() {
42-
let entityIRI = "http://marklogic.com/EntitiesSearchEntity-0.0.1/EntitiesSearchEntity";
42+
let entityTypeId = "http://marklogic.com/EntitiesSearchEntity-0.0.1/EntitiesSearchEntity";
4343
let propertyPath = "numStrEntityProp/strCityProp";
44-
const result = invokeService(entityIRI, propertyPath, "path", "city", 10);
44+
const result = invokeService(entityTypeId, propertyPath, "path", "city", 10);
4545
return [
4646
test.assertEqual(4, result.length),
4747
test.assertTrue(result.includes("doc2City1Prop")),
@@ -52,9 +52,9 @@ function testMatchingValuesOnRangePathOneLevelNesting() {
5252
}
5353
5454
function testMatchingValuesOnRangePathNoNesting() {
55-
let entityIRI = "http://marklogic.com/EntitiesSearchEntity-0.0.1/EntitiesSearchEntity";
55+
let entityTypeId = "http://marklogic.com/EntitiesSearchEntity-0.0.1/EntitiesSearchEntity";
5656
let propertyPath = "srchEntyProp2";
57-
const result = invokeService(entityIRI, propertyPath, "path", "city", 10);
57+
const result = invokeService(entityTypeId, propertyPath, "path", "city", 10);
5858
return [
5959
test.assertEqual(2, result.length),
6060
test.assertTrue(result.includes("doc1SrchEntyProp2")),
@@ -63,18 +63,18 @@ function testMatchingValuesOnRangePathNoNesting() {
6363
}
6464
6565
function testMatchingValuesWithLimit() {
66-
let entityIRI = "http://marklogic.com/EntitiesSearchEntity-0.0.1/EntitiesSearchEntity";
66+
let entityTypeId = "http://marklogic.com/EntitiesSearchEntity-0.0.1/EntitiesSearchEntity";
6767
let propertyPath = "numStrEntityProp/strCityProp";
68-
const result = invokeService(entityIRI, propertyPath, "path", "city", 3);
68+
const result = invokeService(entityTypeId, propertyPath, "path", "city", 3);
6969
return [
7070
test.assertEqual(3, result.length)
7171
];
7272
}*/
7373

7474
function testMatchingValuesOnRangeElementIndexes() {
75-
let entityIRI = "http://marklogic.com/EntitiesSearchEntity-0.0.1/EntitiesSearchEntity";
75+
let entityTypeId = "http://marklogic.com/EntitiesSearchEntity-0.0.1/EntitiesSearchEntity";
7676
let propertyPath = "strNameProp";
77-
const result = invokeService(entityIRI, propertyPath, "element", "name", 10);
77+
const result = invokeService(entityTypeId, propertyPath, "element", "name", 10);
7878
return [
7979
test.assertEqual(4, result.length),
8080
test.assertTrue(result.includes("doc2Name1Prop")),
@@ -85,9 +85,9 @@ function testMatchingValuesOnRangeElementIndexes() {
8585
}
8686

8787
function testMatchingValuesOnRangeFieldIndexes() {
88-
let entityIRI = "http://marklogic.com/EntitiesSearchEntity-0.0.1/EntitiesSearchEntity";
88+
let entityTypeId = "http://marklogic.com/EntitiesSearchEntity-0.0.1/EntitiesSearchEntity";
8989
let propertyPath = "datahubCreatedInFlow";
90-
const result = invokeService(entityIRI, propertyPath, "field", "flow", 10);
90+
const result = invokeService(entityTypeId, propertyPath, "field", "flow", 10);
9191
return [
9292
test.assertEqual(2, result.length),
9393
test.assertTrue(result.includes("my-flow-1")),
@@ -96,9 +96,9 @@ function testMatchingValuesOnRangeFieldIndexes() {
9696
}
9797

9898
function testMatchingValuesOnCollectionNames() {
99-
let entityIRI = "";
99+
let entityTypeId = "";
100100
let propertyPath = "";
101-
const result = invokeService(entityIRI, propertyPath,"collection", "doc", 10);
101+
const result = invokeService(entityTypeId, propertyPath,"collection", "doc", 10);
102102
return [
103103
test.assertEqual(2, result.length),
104104
test.assertTrue(result.includes("doc1")),

marklogic-data-hub/src/test/ml-modules/root/test/suites/data-hub/5/data-services/entitySearch/getMinAndMaxPropertyValuesTest.sjs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
const test = require("/test/test-helper.xqy");
22

3-
function invokeService(entityIRI, propertyPath, referenceType) {
3+
function invokeService(entityTypeId, propertyPath, referenceType) {
44
return fn.head(xdmp.invoke(
55
"/data-hub/5/data-services/entitySearch/getMinAndMaxPropertyValues.sjs",
66
{
7-
"entityIRI": entityIRI,
7+
"entityTypeId": entityTypeId,
88
"propertyPath": propertyPath,
99
"referenceType": referenceType
1010
}
@@ -13,59 +13,59 @@ function invokeService(entityIRI, propertyPath, referenceType) {
1313

1414
// Uncomment the tests when DHFPROD-4494 bug is resolved.
1515
/*function testMinMaxTwoLevelNesting() {
16-
let entityIRI = "http://marklogic.com/EntitiesSearchEntity-0.0.1/EntitiesSearchEntity";
16+
let entityTypeId = "http://marklogic.com/EntitiesSearchEntity-0.0.1/EntitiesSearchEntity";
1717
let propertyPath = "numStrEntityProp/numEntProp/intProp";
18-
const result = invokeService(entityIRI, propertyPath, "path");
18+
const result = invokeService(entityTypeId, propertyPath, "path");
1919
return [
2020
test.assertEqual(11, result.min),
2121
test.assertEqual(77, result.max)
2222
];
2323
}
2424
2525
function testMinMaxOneLevelNesting() {
26-
let entityIRI = "http://marklogic.com/EntitiesSearchEntity-0.0.1/EntitiesSearchEntity";
26+
let entityTypeId = "http://marklogic.com/EntitiesSearchEntity-0.0.1/EntitiesSearchEntity";
2727
let propertyPath = "numStrEntityProp/intProp";
28-
const result = invokeService(entityIRI, propertyPath, "path");
28+
const result = invokeService(entityTypeId, propertyPath, "path");
2929
return [
3030
test.assertEqual(1, result.min),
3131
test.assertEqual(2, result.max)
3232
];
3333
}
3434
3535
function testMinMaxLongProperty() {
36-
let entityIRI = "http://marklogic.com/EntitiesSearchEntity-0.0.1/EntitiesSearchEntity";
36+
let entityTypeId = "http://marklogic.com/EntitiesSearchEntity-0.0.1/EntitiesSearchEntity";
3737
let propertyPath = "numStrEntityProp/numEntProp/longProp";
38-
const result = invokeService(entityIRI, propertyPath, "path");
38+
const result = invokeService(entityTypeId, propertyPath, "path");
3939
return [
4040
test.assertEqual(110, result.min),
4141
test.assertEqual(757, result.max)
4242
];
4343
}*/
4444

4545
function testMinMaxDecimalProperty() {
46-
let entityIRI = "http://marklogic.com/EntitiesSearchEntity-0.0.1/EntitiesSearchEntity";
46+
let entityTypeId = "http://marklogic.com/EntitiesSearchEntity-0.0.1/EntitiesSearchEntity";
4747
let propertyPath = "decimalProp";
48-
const result = invokeService(entityIRI, propertyPath, "element");
48+
const result = invokeService(entityTypeId, propertyPath, "element");
4949
return [
5050
test.assertEqual(1000.5, result.min),
5151
test.assertEqual(7557.5, result.max)
5252
];
5353
}
5454

5555
function testMinMaxDoubleProperty() {
56-
let entityIRI = "http://marklogic.com/EntitiesSearchEntity-0.0.1/EntitiesSearchEntity";
56+
let entityTypeId = "http://marklogic.com/EntitiesSearchEntity-0.0.1/EntitiesSearchEntity";
5757
let propertyPath = "doubleProp";
58-
const result = invokeService(entityIRI, propertyPath, "element");
58+
const result = invokeService(entityTypeId, propertyPath, "element");
5959
return [
6060
test.assertEqual(100000.0, result.min),
6161
test.assertEqual(755577.0, result.max)
6262
];
6363
}
6464

6565
function testMinMaxFloatProperty() {
66-
let entityIRI = "http://marklogic.com/EntitiesSearchEntity-0.0.1/EntitiesSearchEntity";
66+
let entityTypeId = "http://marklogic.com/EntitiesSearchEntity-0.0.1/EntitiesSearchEntity";
6767
let propertyPath = "floatProp";
68-
const result = invokeService(entityIRI, propertyPath, "element");
68+
const result = invokeService(entityTypeId, propertyPath, "element");
6969
return [
7070
test.assertEqual(10000.0, result.min),
7171
test.assertEqual(75577.0, result.max)

0 commit comments

Comments
 (0)