Skip to content

Commit 2a9684f

Browse files
committed
Creator as object
1 parent a7133af commit 2a9684f

7 files changed

Lines changed: 52 additions & 64 deletions

File tree

apps/website/app/utils/conversion/fromJsonLd.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ const parseBaseData = (data: NodeParseResult) => {
260260
return {
261261
created: data.created,
262262
last_modified: data.modified,
263-
author_local_id: data.creator,
263+
author_local_id: data.creator["@id"],
264264
...spaceInfo,
265265
};
266266
};

apps/website/app/utils/conversion/ldo/dgBase.context.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const dgBaseContext: LdoJsonldContext = {
5050
},
5151
creator: {
5252
"@id": "http://purl.org/dc/terms/creator",
53-
"@type": "http://www.w3.org/2001/XMLSchema#string",
53+
"@type": "@id",
5454
},
5555
},
5656
},
@@ -68,7 +68,7 @@ export const dgBaseContext: LdoJsonldContext = {
6868
},
6969
creator: {
7070
"@id": "http://purl.org/dc/terms/creator",
71-
"@type": "http://www.w3.org/2001/XMLSchema#string",
71+
"@type": "@id",
7272
},
7373
UserAccount: {
7474
"@id": "http://rdfs.org/sioc/ns#UserAccount",
@@ -100,7 +100,7 @@ export const dgBaseContext: LdoJsonldContext = {
100100
},
101101
creator: {
102102
"@id": "http://purl.org/dc/terms/creator",
103-
"@type": "http://www.w3.org/2001/XMLSchema#string",
103+
"@type": "@id",
104104
},
105105
created: {
106106
"@id": "http://purl.org/dc/terms/created",
@@ -143,7 +143,7 @@ export const dgBaseContext: LdoJsonldContext = {
143143
},
144144
creator: {
145145
"@id": "http://purl.org/dc/terms/creator",
146-
"@type": "http://www.w3.org/2001/XMLSchema#string",
146+
"@type": "@id",
147147
},
148148
created: {
149149
"@id": "http://purl.org/dc/terms/created",
@@ -214,7 +214,7 @@ export const dgBaseContext: LdoJsonldContext = {
214214
},
215215
creator: {
216216
"@id": "http://purl.org/dc/terms/creator",
217-
"@type": "http://www.w3.org/2001/XMLSchema#string",
217+
"@type": "@id",
218218
},
219219
created: {
220220
"@id": "http://purl.org/dc/terms/created",
@@ -248,7 +248,7 @@ export const dgBaseContext: LdoJsonldContext = {
248248
},
249249
creator: {
250250
"@id": "http://purl.org/dc/terms/creator",
251-
"@type": "http://www.w3.org/2001/XMLSchema#string",
251+
"@type": "@id",
252252
},
253253
created: {
254254
"@id": "http://purl.org/dc/terms/created",
@@ -293,7 +293,7 @@ export const dgBaseContext: LdoJsonldContext = {
293293
},
294294
creator: {
295295
"@id": "http://purl.org/dc/terms/creator",
296-
"@type": "http://www.w3.org/2001/XMLSchema#string",
296+
"@type": "@id",
297297
},
298298
created: {
299299
"@id": "http://purl.org/dc/terms/created",

apps/website/app/utils/conversion/ldo/dgBase.schema.ts

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ export const dgBaseSchema: Schema = {
9797
type: "NodeConstraint",
9898
datatype: "http://www.w3.org/2001/XMLSchema#dateTime",
9999
},
100-
min: 0,
101-
max: 1,
102100
},
103101
{
104102
type: "TripleConstraint",
@@ -115,10 +113,8 @@ export const dgBaseSchema: Schema = {
115113
predicate: "http://purl.org/dc/terms/creator",
116114
valueExpr: {
117115
type: "NodeConstraint",
118-
datatype: "http://www.w3.org/2001/XMLSchema#string",
116+
nodeKind: "iri",
119117
},
120-
min: 0,
121-
max: 1,
122118
},
123119
],
124120
},
@@ -157,10 +153,8 @@ export const dgBaseSchema: Schema = {
157153
predicate: "http://purl.org/dc/terms/creator",
158154
valueExpr: {
159155
type: "NodeConstraint",
160-
datatype: "http://www.w3.org/2001/XMLSchema#string",
156+
nodeKind: "iri",
161157
},
162-
min: 0,
163-
max: 1,
164158
},
165159
{
166160
type: "TripleConstraint",
@@ -169,8 +163,6 @@ export const dgBaseSchema: Schema = {
169163
type: "NodeConstraint",
170164
datatype: "http://www.w3.org/2001/XMLSchema#dateTime",
171165
},
172-
min: 0,
173-
max: 1,
174166
},
175167
{
176168
type: "TripleConstraint",
@@ -237,10 +229,8 @@ export const dgBaseSchema: Schema = {
237229
predicate: "http://purl.org/dc/terms/creator",
238230
valueExpr: {
239231
type: "NodeConstraint",
240-
datatype: "http://www.w3.org/2001/XMLSchema#string",
232+
nodeKind: "iri",
241233
},
242-
min: 0,
243-
max: 1,
244234
},
245235
{
246236
type: "TripleConstraint",
@@ -249,8 +239,6 @@ export const dgBaseSchema: Schema = {
249239
type: "NodeConstraint",
250240
datatype: "http://www.w3.org/2001/XMLSchema#dateTime",
251241
},
252-
min: 0,
253-
max: 1,
254242
},
255243
{
256244
type: "TripleConstraint",
@@ -327,10 +315,8 @@ export const dgBaseSchema: Schema = {
327315
predicate: "http://purl.org/dc/terms/creator",
328316
valueExpr: {
329317
type: "NodeConstraint",
330-
datatype: "http://www.w3.org/2001/XMLSchema#string",
318+
nodeKind: "iri",
331319
},
332-
min: 0,
333-
max: 1,
334320
},
335321
{
336322
type: "TripleConstraint",
@@ -339,8 +325,6 @@ export const dgBaseSchema: Schema = {
339325
type: "NodeConstraint",
340326
datatype: "http://www.w3.org/2001/XMLSchema#dateTime",
341327
},
342-
min: 0,
343-
max: 1,
344328
},
345329
{
346330
type: "TripleConstraint",
@@ -407,10 +391,8 @@ export const dgBaseSchema: Schema = {
407391
predicate: "http://purl.org/dc/terms/creator",
408392
valueExpr: {
409393
type: "NodeConstraint",
410-
datatype: "http://www.w3.org/2001/XMLSchema#string",
394+
nodeKind: "iri",
411395
},
412-
min: 0,
413-
max: 1,
414396
},
415397
{
416398
type: "TripleConstraint",
@@ -419,8 +401,6 @@ export const dgBaseSchema: Schema = {
419401
type: "NodeConstraint",
420402
datatype: "http://www.w3.org/2001/XMLSchema#dateTime",
421403
},
422-
min: 0,
423-
max: 1,
424404
},
425405
{
426406
type: "TripleConstraint",
@@ -493,10 +473,8 @@ export const dgBaseSchema: Schema = {
493473
predicate: "http://purl.org/dc/terms/creator",
494474
valueExpr: {
495475
type: "NodeConstraint",
496-
datatype: "http://www.w3.org/2001/XMLSchema#string",
476+
nodeKind: "iri",
497477
},
498-
min: 0,
499-
max: 1,
500478
},
501479
{
502480
type: "TripleConstraint",
@@ -505,8 +483,6 @@ export const dgBaseSchema: Schema = {
505483
type: "NodeConstraint",
506484
datatype: "http://www.w3.org/2001/XMLSchema#dateTime",
507485
},
508-
min: 0,
509-
max: 1,
510486
},
511487
{
512488
type: "TripleConstraint",

apps/website/app/utils/conversion/ldo/dgBase.typings.ts

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ export interface ItemProfile {
4242
hasContainer?: {
4343
"@id": string;
4444
};
45-
created?: string;
45+
created: string;
4646
modified?: string;
47-
creator?: string;
47+
creator: {
48+
"@id": string;
49+
};
4850
}
4951

5052
/**
@@ -59,8 +61,10 @@ export interface NodeSchemaProfile {
5961
hasContainer?: {
6062
"@id": string;
6163
};
62-
creator?: string;
63-
created?: string;
64+
creator: {
65+
"@id": string;
66+
};
67+
created: string;
6468
modified?: string;
6569
label: string;
6670
subClassOf?: LdSet<{
@@ -80,8 +84,10 @@ export interface NodeInstanceProfile {
8084
hasContainer?: {
8185
"@id": string;
8286
};
83-
creator?: string;
84-
created?: string;
87+
creator: {
88+
"@id": string;
89+
};
90+
created: string;
8591
modified?: string;
8692
title?: string;
8793
description?: ContentProfile;
@@ -102,8 +108,10 @@ export interface AbstractRelationDefProfile {
102108
hasContainer?: {
103109
"@id": string;
104110
};
105-
creator?: string;
106-
created?: string;
111+
creator: {
112+
"@id": string;
113+
};
114+
created: string;
107115
modified?: string;
108116
label: string;
109117
}
@@ -123,8 +131,10 @@ export interface RelationDefProfile {
123131
hasContainer?: {
124132
"@id": string;
125133
};
126-
creator?: string;
127-
created?: string;
134+
creator: {
135+
"@id": string;
136+
};
137+
created: string;
128138
modified?: string;
129139
label: string;
130140
domain: {
@@ -147,8 +157,10 @@ export interface RelationInstanceProfile {
147157
hasContainer?: {
148158
"@id": string;
149159
};
150-
creator?: string;
151-
created?: string;
160+
creator: {
161+
"@id": string;
162+
};
163+
created: string;
152164
modified?: string;
153165
source: NodeInstanceProfile;
154166
destination: NodeInstanceProfile;

apps/website/app/utils/conversion/shapes/dgBase.shex

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ dgshapes:PersonAccountProfile {
2323
dgshapes:ItemProfile {
2424
a [sioc:Item];
2525
sioc:has_container IRI ?;
26-
dct:created xsd:dateTime ? ;
26+
dct:created xsd:dateTime ;
2727
dct:modified xsd:dateTime ? ;
28-
dct:creator xsd:string ? ;
28+
dct:creator IRI ;
2929
}
3030

3131
dgshapes:NodeSchemaProfile {
3232
a [dgb:NodeSchema];
3333
sioc:has_container IRI ?;
34-
dct:creator xsd:string ? ;
35-
dct:created xsd:dateTime ? ;
34+
dct:creator IRI ;
35+
dct:created xsd:dateTime ;
3636
dct:modified xsd:dateTime ? ;
3737
rdfs:label xsd:string ;
3838
rdfs:subClassOf IRI *;
@@ -42,8 +42,8 @@ dgshapes:NodeSchemaProfile {
4242
dgshapes:NodeInstanceProfile {
4343
a [dgshapes:NodeInstance];
4444
sioc:has_container IRI ?;
45-
dct:creator xsd:string ? ;
46-
dct:created xsd:dateTime ? ;
45+
dct:creator IRI ;
46+
dct:created xsd:dateTime ;
4747
dct:modified xsd:dateTime ? ;
4848
dct:title xsd:dateTime? ;
4949
dct:description @dgshapes:ContentProfile ? ;
@@ -53,8 +53,8 @@ dgshapes:AbstractRelationDefProfile {
5353
a [dgb:AbstractRelationDef];
5454
rdfs:subClassOf IRI *;
5555
sioc:has_container IRI ?;
56-
dct:creator xsd:string ? ;
57-
dct:created xsd:dateTime ? ;
56+
dct:creator IRI ;
57+
dct:created xsd:dateTime ;
5858
dct:modified xsd:dateTime ? ;
5959
rdfs:label xsd:string ;
6060
}
@@ -63,8 +63,8 @@ dgshapes:RelationDefProfile {
6363
a [dgshapes:RelationDef];
6464
rdfs:subClassOf IRI *;
6565
sioc:has_container IRI ?;
66-
dct:creator xsd:string ? ;
67-
dct:created xsd:dateTime ? ;
66+
dct:creator IRI ;
67+
dct:created xsd:dateTime ;
6868
dct:modified xsd:dateTime ? ;
6969
rdfs:label xsd:string ;
7070
rdfs:domain IRI ;
@@ -75,8 +75,8 @@ dgshapes:RelationDefProfile {
7575
dgshapes:RelationInstanceProfile {
7676
a [dgb:RelationInstance];
7777
sioc:has_container IRI ?;
78-
dct:creator xsd:string ? ;
79-
dct:created xsd:dateTime ? ;
78+
dct:creator IRI ;
79+
dct:created xsd:dateTime ;
8080
dct:modified xsd:dateTime ? ;
8181
dgb:source @dgshapes:NodeInstanceProfile ;
8282
dgb:destination @dgshapes:NodeInstanceProfile ;

apps/website/public/schema/context.jsonld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"@id": "dct:created",
2929
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
3030
},
31-
"creator": "dct:creator",
31+
"creator": { "@id": "dct:creator", "@type": "@id" },
3232
"UserAccount": "sioc:UserAccount",
3333
"name": "sioc:name",
3434
"account_of": "sioc:account_of",

apps/website/public/schema/mira.jsonld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"@id": "dct:created",
3030
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
3131
},
32-
"creator": "dct:creator",
32+
"creator": { "@id": "dct:creator", "@type": "@id" },
3333
"UserAccount": "sioc:UserAccount",
3434
"name": "sioc:name",
3535
"account_of": "sioc:account_of",

0 commit comments

Comments
 (0)