Skip to content

Commit 1c44c7b

Browse files
BackwardsCompatible -> BackCompat
1 parent eec7ac1 commit 1c44c7b

File tree

3 files changed

+26
-26
lines changed

3 files changed

+26
-26
lines changed

src/framework/graph-visualiser/converter.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ import {
2222
import {ILogicalGraphConverter} from "./visualisation";
2323
import {StudioConverterStructureParameters, StudioConverterStyleParameters} from "./config";
2424
import {
25-
AnalyzedPipelineBackwardsCompatible,
26-
backwardCompatible_expressionAssigned,
27-
ConstraintBackwardsCompatible
25+
AnalyzedPipelineBackCompat,
26+
backCompat_expressionAssigned,
27+
ConstraintBackCompat
2828
} from "./index";
2929

3030
type ConstraintVertexOrSpecial = ConstraintVertexAny | VertexFunction | VertexExpression;
3131

3232
export class StudioConverter implements ILogicalGraphConverter {
3333

3434
constructor(
35-
public readonly graph: VisualGraph, public readonly queryStructure: AnalyzedPipelineBackwardsCompatible,
35+
public readonly graph: VisualGraph, public readonly queryStructure: AnalyzedPipelineBackCompat,
3636
public readonly isFollowupQuery: boolean, public readonly structureParameters: StudioConverterStructureParameters,
3737
public readonly styleParameters: StudioConverterStyleParameters
3838
) {
@@ -213,7 +213,7 @@ export class StudioConverter implements ILogicalGraphConverter {
213213
vertex_map_key: expressionVertexKey
214214
}
215215

216-
let queryVertex = backwardCompatible_expressionAssigned(constraint.queryConstraint);
216+
let queryVertex = backCompat_expressionAssigned(constraint.queryConstraint);
217217
let varNameOrId = getVariableName(this.queryStructure, queryVertex) ?? `$_${queryVertex.id}`;
218218
let label = `assign[${varNameOrId}]`;
219219
this.maybeCreateEdge(answerIndex, constraint, label, expressionVertex, expression.assigned, expressionVertex, queryVertex);
@@ -256,15 +256,15 @@ export class StudioConverter implements ILogicalGraphConverter {
256256
}
257257
}
258258

259-
export function shouldCreateNode(structure: AnalyzedPipelineBackwardsCompatible, vertex: ConstraintVertexOrSpecial) {
259+
export function shouldCreateNode(structure: AnalyzedPipelineBackCompat, vertex: ConstraintVertexOrSpecial) {
260260
return !(
261261
(vertex.tag === "label" ||
262262
(vertex.tag == "variable" && !structure.outputs.includes(vertex.id))
263263
)
264264
);
265265
}
266266

267-
export function shouldCreateEdge(structure: AnalyzedPipelineBackwardsCompatible, _edge: ConstraintBackwardsCompatible, from: ConstraintVertexOrSpecial, to: ConstraintVertexOrSpecial) {
267+
export function shouldCreateEdge(structure: AnalyzedPipelineBackCompat, _edge: ConstraintBackCompat, from: ConstraintVertexOrSpecial, to: ConstraintVertexOrSpecial) {
268268
return shouldCreateNode(structure, from) && shouldCreateNode(structure, to);
269269
}
270270

src/framework/graph-visualiser/graph.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import {
99
} from "@typedb/driver-http";
1010
import {MultiGraph} from "graphology";
1111
import {
12-
ConstraintBackwardsCompatible,
13-
ConceptRowsQueryResponseBackwardsCompatible,
14-
backwardCompatible_expressionAssigned,
15-
backwardCompatible_pipelineBlocks,
16-
AnalyzedPipelineBackwardsCompatible
12+
ConstraintBackCompat,
13+
ConceptRowsQueryResponseBackCompat,
14+
backCompat_expressionAssigned,
15+
backCompat_pipelineBlocks,
16+
AnalyzedPipelineBackCompat
1717
} from "./index";
1818

1919
///////////////////////
@@ -262,19 +262,19 @@ export const newVisualGraph: () => VisualGraph = () => new MultiGraph<VertexAttr
262262
///////////////////////////////////
263263
// TypeDB server -> logical graph
264264
///////////////////////////////////
265-
export function constructGraphFromRowsResult(rows_result: ConceptRowsQueryResponseBackwardsCompatible): DataGraph {
265+
export function constructGraphFromRowsResult(rows_result: ConceptRowsQueryResponseBackCompat): DataGraph {
266266
return new LogicalGraphBuilder().build(rows_result);
267267
}
268268

269269
class LogicalGraphBuilder {
270270
constructor() {
271271
}
272272

273-
build(rows_result: ConceptRowsQueryResponseBackwardsCompatible): DataGraph {
273+
build(rows_result: ConceptRowsQueryResponseBackCompat): DataGraph {
274274
let answers: DataConstraintAny[][] = [];
275275
rows_result.answers.forEach((row, answerIndex) => {
276276
let current_answer_edges = row.involvedBlocks!.flatMap(branchIndex => {
277-
return backwardCompatible_pipelineBlocks(rows_result.query!)[branchIndex].constraints.map((constraint, constraintIndex) => {
277+
return backCompat_pipelineBlocks(rows_result.query!)[branchIndex].constraints.map((constraint, constraintIndex) => {
278278
return this.toDataConstraint(rows_result.query!, answerIndex, constraint, row.data, {
279279
branch: branchIndex,
280280
constraint: constraintIndex
@@ -286,7 +286,7 @@ class LogicalGraphBuilder {
286286
return {answers: answers};
287287
}
288288

289-
translate_vertex(structure: AnalyzedPipelineBackwardsCompatible, structure_vertex: ConstraintVertexAny, answerIndex: number, data: ConceptRow): DataVertex {
289+
translate_vertex(structure: AnalyzedPipelineBackCompat, structure_vertex: ConstraintVertexAny, answerIndex: number, data: ConceptRow): DataVertex {
290290
switch (structure_vertex.tag) {
291291
case "variable": {
292292
let name = getVariableName(structure, structure_vertex);
@@ -316,7 +316,7 @@ class LogicalGraphBuilder {
316316
}
317317
}
318318

319-
private toDataConstraint(structure: AnalyzedPipelineBackwardsCompatible, answerIndex: number, constraint: ConstraintBackwardsCompatible, data: ConceptRow, coordinates: QueryCoordinates): DataConstraintAny | null{
319+
private toDataConstraint(structure: AnalyzedPipelineBackCompat, answerIndex: number, constraint: ConstraintBackCompat, data: ConceptRow, coordinates: QueryCoordinates): DataConstraintAny | null{
320320
switch (constraint.tag) {
321321
case "isa": {
322322
return {
@@ -419,7 +419,7 @@ class LogicalGraphBuilder {
419419
}
420420
}
421421
case "expression": {
422-
const queryAssigned = backwardCompatible_expressionAssigned(constraint);
422+
const queryAssigned = backCompat_expressionAssigned(constraint);
423423
return {
424424
tag: "expression",
425425
textSpan: constraint.textSpan,

src/framework/graph-visualiser/index.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export class GraphVisualiser {
109109
return this.getColorForConstraintIndex(branchIndex, constraintIndex);
110110
}
111111

112-
colorQuery(queryString: string, queryStructure: AnalyzedPipelineBackwardsCompatible): string {
112+
colorQuery(queryString: string, queryStructure: AnalyzedPipelineBackCompat): string {
113113
function shouldColourConstraint(constraint: ConstraintAny | ConstraintExpressionLegacy | ConstraintLinksLegacy): boolean {
114114
switch (constraint.tag) {
115115
case "isa": return shouldCreateEdge(queryStructure, constraint, constraint.instance, constraint.type);
@@ -131,7 +131,7 @@ export class GraphVisualiser {
131131

132132
return (
133133
constraint.arguments.map(arg => shouldCreateNode(queryStructure, arg)).reduce((a,b) => a || b, false)
134-
|| shouldCreateNode(queryStructure, backwardCompatible_expressionAssigned(constraint))
134+
|| shouldCreateNode(queryStructure, backCompat_expressionAssigned(constraint))
135135
);
136136
case "functionCall":
137137
return (
@@ -151,7 +151,7 @@ export class GraphVisualiser {
151151
}
152152
let spans: { span: ConstraintSpan, coordinates: QueryCoordinates}[] = [];
153153

154-
backwardCompatible_pipelineBlocks(queryStructure).forEach((branch, branchIndex) => {
154+
backCompat_pipelineBlocks(queryStructure).forEach((branch, branchIndex) => {
155155
branch.constraints.forEach((constraint, constraintIndex) => {
156156
if (shouldColourConstraint(constraint)) {
157157
let span = "textSpan" in constraint ? constraint["textSpan"] : null;
@@ -205,7 +205,7 @@ export function createSigmaRenderer(containerEl: HTMLElement, sigma_settings: Si
205205
return new Sigma(graph, containerEl, sigma_settings);
206206
}
207207

208-
export function backwardCompatible_pipelineBlocks(pipeline : AnalyzedPipelineBackwardsCompatible): AnalyzedConjunction[] | QueryConjunctionLegacy[] {
208+
export function backCompat_pipelineBlocks(pipeline : AnalyzedPipelineBackCompat): AnalyzedConjunction[] | QueryConjunctionLegacy[] {
209209
if ("blocks" in pipeline) {
210210
return pipeline["blocks"];
211211
} else if ("conjunctions" in pipeline) {
@@ -215,10 +215,10 @@ export function backwardCompatible_pipelineBlocks(pipeline : AnalyzedPipelineBac
215215
}
216216
}
217217

218-
export function backwardCompatible_expressionAssigned(expr: ConstraintExpression | ConstraintExpressionLegacy): ConstraintVertexVariable {
218+
export function backCompat_expressionAssigned(expr: ConstraintExpression | ConstraintExpressionLegacy): ConstraintVertexVariable {
219219
return (Array.isArray(expr.assigned) ? expr.assigned[0] : expr.assigned) as ConstraintVertexVariable;
220220
}
221221

222-
export type ConstraintBackwardsCompatible = ConstraintAny | ConstraintLinksLegacy | ConstraintExpressionLegacy;
223-
export type ConceptRowsQueryResponseBackwardsCompatible = ConceptRowsQueryResponse | ConceptRowsQueryResponseLegacy;
224-
export type AnalyzedPipelineBackwardsCompatible = AnalyzedPipeline | QueryStructureLegacy;
222+
export type ConstraintBackCompat = ConstraintAny | ConstraintLinksLegacy | ConstraintExpressionLegacy;
223+
export type ConceptRowsQueryResponseBackCompat = ConceptRowsQueryResponse | ConceptRowsQueryResponseLegacy;
224+
export type AnalyzedPipelineBackCompat = AnalyzedPipeline | QueryStructureLegacy;

0 commit comments

Comments
 (0)