Skip to content

Commit a59309a

Browse files
ryanjdewMarkLogic Builder
authored andcommitted
DHFPROD-4428: Handle non-string typesin XML entities
1 parent 27e9fb6 commit a59309a

File tree

8 files changed

+14
-11
lines changed

8 files changed

+14
-11
lines changed

marklogic-data-hub/src/main/resources/ml-modules/root/com.marklogic.smart-mastering/matcher-impl/helper-impl.xqy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ declare function helper-impl:property-name-to-query($options as element(), $full
8484
function($val, $weight) {
8585
$scope-query(cts:element-value-query(
8686
$qname,
87-
$val,
87+
$val ! fn:string(.),
8888
("case-insensitive"),
8989
$weight
9090
))

marklogic-data-hub/src/test/ml-modules/root/test/suites/data-hub/5/smart-mastering/matching/include-matches.xqy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ return (
1919
test:assert-equal(1, fn:count($def-match/@threshold[. = "Definitive Match"])),
2020
test:assert-equal(1, fn:count($def-match/@action[. = $constants:MERGE-ACTION])),
2121
test:assert-exists($def-match/matches),
22-
test:assert-equal(6, fn:count($def-match/matches/match))
22+
test:assert-equal(7, fn:count($def-match/matches/match))
2323
),
2424

2525
let $likely-match := $actual/result[@threshold="Likely Match"]
@@ -28,6 +28,6 @@ return (
2828
test:assert-equal(1, fn:count($likely-match/@threshold[. = "Likely Match"])),
2929
test:assert-equal(1, fn:count($likely-match/@action[. = $constants:NOTIFY-ACTION])),
3030
test:assert-exists($likely-match/matches),
31-
test:assert-equal(3, fn:count($likely-match/matches/match), "Expected 3 matches. Got: " || xdmp:describe($likely-match/matches/match, (),()))
31+
test:assert-equal(4, fn:count($likely-match/matches/match), "Expected 3 matches. Got: " || xdmp:describe($likely-match/matches/match, (),()))
3232
)
3333
)

marklogic-data-hub/src/test/ml-modules/root/test/suites/data-hub/5/smart-mastering/matching/options-to-json.sjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ const actual = matcher.getOptionsAsJson(lib['MATCH-OPTIONS-NAME']);
66

77
[].concat(
88
test.assertEqual("200", actual.options.tuning.maxScan.toString()),
9-
test.assertEqual(7, actual.options.propertyDefs.properties.length),
9+
test.assertEqual(8, actual.options.propertyDefs.properties.length),
1010
test.assertEqual(2, actual.options.algorithms.length)
1111
)

marklogic-data-hub/src/test/ml-modules/root/test/suites/data-hub/5/smart-mastering/matching/test-data/doc1.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<envelope xmlns="http://marklogic.com/entity-services">
1+
<envelope xmlns="http://marklogic.com/entity-services" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
22
<headers>
33
<smart-mastering:id xmlns:smart-mastering="http://marklogic.com/smart-mastering">bbc806e4-ff00-4585-9d46-877edbc3248e</smart-mastering:id>
44
<smart-mastering:id xmlns:smart-mastering="http://marklogic.com/smart-mastering">66cbe731-7b56-4c91-9257-18a973008277</smart-mastering:id>
@@ -38,7 +38,7 @@
3838
<id>6986792174</id>
3939
<PersonBirthDate>19801001</PersonBirthDate>
4040
<PersonSex>F</PersonSex>
41-
<CaseAmount>1287.9</CaseAmount>
41+
<CaseAmount xsi:type="xs:decimal">1287.9</CaseAmount>
4242
<CustomThing>1</CustomThing>
4343
<PersonSSNIdentification>
4444
<PersonSSNIdentificationType>

marklogic-data-hub/src/test/ml-modules/root/test/suites/data-hub/5/smart-mastering/matching/test-data/doc2.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<envelope xmlns="http://marklogic.com/entity-services">
1+
<envelope xmlns="http://marklogic.com/entity-services" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
22
<headers>
33
<smart-mastering:id xmlns:smart-mastering="http://marklogic.com/smart-mastering">87c2f600-7488-429a-862c-0b2a5f6c6e1e</smart-mastering:id>
44
<smart-mastering:id xmlns:smart-mastering="http://marklogic.com/smart-mastering">f57e1093-4c68-46d7-910c-150825ab2edc</smart-mastering:id>
@@ -34,7 +34,7 @@
3434
<IncidentCategoryCodeDate/>
3535
<id>6270654339</id>
3636
<PersonBirthDate>19801001</PersonBirthDate>
37-
<CaseAmount>1287.9</CaseAmount>
37+
<CaseAmount xsi:type="xs:decimal">1287.9</CaseAmount>
3838
<CustomThing>2</CustomThing>
3939
<PersonSSNIdentification>
4040
<PersonSSNIdentificationType>

marklogic-data-hub/src/test/ml-modules/root/test/suites/data-hub/5/smart-mastering/matching/test-data/doc3.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<envelope xmlns="http://marklogic.com/entity-services">
1+
<envelope xmlns="http://marklogic.com/entity-services" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
22
<headers>
33
<smart-mastering:id xmlns:smart-mastering="http://marklogic.com/smart-mastering">87c2f600-7488-429a-862c-0b2a5f6c6e1e</smart-mastering:id>
44
<smart-mastering:id xmlns:smart-mastering="http://marklogic.com/smart-mastering">f57e1093-4c68-46d7-910c-150825ab2edc</smart-mastering:id>
@@ -34,7 +34,7 @@
3434
<IncidentCategoryCodeDate/>
3535
<id>6270654339</id>
3636
<PersonBirthDate>19801001</PersonBirthDate>
37-
<CaseAmount>1287.9</CaseAmount>
37+
<CaseAmount xsi:type="xs:decimal">1287.9</CaseAmount>
3838
<CustomThing>2</CustomThing>
3939
<PersonSSNIdentification>
4040
<PersonSSNIdentificationType>

marklogic-data-hub/src/test/ml-modules/root/test/suites/data-hub/5/smart-mastering/matching/test-data/doc4.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<envelope xmlns="http://marklogic.com/entity-services">
1+
<envelope xmlns="http://marklogic.com/entity-services" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
22
<headers>
33
<smart-mastering:id xmlns:smart-mastering="http://marklogic.com/smart-mastering">87c2f600-7488-429a-862c-0b2a5f6c6e1e</smart-mastering:id>
44
<smart-mastering:id xmlns:smart-mastering="http://marklogic.com/smart-mastering">f57e1093-4c68-46d7-910c-150825ab2edc</smart-mastering:id>

marklogic-data-hub/src/test/ml-modules/root/test/suites/data-hub/5/smart-mastering/matching/test-data/match-options.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<property namespace="" localname="LocationCity" name="city"/>
88
<property namespace="" localname="LocationState" name="state"/>
99
<property namespace="" localname="LocationPostalCode" name="zip"/>
10+
<property namespace="" localname="CaseAmount" name="case-amount"/>
1011
</property-defs>
1112
<algorithms>
1213
<algorithm name="std-reduce" function="standard-reduction"/>
@@ -20,6 +21,8 @@
2021
<add property-name="city" weight="3"/>
2122
<add property-name="state" weight="1"/>
2223
<add property-name="zip" weight="3"/>
24+
<!-- Only adding case-amount to trigger test for bug DHFPROD-4428 -->
25+
<add property-name="case-amount" weight="1"/>
2326
<expand property-name="first-name" algorithm-ref="dbl-metaphone" weight="6">
2427
<dictionary>name-dictionary.xml</dictionary>
2528
<distance-threshold>10</distance-threshold>

0 commit comments

Comments
 (0)