11const 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
2828function 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
4141function 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
5454function 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
6565function 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
7474function 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
8787function 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
9898function 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" ) ) ,
0 commit comments