Skip to content

Commit b59518c

Browse files
committed
MLE-17235 Removed weight from shortest-path
Not yet supported by the server.
1 parent ab7197a commit b59518c

File tree

3 files changed

+0
-110
lines changed

3 files changed

+0
-110
lines changed

Diff for: marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/fastfunctest/TestOpticOnTriples.java

-68
Original file line numberDiff line numberDiff line change
@@ -1487,72 +1487,4 @@ public void testShortestPathWithStringInputs()
14871487
assertEquals("1",path.path("length").path("value").toString());
14881488
}
14891489
}
1490-
1491-
// TODO: Enable testShortestPathWithWeight and testShortestPathWithWeightColumn tests after server code starts
1492-
// accepting weight column and string.
1493-
@Disabled
1494-
@Test
1495-
public void testShortestPathWithWeight()
1496-
{
1497-
if(!isML12OrHigher){
1498-
return;
1499-
}
1500-
1501-
RowManager rowMgr = client.newRowManager();
1502-
PlanBuilder p = rowMgr.newPlanBuilder();
1503-
1504-
PlanColumn teamIdCol = p.col("player_team");
1505-
PlanColumn teamNameCol = p.col("team_name");
1506-
PlanColumn teamCityCol = p.col("team_city");
1507-
1508-
PlanPrefixer team = p.prefixer("http://marklogic.com/mlb/team/");
1509-
PlanBuilder.ModifyPlan team_plan = p.fromTriples(
1510-
p.pattern(teamIdCol, team.iri("name"), teamNameCol),
1511-
p.pattern(teamIdCol, team.iri("city"), teamCityCol)
1512-
).shortestPath("team_name", "team_city", "path", "length", "weight");
1513-
JacksonHandle jacksonHandle = new JacksonHandle().withMimetype("application/json");
1514-
rowMgr.resultDoc(team_plan, jacksonHandle);
1515-
JsonNode jsonResults = jacksonHandle.get();
1516-
JsonNode jsonBindingsNodes = jsonResults.path("rows");
1517-
for (int i=0; i<jsonBindingsNodes.size(); i++){
1518-
JsonNode path = jsonBindingsNodes.path(i);
1519-
assertNotNull(path.path("team_name"));
1520-
assertNotNull(path.path("team_city"));
1521-
assertNotNull(path.path("path"));
1522-
assertEquals("1",path.path("length").path("value").toString());
1523-
}
1524-
}
1525-
1526-
@Disabled
1527-
@Test
1528-
public void testShortestPathWithWeightColumn()
1529-
{
1530-
if(!isML12OrHigher){
1531-
return;
1532-
}
1533-
1534-
RowManager rowMgr = client.newRowManager();
1535-
PlanBuilder p = rowMgr.newPlanBuilder();
1536-
1537-
PlanColumn teamIdCol = p.col("player_team");
1538-
PlanColumn teamNameCol = p.col("team_name");
1539-
PlanColumn teamCityCol = p.col("team_city");
1540-
1541-
PlanPrefixer team = p.prefixer("http://marklogic.com/mlb/team/");
1542-
PlanBuilder.ModifyPlan team_plan = p.fromTriples(
1543-
p.pattern(teamIdCol, team.iri("name"), teamNameCol),
1544-
p.pattern(teamIdCol, team.iri("city"), teamCityCol)
1545-
).shortestPath(p.col("team_name"), p.col("team_city"), p.col("path"), p.col("length"), p.col("weight"));
1546-
JacksonHandle jacksonHandle = new JacksonHandle().withMimetype("application/json");
1547-
rowMgr.resultDoc(team_plan, jacksonHandle);
1548-
JsonNode jsonResults = jacksonHandle.get();
1549-
JsonNode jsonBindingsNodes = jsonResults.path("rows");
1550-
for (int i=0; i<jsonBindingsNodes.size(); i++){
1551-
JsonNode path = jsonBindingsNodes.path(i);
1552-
assertNotNull(path.path("team_name"));
1553-
assertNotNull(path.path("team_city"));
1554-
assertNotNull(path.path("path"));
1555-
assertEquals("1",path.path("length").path("value").toString());
1556-
}
1557-
}
15581490
}

Diff for: marklogic-client-api/src/main/java/com/marklogic/client/expression/PlanBuilder.java

-22
Original file line numberDiff line numberDiff line change
@@ -2030,28 +2030,6 @@ public interface ModifyPlan extends PreparePlan, PlanBuilderBase.ModifyPlanBase
20302030
* @since 7.1.0; requires MarkLogic 12
20312031
*/
20322032
public abstract ModifyPlan shortestPath(PlanExprCol start, PlanExprCol end, PlanExprCol path, PlanExprCol length);
2033-
/**
2034-
* This method can be used to find the shortest path between two nodes in a given graph.
2035-
* @param start The column representing the input starting subject of the shortest path search. The columns can be named with a string or a column parameter function such as op:col. See {@link PlanBuilder#col(XsStringVal)}
2036-
* @param end The column representing the input ending object of the shortest path search. The columns can be named with a string or a column parameter function such as op:col. See {@link PlanBuilder#col(XsStringVal)}
2037-
* @param path The column is the output column representing the actual shortest path(s) taken from start to end. Values are not returned for this column if this is the empty sequence.The columns can be named with a string or a column parameter function such as op:col. See {@link PlanBuilder#col(XsStringVal)}
2038-
* @param length The column is the output column representing the length of the shortest path. Value is not returned for this column if this is the empty sequence.The columns can be named with a string or a column parameter function such as op:col. See {@link PlanBuilder#col(XsStringVal)}
2039-
* @param weight the weight value. See {@link PlanBuilder#col(XsStringVal)}
2040-
* @return a ModifyPlan object
2041-
* @since 7.1.0; requires MarkLogic 12
2042-
*/
2043-
public abstract ModifyPlan shortestPath(String start, String end, String path, String length, String weight);
2044-
/**
2045-
* This method can be used to find the shortest path between two nodes in a given graph.
2046-
* @param start The column representing the input starting subject of the shortest path search. The columns can be named with a string or a column parameter function such as op:col. See {@link PlanBuilder#col(XsStringVal)}
2047-
* @param end The column representing the input ending object of the shortest path search. The columns can be named with a string or a column parameter function such as op:col. See {@link PlanBuilder#col(XsStringVal)}
2048-
* @param path The column is the output column representing the actual shortest path(s) taken from start to end. Values are not returned for this column if this is the empty sequence.The columns can be named with a string or a column parameter function such as op:col. See {@link PlanBuilder#col(XsStringVal)}
2049-
* @param length The column is the output column representing the length of the shortest path. Value is not returned for this column if this is the empty sequence.The columns can be named with a string or a column parameter function such as op:col. See {@link PlanBuilder#col(XsStringVal)}
2050-
* @param weight the weight value. See {@link PlanBuilder#col(XsStringVal)}
2051-
* @return a ModifyPlan object
2052-
* @since 7.1.0; requires MarkLogic 12
2053-
*/
2054-
public abstract ModifyPlan shortestPath(PlanExprCol start, PlanExprCol end, PlanExprCol path, PlanExprCol length, PlanExprCol weight);
20552033
}
20562034

20572035

Diff for: marklogic-client-api/src/main/java/com/marklogic/client/impl/PlanBuilderImpl.java

-20
Original file line numberDiff line numberDiff line change
@@ -2247,7 +2247,6 @@ public ModifyPlan shortestPath(String start, String end, String path, String len
22472247
return shortestPath((start == null) ? (PlanExprCol) null : exprCol(start), (end == null) ? (PlanExprCol) null : exprCol(end), (path == null) ? (PlanExprCol) null : exprCol(path), (length == null) ? (PlanExprCol) null : exprCol(length));
22482248
}
22492249

2250-
22512250
@Override
22522251
public ModifyPlan shortestPath(PlanExprCol start, PlanExprCol end, PlanExprCol path, PlanExprCol length) {
22532252
if (start == null) {
@@ -2259,25 +2258,6 @@ public ModifyPlan shortestPath(PlanExprCol start, PlanExprCol end, PlanExprCol p
22592258
return new PlanBuilderSubImpl.ModifyPlanSubImpl(this, "op", "shortest-path", new Object[]{ start, end, path, length });
22602259
}
22612260

2262-
2263-
@Override
2264-
public ModifyPlan shortestPath(String start, String end, String path, String length, String weight) {
2265-
return shortestPath((start == null) ? (PlanExprCol) null : exprCol(start), (end == null) ? (PlanExprCol) null : exprCol(end), (path == null) ? (PlanExprCol) null : exprCol(path), (length == null) ? (PlanExprCol) null : exprCol(length), (weight == null) ? (PlanExprCol) null : exprCol(weight));
2266-
}
2267-
2268-
2269-
@Override
2270-
public ModifyPlan shortestPath(PlanExprCol start, PlanExprCol end, PlanExprCol path, PlanExprCol length, PlanExprCol weight) {
2271-
if (start == null) {
2272-
throw new IllegalArgumentException("start parameter for shortestPath() cannot be null");
2273-
}
2274-
if (end == null) {
2275-
throw new IllegalArgumentException("end parameter for shortestPath() cannot be null");
2276-
}
2277-
return new PlanBuilderSubImpl.ModifyPlanSubImpl(this, "op", "shortest-path", new Object[]{ start, end, path, length, weight });
2278-
}
2279-
2280-
22812261
@Override
22822262
public ModifyPlan union(ModifyPlan right) {
22832263
if (right == null) {

0 commit comments

Comments
 (0)