@@ -5,38 +5,32 @@ export interface IriTemplateMapping {
5
5
required : boolean ;
6
6
}
7
7
8
+ /** Any absolute IRI */
9
+ type Iri = string ;
10
+
11
+ /** A primitive value wrapped in @value */
12
+ interface JsonLdValue < T = string | number | boolean | null > {
13
+ "@value" : T ;
14
+ }
15
+
16
+ /** A node identifier */
17
+ interface JsonLdId {
18
+ "@id" : Iri ;
19
+ }
20
+
21
+ /** Zero‑to‑many rdf:types */
22
+ interface JsonLdType {
23
+ "@type" ?: Iri | Iri [ ] ;
24
+ }
25
+
8
26
export interface ExpandedOperation {
9
27
"@type" : [ "http://www.w3.org/ns/hydra/core#Operation" ] ;
10
- "http://www.w3.org/2000/01/rdf-schema#label" : [
11
- {
12
- "@value" : string ;
13
- } ,
14
- ] ;
15
- "http://www.w3.org/ns/hydra/core#title" : [
16
- {
17
- "@value" : string ;
18
- } ,
19
- ] ;
20
- "http://www.w3.org/ns/hydra/core#expects" ?: [
21
- {
22
- "@id" : string ;
23
- } ,
24
- ] ;
25
- "http://www.w3.org/ns/hydra/core#method" : [
26
- {
27
- "@value" : string ;
28
- } ,
29
- ] ;
30
- "http://www.w3.org/ns/hydra/core#returns" ?: [
31
- {
32
- "@id" : string ;
33
- } ,
34
- ] ;
35
- "http://www.w3.org/2002/07/owl#deprecated" ?: [
36
- {
37
- "@value" : boolean ;
38
- } ,
39
- ] ;
28
+ "http://www.w3.org/2000/01/rdf-schema#label" : [ JsonLdValue < string > ] ;
29
+ "http://www.w3.org/ns/hydra/core#title" : [ JsonLdValue < string > ] ;
30
+ "http://www.w3.org/ns/hydra/core#expects" ?: [ JsonLdId ] ;
31
+ "http://www.w3.org/ns/hydra/core#method" : [ JsonLdValue < string > ] ;
32
+ "http://www.w3.org/ns/hydra/core#returns" ?: [ JsonLdId ] ;
33
+ "http://www.w3.org/2002/07/owl#deprecated" ?: [ JsonLdValue < boolean > ] ;
40
34
}
41
35
42
36
export interface ExpandedRdfProperty {
@@ -45,156 +39,63 @@ export interface ExpandedRdfProperty {
45
39
| "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"
46
40
| "http://www.w3.org/ns/hydra/core#Link" ,
47
41
] ;
48
- "http://www.w3.org/2000/01/rdf-schema#label" : [
49
- {
50
- "@value" : string ;
51
- } ,
52
- ] ;
53
- "http://www.w3.org/2000/01/rdf-schema#domain" : [
54
- {
55
- "@id" : string ;
56
- } ,
57
- ] ;
42
+ "http://www.w3.org/2000/01/rdf-schema#label" : [ JsonLdValue < string > ] ;
43
+ "http://www.w3.org/2000/01/rdf-schema#domain" : [ JsonLdId ] ;
58
44
"http://www.w3.org/2000/01/rdf-schema#range" :
45
+ | [ JsonLdId ]
59
46
| [
60
- {
61
- "@id" : string ;
62
- } ,
63
- ]
64
- | [
65
- {
66
- "@id" : string ;
67
- } ,
47
+ JsonLdId ,
68
48
{
69
49
"http://www.w3.org/2002/07/owl#equivalentClass" : [
70
50
{
71
- "http://www.w3.org/2002/07/owl#allValuesFrom" : [
72
- {
73
- "@id" : string ;
74
- } ,
75
- ] ;
76
- "http://www.w3.org/2002/07/owl#onProperty" : [
77
- {
78
- "@id" : string ;
79
- } ,
80
- ] ;
51
+ "http://www.w3.org/2002/07/owl#allValuesFrom" : [ JsonLdId ] ;
52
+ "http://www.w3.org/2002/07/owl#onProperty" : [ JsonLdId ] ;
81
53
} ,
82
54
] ;
83
55
} ,
84
56
] ;
85
57
"http://www.w3.org/ns/hydra/core#supportedOperation" ?: ExpandedOperation [ ] ;
86
- "http://www.w3.org/2002/07/owl#maxCardinality" : [
87
- {
88
- "@value" : number ;
89
- } ,
90
- ] ;
58
+ "http://www.w3.org/2002/07/owl#maxCardinality" : [ JsonLdValue < number > ] ;
91
59
}
92
60
93
61
interface ExpandedSupportedProperty {
94
62
"@type" : [ "http://www.w3.org/ns/hydra/core#SupportedProperty" ] ;
95
- "http://www.w3.org/ns/hydra/core#title" : [
96
- {
97
- "@value" : string ;
98
- } ,
99
- ] ;
100
- "http://www.w3.org/ns/hydra/core#description" : [
101
- {
102
- "@value" : string ;
103
- } ,
104
- ] ;
105
- "http://www.w3.org/ns/hydra/core#required" ?: [
106
- {
107
- "@value" : boolean ;
108
- } ,
109
- ] ;
110
- "http://www.w3.org/ns/hydra/core#readable" : [
111
- {
112
- "@value" : boolean ;
113
- } ,
114
- ] ;
63
+ "http://www.w3.org/ns/hydra/core#title" : [ JsonLdValue < string > ] ;
64
+ "http://www.w3.org/ns/hydra/core#description" : [ JsonLdValue < string > ] ;
65
+ "http://www.w3.org/ns/hydra/core#required" ?: [ JsonLdValue < boolean > ] ;
66
+ "http://www.w3.org/ns/hydra/core#readable" : [ JsonLdValue < boolean > ] ;
115
67
/**
116
68
* @deprecated
117
69
*/
118
- "http://www.w3.org/ns/hydra/core#writeable" : [
119
- {
120
- "@value" : boolean ;
121
- } ,
122
- ] ;
123
- "http://www.w3.org/ns/hydra/core#writable" : [
124
- {
125
- "@value" : boolean ;
126
- } ,
127
- ] ;
70
+ "http://www.w3.org/ns/hydra/core#writeable" : [ JsonLdValue < boolean > ] ;
71
+ "http://www.w3.org/ns/hydra/core#writable" : [ JsonLdValue < boolean > ] ;
128
72
"http://www.w3.org/ns/hydra/core#property" : [ ExpandedRdfProperty ] ;
129
- "http://www.w3.org/2002/07/owl#deprecated" ?: [
130
- {
131
- "@value" : boolean ;
132
- } ,
133
- ] ;
73
+ "http://www.w3.org/2002/07/owl#deprecated" ?: [ JsonLdValue < boolean > ] ;
134
74
}
135
75
136
- export interface ExpandedClass {
76
+ export interface ExpandedClass extends JsonLdNode {
137
77
"@id" : string ;
138
78
"@type" : [ "http://www.w3.org/ns/hydra/core#Class" ] ;
139
- "http://www.w3.org/2000/01/rdf-schema#label" ?: [
140
- {
141
- "@value" : string ;
142
- } ,
143
- ] ;
144
- "http://www.w3.org/2000/01/rdf-schema#subClassOf" ?: [
145
- {
146
- "@id" : string ;
147
- } ,
148
- ] ;
149
- "http://www.w3.org/ns/hydra/core#title" : [
150
- {
151
- "@value" : string ;
152
- } ,
153
- ] ;
154
- "http://www.w3.org/ns/hydra/core#description" ?: [
155
- {
156
- "@value" : string ;
157
- } ,
158
- ] ;
79
+ "http://www.w3.org/2000/01/rdf-schema#label" ?: [ JsonLdValue < string > ] ;
80
+ "http://www.w3.org/2000/01/rdf-schema#subClassOf" ?: [ JsonLdId ] ;
81
+ "http://www.w3.org/ns/hydra/core#title" : [ JsonLdValue < string > ] ;
82
+ "http://www.w3.org/ns/hydra/core#description" ?: [ JsonLdValue < string > ] ;
159
83
"http://www.w3.org/ns/hydra/core#supportedProperty" : ExpandedSupportedProperty [ ] ;
160
84
"http://www.w3.org/ns/hydra/core#supportedOperation" ?: ExpandedOperation [ ] ;
161
- "http://www.w3.org/2002/07/owl#deprecated" ?: [
162
- {
163
- "@value" : boolean ;
164
- } ,
165
- ] ;
85
+ "http://www.w3.org/2002/07/owl#deprecated" ?: [ JsonLdValue < boolean > ] ;
166
86
}
167
87
168
88
export interface ExpandedDoc {
169
89
"@id" : string ;
170
90
"@type" : [ "http://www.w3.org/ns/hydra/core#ApiDocumentation" ] ;
171
- "http://www.w3.org/ns/hydra/core#title" : [
172
- {
173
- "@value" : string ;
174
- } ,
175
- ] ;
176
- "http://www.w3.org/ns/hydra/core#description" : [
177
- {
178
- "@value" : string ;
179
- } ,
180
- ] ;
181
- "http://www.w3.org/ns/hydra/core#entrypoint" : [
182
- {
183
- "@value" : string ;
184
- } ,
185
- ] ;
91
+ "http://www.w3.org/ns/hydra/core#title" : [ JsonLdValue < string > ] ;
92
+ "http://www.w3.org/ns/hydra/core#description" : [ JsonLdValue < string > ] ;
93
+ "http://www.w3.org/ns/hydra/core#entrypoint" : [ JsonLdValue < string > ] ;
186
94
"http://www.w3.org/ns/hydra/core#supportedClass" : ExpandedClass [ ] ;
187
95
}
188
96
189
97
export interface Entrypoint {
190
98
"@id" : string ;
191
99
"@type" : [ string ] ;
192
- [ key : string ] :
193
- | [
194
- {
195
- "@id" : string ;
196
- } ,
197
- ]
198
- | string
199
- | [ string ] ;
100
+ [ key : string ] : [ JsonLdId ] | string | [ string ] ;
200
101
}
0 commit comments