Skip to content

Commit efe5f54

Browse files
committedJan 17, 2023
Add human+environment interaction features
Fixes - #79 - A part of #7 (allows to describe the flush activation mechanism(s) of a toilet, in detail) Adds a way to describe interactions of a human with their environment/a machine/a control in detail, allowing to specify necessary and sufficient abilities that you need to interact. Makes a distinction between perception and action. New entities/interfaces: - `Interactable` - `InteractionMode` - `ActionMode` - `PerceptionMode`
1 parent 7a16724 commit efe5f54

23 files changed

+1592
-104
lines changed
 

‎src/Accessibility.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ import { SmokingPolicy, smokingPolicies } from './SmokingPolicy';
1616
import { getPrefixedQuantitySchemaDefinition, Volume, VolumeSchemaDefinition } from './Quantity';
1717
import { WifiAccessibility, getWifiAccessibilitySchemaDefinition } from './WifiAccessibility';
1818
import getPrefixedSchemaDefinition from './lib/getPrefixedSchemaDefinition';
19+
import { InteractionMode } from './InteractionMode';
20+
import { getInteractableSchemaDefinition, Interactable } from './Interactable';
1921

2022
/**
2123
* Describes the general wheelchair accessibility of the place. This is a human-rated value.
@@ -46,7 +48,7 @@ export const wheelchairAccessibilityGrades = ['fully', 'partially', 'not'];
4648
/**
4749
* Describes the physical (and sometimes human rated) accessibility of a place.
4850
*/
49-
export interface Accessibility {
51+
export interface Accessibility extends Interactable {
5052
/// @deprecated Use `wheelchairAccessibilityGrade`, `media`, and other properties instead.
5153
accessibleWith?: PersonalProfile;
5254
/// @deprecated Use `wheelchairAccessibilityGrade`, `media`, and other properties instead.
@@ -240,4 +242,5 @@ export const getAccessibilitySchemaDefinition: () => Record<string, SchemaDefini
240242
...getPrefixedSchemaDefinition('restrooms.$', getRestroomSchemaDefinition()),
241243
...getPrefixedSchemaDefinition('tables', getTablesSchemaDefinition()),
242244
...getLocalizedStringSchemaDefinition('serviceContact'),
245+
...getInteractableSchemaDefinition(),
243246
});

‎src/ActionMode.test.ts

+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
import { Complete } from './Complete';
2+
import expectValidFixture from './lib/expectValidFixture';
3+
import { getActionModeSchemaDefinition, ActionMode } from './ActionMode';
4+
5+
const actionModeFixture: Complete<ActionMode> = {
6+
name: { en: 'Reaction test' },
7+
description: { en: 'Listen to a tone while watching a chart on a screen' },
8+
languages: ['en'],
9+
optional: false,
10+
required: true,
11+
speak: false,
12+
morseCode: false,
13+
clap: false,
14+
wave: false,
15+
signLanguage: false,
16+
qrCode: false,
17+
headphone: false,
18+
cable: false,
19+
tactile: false,
20+
brailleText: false,
21+
brailleKeyboard: false,
22+
twoHanded: false,
23+
singleHanded: false,
24+
leftHanded: false,
25+
rightHanded: false,
26+
handwriting: false,
27+
keyboard: false,
28+
keypad: false,
29+
mouse: false,
30+
click: false,
31+
doubleClick: false,
32+
tripleClick: false,
33+
tap: false,
34+
trackball: false,
35+
pushSwitch: false,
36+
pedal: false,
37+
pullSwitch: false,
38+
pullstring: false,
39+
tactileGuides: false,
40+
highContrast: false,
41+
touchscreen: false,
42+
touch: false,
43+
press: false,
44+
drag: false,
45+
dragAndDropGesture: false,
46+
activationTimeInterval: { value: 0.5, unit: 's' },
47+
attentionSpan: { value: 5, unit: 's' },
48+
pushButton: false,
49+
stateCount: 1,
50+
joystick: true,
51+
turn: false,
52+
turnKnob: false,
53+
pinch: false,
54+
tearApart: false,
55+
squeeze: false,
56+
rotate: false,
57+
tilt: false,
58+
move: false,
59+
tongue: false,
60+
lick: false,
61+
smell: false,
62+
scratch: false,
63+
sipAndPuff: false,
64+
pinchFingerGesture: false,
65+
rotateTwoFingersGesture: false,
66+
swipeFingerGesture: false,
67+
swipeTwoFingersGesture: false,
68+
swipeThreeFingersGesture: false,
69+
rhythm: false,
70+
headPointer: false,
71+
eyeTracker: false,
72+
wheel: false,
73+
wireless: false,
74+
photo: false,
75+
video: false,
76+
soundRecording: false,
77+
faceRecognition: false,
78+
fingerprintScan: false,
79+
irisScan: false,
80+
haptic: false,
81+
raisedText: false,
82+
voiceActivation: false,
83+
visualRecognition: false,
84+
isEasyToUnderstand: true,
85+
necessaryGripHeight: { value: 1, unit: 'm' },
86+
necessaryEyeHeight: { value: 0.8, unit: 'm' },
87+
activationForce: { value: 0.1, unit: 'N' },
88+
feedback: [{
89+
vibration: true,
90+
}],
91+
techSufficient: [{
92+
uris: ['https://example.com/tech/1'],
93+
}],
94+
techSupported: [{
95+
uris: ['https://example.com/tech/1'],
96+
}],
97+
url: {
98+
en: 'https://example.com/devices/42/input',
99+
},
100+
instructionsUrl: {
101+
en: 'https://example.com/devices/42/input/howto',
102+
},
103+
apiDocumentationUrl: {
104+
en: 'https://example.com/api/documentation',
105+
},
106+
};
107+
108+
export default actionModeFixture;
109+
110+
const definition = getActionModeSchemaDefinition();
111+
112+
describe('ActionMode schema', () => {
113+
it('validates a completely specified object', () => {
114+
expectValidFixture(definition, actionModeFixture);
115+
});
116+
});

‎src/ActionMode.ts

+572
Large diffs are not rendered by default.

‎src/Door.test.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Door, getDoorSchemaDefinition } from './Door';
22
import { Complete } from './Complete';
33
import expectValidFixture from './lib/expectValidFixture';
4+
import interactionModeFixture from './InteractionMode.test';
45

56
const doorFixture: Complete<Door> = {
67
turningSpaceInFront: '<90cm',
@@ -27,6 +28,7 @@ const doorFixture: Complete<Door> = {
2728
hasIntercom: false,
2829
needsIntercom: false,
2930
access: ['private'],
31+
interactions: [interactionModeFixture],
3032
};
3133

3234
export default doorFixture;

‎src/Door.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import { AccessType, accessTypes } from './AccessType';
2+
import BooleanField from './BooleanField';
3+
import { getInteractableSchemaDefinition, Interactable } from './Interactable';
4+
import getPrefixedSchemaDefinition from './lib/getPrefixedSchemaDefinition';
25
import {
36
ForceSchemaDefinition,
47
getPrefixedQuantitySchemaDefinition,
@@ -11,7 +14,7 @@ import {
1114
* Describes the door of a place's entrance or to one of its facilities (e.g. to a shower, or to
1215
* an elevator)
1316
*/
14-
export interface Door {
17+
export interface Door extends Interactable {
1518
/**
1619
* Turning space in front of the door.
1720
*/
@@ -221,4 +224,5 @@ export const getDoorSchemaDefinition: () => Record<string, SchemaDefinition> = (
221224
...getPrefixedQuantitySchemaDefinition('openingForce', ForceSchemaDefinition),
222225
...getPrefixedQuantitySchemaDefinition('closingSpeed', SpeedSchemaDefinition),
223226
...getPrefixedQuantitySchemaDefinition('latchingSpeed', SpeedSchemaDefinition),
227+
...getInteractableSchemaDefinition(),
224228
});

‎src/EntranceProperties.test.ts

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import doorFixture from './Door.test';
33
import stairsFixture from './Stairs.test';
44
import { Complete } from './Complete';
55
import expectValidFixture from './lib/expectValidFixture';
6+
import interactionModeFixture from './InteractionMode.test';
67

78
const entrancePropertiesFixture: Complete<EntranceProperties> = {
89
name: { en: 'string' },
@@ -21,6 +22,7 @@ const entrancePropertiesFixture: Complete<EntranceProperties> = {
2122
intercomEquipmentId: 'idHere',
2223
needsAppointment: true,
2324
placeInfoId: '1234',
25+
interactions: [interactionModeFixture],
2426
};
2527

2628
export default entrancePropertiesFixture;

‎src/EntranceProperties.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ import { Stairs, getStairsSchemaDefinition } from './Stairs';
33
import { getLocalizedStringSchemaDefinition, LocalizedString } from './LocalizedString';
44
import { getPrefixedQuantitySchemaDefinition, Slope, SlopeSchemaDefinition } from './Quantity';
55
import getPrefixedSchemaDefinition from './lib/getPrefixedSchemaDefinition';
6+
import { getInteractableSchemaDefinition, Interactable } from './Interactable';
67

78
/**
89
* Describes an entrance to a place.
910
*/
10-
export interface EntranceProperties {
11+
export interface EntranceProperties extends Interactable {
1112
/**
1213
* Name of the entrance (helpful if there are multiple entrances).
1314
*/
@@ -122,4 +123,5 @@ SchemaDefinition
122123
type: String,
123124
optional: true,
124125
},
126+
...getInteractableSchemaDefinition(),
125127
});

‎src/EquipmentProperties.test.ts

+30
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,36 @@ const equipmentPropertiesFixture: Complete<EquipmentProperties> = {
6565
accessibilityControl: ['fullSwitchControl'],
6666
accessibilityFeature: ['braille'],
6767
accessibilityHazard: ['noFlashingHazard'],
68+
interactions: [
69+
{
70+
name: { en: 'On reaching a floor' },
71+
optional: true,
72+
perception: [{
73+
speech: true,
74+
}],
75+
},
76+
{
77+
name: { en: 'Selecting a floor' },
78+
required: true,
79+
action: [{
80+
pushButton: true,
81+
activationForce: '0.1N',
82+
activationTimeInterval: '0.2s',
83+
feedback: [{
84+
hapticClick: true,
85+
beep: true,
86+
}],
87+
}],
88+
},
89+
{
90+
name: { en: 'Elevator movement' },
91+
required: true,
92+
perception: [{
93+
vibration: true,
94+
acceleration: '1m/s^2',
95+
}],
96+
},
97+
],
6898
};
6999

70100
export default equipmentPropertiesFixture;

‎src/EquipmentProperties.ts

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import { W3CAccessMode, w3cAccessModes } from './W3CAccessMode';
1212
import { W3CAccessibilityFeature, w3cAccessibilityFeatures } from './W3CAccessibilityFeature';
1313
import { W3CAccessibilityHazard, w3cAccessibilityHazards } from './W3CAccessibilityHazard';
1414
import { w3cAccessibilityControls, W3CAccessibilityControl } from './W3CAccessibilityControl';
15+
import { getInteractionModeSchemaDefinition } from './InteractionMode';
16+
import { getInteractableSchemaDefinition, Interactable } from './Interactable';
1517

1618
export type EquipmentTypes =
1719
| 'bed'
@@ -629,4 +631,5 @@ SchemaDefinition
629631
type: String,
630632
allowedValues: w3cAccessibilityHazards,
631633
},
634+
...getInteractableSchemaDefinition(),
632635
});

‎src/GrabBars.test.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import { GrabBars, getGrabBarsSchemaDefinition } from './GrabBars';
22
import { Complete } from './Complete';
33
import expectValidFixture from './lib/expectValidFixture';
4+
import interactionModeFixture from './InteractionMode.test';
45

56
const grabBarsFixture: Complete<GrabBars> = {
67
onUsersLeftSide: true,
78
onUsersRightSide: true,
89
topHeightFromFloor: '80cm',
910
distanceBetweenBars: '80cm',
1011
foldable: true,
12+
interactions: [interactionModeFixture],
1113
};
1214

1315
export default grabBarsFixture;

‎src/GrabBars.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { t } from 'ttag';
22
import getPrefixedSchemaDefinition from './lib/getPrefixedSchemaDefinition';
3+
import { getInteractableSchemaDefinition, Interactable } from './Interactable';
34
import { getPrefixedQuantitySchemaDefinition, Length, LengthSchemaDefinition } from './Quantity';
45

5-
export interface GrabBars {
6+
export interface GrabBars extends Interactable {
67
/**
78
* `true` if there is a folding handle on left side (from the perspective of somebody using the
89
* toilet), `false` if not, `undefined` if condition is unknown.
@@ -42,4 +43,5 @@ export const getGrabBarsSchemaDefinition: () => Record<string, SchemaDefinition>
4243
type: Boolean,
4344
optional: true,
4445
},
46+
...getInteractableSchemaDefinition(),
4547
});

‎src/InputModeExperimental.ts

-98
This file was deleted.

‎src/Interactable.ts

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { getInteractionModeSchemaDefinition, InteractionMode } from './InteractionMode';
2+
import { getPrefixedArraySchemaDefinition } from './lib/getPrefixedSchemaDefinition';
3+
4+
export interface Interactable {
5+
/**
6+
* Indicates how the object can be interacted with.
7+
*/
8+
interactions?: InteractionMode[];
9+
}
10+
11+
export const getInteractableSchemaDefinition: () => Record<string, SchemaDefinition> = () => ({
12+
...getPrefixedArraySchemaDefinition('interactions', getInteractionModeSchemaDefinition()),
13+
});

‎src/InteractionMode.test.ts

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { Complete } from './Complete';
2+
import expectValidFixture from './lib/expectValidFixture';
3+
import { getInteractionModeSchemaDefinition, InteractionMode } from './InteractionMode';
4+
5+
const interactionModeFixture: Complete<InteractionMode> = {
6+
name: { en: 'Reaction test' },
7+
description: { en: 'A test to see how fast you can react' },
8+
action: [{
9+
touch: true,
10+
}],
11+
perception: [{
12+
light: true,
13+
music: true,
14+
educationLevel: 1,
15+
}],
16+
languages: ['en'],
17+
optional: false,
18+
required: true,
19+
};
20+
21+
export default interactionModeFixture;
22+
23+
const definition = getInteractionModeSchemaDefinition();
24+
25+
describe('InteractionMode schema', () => {
26+
it('validates a completely specified object', () => {
27+
expectValidFixture(definition, interactionModeFixture);
28+
});
29+
});

‎src/InteractionMode.ts

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import { ActionMode, getActionModeSchemaDefinition } from './ActionMode';
2+
import BooleanField from './BooleanField';
3+
import { IetfLanguageTag, ietfLanguageTagsAndSignLanguageCodes } from './ietfLanguageTags';
4+
import { getPrefixedArraySchemaDefinition } from './lib/getPrefixedSchemaDefinition';
5+
import { getLocalizedStringSchemaDefinition, LocalizedString } from './LocalizedString';
6+
import { getPerceptionModeSchemaDefinition, PerceptionMode } from './PerceptionMode';
7+
8+
/**
9+
* Describes the door of a place's entrance or to one of its facilities (e.g. to a shower, or to
10+
* an elevator)
11+
*/
12+
export interface InteractionMode {
13+
/**
14+
* Describes which output is meant. Helpful if there are multiple outputs.
15+
*/
16+
name?: LocalizedString;
17+
18+
/**
19+
* Describes the output as human-readable text.
20+
*/
21+
description?: LocalizedString;
22+
23+
/**
24+
* Input languages supported.
25+
*/
26+
languages?: IetfLanguageTag[];
27+
28+
/**
29+
* Perception modes supported to facilitate the interaction.
30+
*/
31+
perception?: PerceptionMode[];
32+
33+
/**
34+
* Action modes that are absolutely necessary to facilitate the interaction, e.g. ‘pushing a
35+
* button’.
36+
*/
37+
action?: ActionMode[];
38+
39+
/**
40+
* `true` if the interaction is optional, `false` if it is required.
41+
*/
42+
optional?: boolean;
43+
44+
/**
45+
* `false` if the interaction is optional, `true` if it is required.
46+
*/
47+
required?: boolean;
48+
}
49+
50+
export const getInteractionModeSchemaDefinition: () => Record<string, SchemaDefinition> = () => ({
51+
...getLocalizedStringSchemaDefinition('name'),
52+
...getLocalizedStringSchemaDefinition('description'),
53+
...getPrefixedArraySchemaDefinition('action', getActionModeSchemaDefinition()),
54+
...getPrefixedArraySchemaDefinition('perception', getPerceptionModeSchemaDefinition()),
55+
languages: {
56+
type: Array,
57+
optional: true,
58+
},
59+
'languages.$': {
60+
type: String,
61+
allowedValues: ietfLanguageTagsAndSignLanguageCodes,
62+
},
63+
optional: BooleanField,
64+
required: BooleanField,
65+
});

‎src/PerceptionMode.test.ts

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
import { Complete } from './Complete';
2+
import expectValidFixture from './lib/expectValidFixture';
3+
import { getPerceptionModeSchemaDefinition, PerceptionMode } from './PerceptionMode';
4+
5+
const perceptionModeFixture: Complete<PerceptionMode> = {
6+
speech: false,
7+
activationSignal: false,
8+
alarm: false,
9+
read: false,
10+
forceFeedback: false,
11+
vibration: false,
12+
led: false,
13+
breathing: false,
14+
hapticClick: false,
15+
audibleClick: false,
16+
music: false,
17+
beep: false,
18+
bing: false,
19+
pitchedTone: false,
20+
haptic: false,
21+
rhythmic: false,
22+
handwritten: false,
23+
flash: false,
24+
morse: false,
25+
pictograms: false,
26+
numbers: false,
27+
animation: false,
28+
sound: false,
29+
signLanguage: false,
30+
tactile: false,
31+
braille: false,
32+
tactileGuides: false,
33+
screen: false,
34+
chart: false,
35+
highContrast: false,
36+
blackAndWhite: false,
37+
static: false,
38+
colorCode: false,
39+
colorGradient: false,
40+
qrCode: false,
41+
headphone: true,
42+
cable: false,
43+
radio: true,
44+
byod: true,
45+
urgent: false,
46+
info: false,
47+
warning: false,
48+
light: true,
49+
fullBody: true,
50+
isEasyToUnderstand: true,
51+
needsHighConcentration: true,
52+
dedicatedScreenForSubtitles: false,
53+
subtitles: false,
54+
audioDescription: false,
55+
realTimeCaptioning: false,
56+
plainLanguageOption: true,
57+
contentWarning: { en: 'Content warning' },
58+
name: { en: 'Reaction test' },
59+
description: { en: 'Listen to a tone while watching a chart on a screen' },
60+
languages: ['en'],
61+
force: { value: 0.5, unit: 'N' },
62+
acceleration: { value: 0.5, unit: 'm/s^2' },
63+
soundVolume: { value: 50, unit: 'dB' },
64+
brightness: { value: 0.5, unit: 'nits' },
65+
ambientNoiseLevel: { value: 30, unit: 'dB' },
66+
frequency: { value: 440, unit: 'Hz' },
67+
framerate: { value: 48000, unit: 'kHz' },
68+
fontSize: { value: 4, unit: 'mm' },
69+
foregroundColors: ['red', 'green', 'blue'],
70+
backgroundColors: ['white'],
71+
flashingHazard: false,
72+
techSufficient: [{
73+
uris: ['https://example.com/tech/1'],
74+
}],
75+
techSupported: [{
76+
uris: ['https://example.com/tech/1'],
77+
}],
78+
url: {
79+
en: 'https://example.com/devices/42/output',
80+
},
81+
instructionsUrl: {
82+
en: 'https://example.com/devices/42/output/howto',
83+
},
84+
apiDocumentationUrl: 'https://example.com/api/documentation',
85+
necessaryGripHeight: { value: 150, unit: 'cm' },
86+
necessaryEyeHeight: { value: 90, unit: 'cm' },
87+
audioIsComprehensible: true,
88+
optional: false,
89+
required: true,
90+
attentionSpan: { value: 10, unit: 's' },
91+
duration: { value: 1, unit: 'h' },
92+
educationLevel: 3,
93+
};
94+
95+
export default perceptionModeFixture;
96+
97+
const definition = getPerceptionModeSchemaDefinition();
98+
99+
describe('PerceptionMode schema', () => {
100+
it('validates a completely specified object', () => {
101+
expectValidFixture(definition, perceptionModeFixture);
102+
});
103+
});

‎src/PerceptionMode.ts

+551
Large diffs are not rendered by default.

‎src/QueueSystem.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import SimpleSchema from 'simpl-schema';
22
import { EquipmentInfo, getEquipmentInfoSchemaDefinition } from './EquipmentInfo';
33
import getPrefixedSchemaDefinition from './lib/getPrefixedSchemaDefinition';
4+
import { getInteractionModeSchemaDefinition, InteractionMode } from './InteractionMode';
5+
import { Interactable } from './Interactable';
6+
import { getInteractionModeSchemaDefinition } from './InteractionMode';
47

5-
export interface QueueSystem {
8+
export interface QueueSystem extends Interactable {
69
/**
710
* `true` if the queueing uses rails / cattle bars, `false` if not.
811
*/
@@ -72,4 +75,5 @@ export const getQueueSystemSchemaDefinition: () => Record<string, SchemaDefiniti
7275
type: SimpleSchema.Integer,
7376
optional: true,
7477
},
78+
...getPrefixedArraySchemaDefinition('interactions', getInteractionModeSchemaDefinition()),
7579
});

‎src/Room.test.ts

+6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ const roomFixture: Complete<Room> = {
1515
en: 'A room with a view.',
1616
zh: '有景观的房间。',
1717
},
18+
interactions: [{
19+
name: { en: 'Looking through the window' },
20+
action: [{
21+
necessaryEyeHeight: '100cm',
22+
}],
23+
}],
1824
};
1925

2026
export default roomFixture;

‎src/Room.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { getStructuredAddressSchemaDefinition, StructuredAddress } from './Address';
22
import getPrefixedSchemaDefinition from './lib/getPrefixedSchemaDefinition';
3+
import { Interactable } from './Interactable';
4+
import { getInteractionModeSchemaDefinition } from './InteractionMode';
35
import { getLocalizedStringSchemaDefinition, LocalizedString } from './LocalizedString';
46

5-
export interface Room {
7+
export interface Room extends Interactable {
68
/**
79
* `true` if the room's relevant facilities are completely accessible while using a wheelchair,
810
* `false` if not, `undefined` if the condition is unknown or difficult to assess.
@@ -28,4 +30,5 @@ export const getRoomSchemaDefinition: () => Record<string, SchemaDefinition> = (
2830
},
2931
...getPrefixedSchemaDefinition('address', getStructuredAddressSchemaDefinition()),
3032
...getLocalizedStringSchemaDefinition('description'),
33+
...getPrefixedArraySchemaDefinition('interactions', getInteractionModeSchemaDefinition()),
3134
});

‎src/TechCombination.test.ts

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { TechCombination, getTechCombinationSchemaDefinition } from './TechCombination';
2+
import { Complete } from './Complete';
3+
import expectValidFixture from './lib/expectValidFixture';
4+
5+
const techCombinationFixture: Complete<TechCombination> = {
6+
uris: [
7+
'wikidata:Q117266', // for a banana connector (https://www.wikidata.org/wiki/Q117266)
8+
'openstreetmap:way/123', // for tying the tech to a specific location on the planet
9+
'wikipedia:Banana connector', // for a banana connector (https://en.wikipedia.org/wiki/Banana_connector)
10+
],
11+
name: { en: 'Banana connector' },
12+
description: { en: 'You need a banana connector to connect your assistive tech to something else.' },
13+
};
14+
15+
export default techCombinationFixture;
16+
17+
const definition = getTechCombinationSchemaDefinition();
18+
19+
describe('TechCombination schema', () => {
20+
it('validates a completely specified object', () => {
21+
expectValidFixture(definition, techCombinationFixture);
22+
});
23+
});

‎src/TechCombination.ts

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import { getLocalizedStringSchemaDefinition, LocalizedString } from './LocalizedString';
2+
3+
/**
4+
* Describes a combination of technologies that are used together to achieve a specific goal.
5+
*/
6+
export interface TechCombination {
7+
/**
8+
* Localizable name/title of the combination. Can describe in which mode or for what goal the
9+
* tech is used.
10+
*/
11+
12+
name?: LocalizedString;
13+
14+
/**
15+
* Localizable description of the combination. Can describe in which mode or for what goal the
16+
* tech is used.
17+
*/
18+
19+
description?: LocalizedString;
20+
21+
/**
22+
* URIs of technologies that are combined together to form this tech combination. Use RDF if
23+
* possible.
24+
*
25+
* Supported prefix examples:
26+
*
27+
* - `wikidata:Q117266` for a banana connector (https://www.wikidata.org/wiki/Q117266)
28+
* - `openstreetmap:way/123` for tying the tech to a specific location on the planet
29+
* - `wikipedia:Banana connector` for a banana connector (https://en.wikipedia.org/wiki/Banana_connector)
30+
*/
31+
32+
uris: string[];
33+
}
34+
35+
export const getTechCombinationSchemaDefinition: () => Record<string, SchemaDefinition> = () => ({
36+
...getLocalizedStringSchemaDefinition('name'),
37+
...getLocalizedStringSchemaDefinition('description'),
38+
uris: {
39+
type: Array,
40+
defaultValue: [],
41+
optional: true,
42+
},
43+
'uris.$': {
44+
type: String,
45+
},
46+
});

‎src/index.ts

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export { getIsoAlphaThreeCountryCodes };
99
export { getPrefixedSchemaDefinition };
1010

1111
export * from './Accessibility';
12+
export * from './ActionMode';
1213
export * from './Address';
1314
export * from './AnimalPolicy';
1415
export * from './CurrencyValue';
@@ -20,12 +21,15 @@ export * from './EquipmentProperties';
2021
export * from './GrabBars';
2122
export * from './Geometry';
2223
export * from './Surface';
24+
export * from './Interactable';
25+
export * from './InteractionMode';
2326
export * from './LocalizedString';
2427
export * from './Media';
2528
export * from './Mirror';
2629
export * from './Parking';
2730
export * from './Pathways';
2831
export * from './Payment';
32+
export * from './PerceptionMode';
2933
export * from './PersonalProfile';
3034
export * from './PlaceInfo';
3135
export * from './PlaceProperties';
@@ -37,6 +41,7 @@ export * from './SmokingPolicy';
3741
export * from './Staff';
3842
export * from './Stairs';
3943
export * from './Tables';
44+
export * from './TechCombination';
4045
export * from './Toilet';
4146
export * from './Quantity';
4247
export * from './QueueSystem';

0 commit comments

Comments
 (0)
Please sign in to comment.