Skip to content

Commit

Permalink
Diagram layout not always saved #549
Browse files Browse the repository at this point in the history
  • Loading branch information
bindeali committed Sep 18, 2024
1 parent 7f898ce commit 2aa909b
Showing 1 changed file with 7 additions and 29 deletions.
36 changes: 7 additions & 29 deletions src/queries/get/InitQueries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@ import {
import { Cardinality } from "../../datatypes/Cardinality";
import { addDiagram } from "../../function/FunctionCreateVars";
import {
initLanguageObject,
parsePrefix,
initLanguageObject
} from "../../function/FunctionEditVars";
import { processQuery } from "../../interface/TransactionInterface";
import { qb } from "../QueryBuilder";
import { WorkspaceLinks } from "./../../config/Variables";

export async function getElementsConfig(
contextEndpoint: string = AppSettings.contextEndpoint,
contexts: string[] = AppSettings.contextIRIs
diagramGraphs: string[] = Object.values(Diagrams).map(d => d.graph)
): Promise<boolean> {
const elements: { [key: string]: Partial<(typeof WorkspaceElements)[0]> } =
{};
Expand All @@ -37,13 +35,7 @@ export async function getElementsConfig(
"optional {?elem og:vocabulary ?vocabulary.}",
"?elem og:scheme ?scheme .",
"}",
`?contextIRI ${qb.i(
parsePrefix(
"d-sgov-pracovní-prostor-pojem",
`odkazuje-na-přílohový-kontext`
)
)} ?graph.`,
`values ?contextIRI {<${contexts.join("> <")}>}`,
`values ?graph {<${diagramGraphs.join("> <")}>}`,
"}",
].join(`
`);
Expand Down Expand Up @@ -95,13 +87,7 @@ export async function getElementsConfig(
// Make sure it is really a diagram we are querying
"?diagram og:representation ?representation .",
"}",
`?contextIRI ${qb.i(
parsePrefix(
"d-sgov-pracovní-prostor-pojem",
`odkazuje-na-přílohový-kontext`
)
)} ?graph.`,
`values ?contextIRI {<${contexts.join("> <")}>}`,
`values ?graph {<${diagramGraphs.join("> <")}>}`,
"}",
].join(`
`);
Expand Down Expand Up @@ -258,7 +244,7 @@ export async function getSettings(contextEndpoint: string): Promise<boolean> {

export async function getLinksConfig(
contextEndpoint: string = AppSettings.contextEndpoint,
contexts: string[] = AppSettings.contextIRIs
diagramGraphs: string[] = Object.values(Diagrams).map(d => d.graph)
): Promise<boolean> {
const links: { [key: string]: Partial<(typeof WorkspaceLinks)[0]> } = {};
const linkVertices: { [key: string]: Partial<(typeof WorkspaceLinks)[0]> } =
Expand All @@ -279,11 +265,7 @@ export async function getLinksConfig(
"?link og:targetCardinality1 ?targetCard1 .",
"?link og:targetCardinality2 ?targetCard2 .",
"}",
`?contextIRI <${parsePrefix(
"d-sgov-pracovní-prostor-pojem",
"odkazuje-na-přílohový-kontext"
)}> ?graph.`,
`values ?contextIRI {<${contexts.join("> <")}>}`,
`values ?graph {<${diagramGraphs.join("> <")}>}`,
"}",
].join(`
`);
Expand Down Expand Up @@ -345,11 +327,7 @@ export async function getLinksConfig(
"?diagram og:id ?diagramID.",
"?diagram og:representation ?representation.",
"}",
`?contextIRI <${parsePrefix(
"d-sgov-pracovní-prostor-pojem",
"odkazuje-na-přílohový-kontext"
)}> ?graph.`,
`values ?contextIRI {<${contexts.join("> <")}>}`,
`values ?graph {<${diagramGraphs.join("> <")}>}`,
"}",
].join(`
`);
Expand Down

0 comments on commit 2aa909b

Please sign in to comment.