@lblod/ember-rdfa-editor-lblod-plugins 33.3.0 → 33.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @lblod/ember-rdfa-editor-lblod-plugins
2
2
 
3
+ ## 33.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#614](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/614) [`a3d02d2`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/a3d02d2d456f4c9925cbd609ed14cfcb0b800195) Thanks [@piemonkey](https://github.com/piemonkey)! - When inserting traffic measures, filter 'zonebord' signs from the list
8
+
9
+ - [#613](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/613) [`770636c`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/770636ca8ec292930c2ff01dfcb8b20c5737251d) Thanks [@piemonkey](https://github.com/piemonkey)! - When inserting an AR design, include the link to the design in the RDFa
10
+
3
11
  ## 33.3.0
4
12
 
5
13
  ### Minor Changes
@@ -7,10 +7,12 @@ import {
7
7
  } from '@lblod/ember-rdfa-editor';
8
8
  import { v4 as uuid } from 'uuid';
9
9
  import { addPropertyToNode } from '@lblod/ember-rdfa-editor/utils/rdfa-utils';
10
+ import { type FullTriple } from '@lblod/ember-rdfa-editor/core/rdfa-processor';
10
11
  import {
11
12
  DCT,
12
13
  EXT,
13
14
  MOBILITEIT,
15
+ ONDERDEEL,
14
16
  PROV,
15
17
  RDF,
16
18
  } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
@@ -46,6 +48,7 @@ import {
46
48
  } from '../schemas/variable-instance';
47
49
 
48
50
  type InsertMeasureArgs = {
51
+ arDesignUri?: string;
49
52
  zonality: ZonalOrNot;
50
53
  temporal: boolean;
51
54
  variables: Record<
@@ -65,6 +68,7 @@ type InsertMeasureArgs = {
65
68
  );
66
69
 
67
70
  export default function insertMeasure({
71
+ arDesignUri,
68
72
  zonality,
69
73
  temporal,
70
74
  variables,
@@ -79,10 +83,26 @@ export default function insertMeasure({
79
83
  ? args.measureConcept
80
84
  : args.measureDesign.measureConcept;
81
85
  const measureDesign = 'measureDesign' in args && args.measureDesign;
86
+ const externalTriples: FullTriple[] | undefined =
87
+ !arDesignUri || !measureDesign
88
+ ? undefined
89
+ : [
90
+ {
91
+ subject: sayDataFactory.namedNode(arDesignUri),
92
+ predicate: ONDERDEEL('BevatMaatregelOntwerp').full,
93
+ object: sayDataFactory.namedNode(measureDesign.uri),
94
+ },
95
+ ];
82
96
  const { schema } = state;
83
- const signNodes = measureConcept.trafficSignalConcepts.map((signConcept) =>
84
- constructSignalNode(signConcept, schema, zonality),
85
- );
97
+ const signNodes = measureConcept.trafficSignalConcepts
98
+ .filter(
99
+ (signConcept) =>
100
+ signConcept.type !== TRAFFIC_SIGNAL_CONCEPT_TYPES.ROAD_SIGN ||
101
+ !signConcept.categories.some(
102
+ (cat) => cat.uri === ROAD_SIGN_CATEGORIES.ZONEBORD,
103
+ ),
104
+ )
105
+ .map((signConcept) => constructSignalNode(signConcept, schema, zonality));
86
106
  let signSection: PNode[] = [];
87
107
  if (signNodes.length) {
88
108
  const signList = schema.nodes.bullet_list.create(
@@ -150,6 +170,7 @@ export default function insertMeasure({
150
170
  // mobiliteit:periode, mobiliteit:plaatsbepaling, schema:eventSchedule, mobiliteit:type,
151
171
  // mobiliteit:verwijstNaar, mobiliteit:heeftGevolg
152
172
  ],
173
+ externalTriples,
153
174
  },
154
175
  [measureBody, ...signSection, ...(temporalNode ? [temporalNode] : [])],
155
176
  );
@@ -67,3 +67,7 @@ export const BESTUURSPERIODES = {
67
67
  export type BestuursperiodeLabel = keyof typeof BESTUURSPERIODES;
68
68
  export type BestuursperiodeURI =
69
69
  (typeof BESTUURSPERIODES)[BestuursperiodeLabel];
70
+ export const ONDERDEEL = namespace(
71
+ 'https://wegenenverkeer.data.vlaanderen.be/ns/onderdeel#',
72
+ 'onderdeel',
73
+ );
@@ -5,6 +5,7 @@ import { ZonalOrNot } from '../constants';
5
5
  import { MobilityMeasureDesign } from '../schemas/mobility-measure-design';
6
6
  import { VariableInstance } from '../schemas/variable-instance';
7
7
  type InsertMeasureArgs = {
8
+ arDesignUri?: string;
8
9
  zonality: ZonalOrNot;
9
10
  temporal: boolean;
10
11
  variables: Record<string, Exclude<Variable, {
@@ -18,5 +19,5 @@ type InsertMeasureArgs = {
18
19
  } | {
19
20
  measureDesign: MobilityMeasureDesign;
20
21
  });
21
- export default function insertMeasure({ zonality, temporal, variables, templateString, articleUriGenerator, decisionUri, ...args }: InsertMeasureArgs): TransactionMonad<boolean>;
22
+ export default function insertMeasure({ arDesignUri, zonality, temporal, variables, templateString, articleUriGenerator, decisionUri, ...args }: InsertMeasureArgs): TransactionMonad<boolean>;
22
23
  export {};
@@ -28,3 +28,4 @@ export declare const BESTUURSPERIODES: {
28
28
  };
29
29
  export type BestuursperiodeLabel = keyof typeof BESTUURSPERIODES;
30
30
  export type BestuursperiodeURI = (typeof BESTUURSPERIODES)[BestuursperiodeLabel];
31
+ export declare const ONDERDEEL: <Suffix extends string = string>(s: Suffix) => import("@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace").Resource<`https://wegenenverkeer.data.vlaanderen.be/ns/onderdeel#${Suffix}`, `onderdeel:${Suffix}`>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lblod/ember-rdfa-editor-lblod-plugins",
3
- "version": "33.3.0",
3
+ "version": "33.4.0",
4
4
  "description": "Ember addon providing lblod specific plugins for the ember-rdfa-editor",
5
5
  "keywords": [
6
6
  "ember-addon",