forked from HydraCG/Heracles.ts
/
IPropertyMapping.ts
38 lines (33 loc) · 920 Bytes
/
IPropertyMapping.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import ProcessingState from "./ProcessingState";
type Literal = string | boolean | number;
type MappingsProcessor = (items: any[], processingState: ProcessingState) => any;
/**
* Describes a simple RDF mapping in Heracles' data model.
* @interface
*/
export interface IPropertyMapping {
/**
* Gets the property name.
* @readonly
* @returns {string}
*/
propertyName: string;
/**
* Gets the type of the resource that this property is valid for.
* @readonly
* @returns {string[]}
*/
type?: string[];
/**
* Gets a value indicating whether the property is required and needs to be created anyway.
* @readonly
* @returns {boolean}
*/
required?: boolean;
/**
* Gets the either default literal value or a factory method to be used for this property.
* @readonly
* @returns {Function | string | number | boolean}
*/
default?: Literal | MappingsProcessor;
}