@semapps/ontologies 1.1.3 → 1.2.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.
Files changed (102) hide show
  1. package/actions/{findNamespace.js → findNamespace.ts} +7 -3
  2. package/actions/{findPrefix.js → findPrefix.ts} +8 -4
  3. package/actions/{get.js → get.ts} +8 -2
  4. package/actions/getPrefixes.ts +16 -0
  5. package/actions/getRdfPrefixes.ts +15 -0
  6. package/actions/list.ts +11 -0
  7. package/actions/{prefixToUri.js → prefixToUri.ts} +8 -3
  8. package/actions/{register.js → register.ts} +11 -3
  9. package/dist/actions/findNamespace.d.ts +10 -0
  10. package/dist/actions/findNamespace.js +19 -0
  11. package/dist/actions/findNamespace.js.map +1 -0
  12. package/dist/actions/findPrefix.d.ts +10 -0
  13. package/dist/actions/findPrefix.js +23 -0
  14. package/dist/actions/findPrefix.js.map +1 -0
  15. package/dist/actions/get.d.ts +22 -0
  16. package/dist/actions/get.js +34 -0
  17. package/dist/actions/get.js.map +1 -0
  18. package/dist/actions/getPrefixes.d.ts +10 -0
  19. package/dist/actions/getPrefixes.js +12 -0
  20. package/dist/actions/getPrefixes.js.map +1 -0
  21. package/dist/actions/getRdfPrefixes.d.ts +8 -0
  22. package/dist/actions/getRdfPrefixes.js +13 -0
  23. package/dist/actions/getRdfPrefixes.js.map +1 -0
  24. package/dist/actions/list.d.ts +6 -0
  25. package/dist/actions/list.js +9 -0
  26. package/dist/actions/list.js.map +1 -0
  27. package/dist/actions/prefixToUri.d.ts +11 -0
  28. package/dist/actions/prefixToUri.js +27 -0
  29. package/dist/actions/prefixToUri.js.map +1 -0
  30. package/dist/actions/register.d.ts +34 -0
  31. package/dist/actions/register.js +59 -0
  32. package/dist/actions/register.js.map +1 -0
  33. package/dist/index.d.ts +7 -0
  34. package/dist/index.js +8 -0
  35. package/dist/index.js.map +1 -0
  36. package/dist/ontologies/core/acl.json +28 -0
  37. package/dist/ontologies/core/as.json +6 -0
  38. package/dist/ontologies/core/cred.json +22 -0
  39. package/dist/ontologies/core/dc.json +19 -0
  40. package/dist/ontologies/core/did.json +19 -0
  41. package/dist/ontologies/core/foaf.json +4 -0
  42. package/dist/ontologies/core/index.d.ts +16 -0
  43. package/dist/ontologies/core/index.js +17 -0
  44. package/dist/ontologies/core/index.js.map +1 -0
  45. package/dist/ontologies/core/ldp.json +4 -0
  46. package/dist/ontologies/core/rdf.json +4 -0
  47. package/dist/ontologies/core/rdfs.json +7 -0
  48. package/dist/ontologies/core/sec.json +88 -0
  49. package/dist/ontologies/core/semapps.json +12 -0
  50. package/dist/ontologies/core/skos.json +4 -0
  51. package/dist/ontologies/core/vcard.json +15 -0
  52. package/dist/ontologies/core/void.json +23 -0
  53. package/dist/ontologies/core/xsd.json +4 -0
  54. package/dist/ontologies/custom/index.d.ts +10 -0
  55. package/dist/ontologies/custom/index.js +11 -0
  56. package/dist/ontologies/custom/index.js.map +1 -0
  57. package/dist/ontologies/custom/mp.json +4 -0
  58. package/dist/ontologies/custom/oasis.json +4 -0
  59. package/dist/ontologies/custom/og.json +13 -0
  60. package/dist/ontologies/custom/pair.json +329 -0
  61. package/dist/ontologies/custom/petr.json +4 -0
  62. package/dist/ontologies/custom/schema.json +4 -0
  63. package/dist/ontologies/custom/skos.json +13 -0
  64. package/dist/ontologies/custom/syreen.json +43 -0
  65. package/dist/ontologies/custom/tutor.json +26 -0
  66. package/dist/ontologies/solid/apods.json +79 -0
  67. package/dist/ontologies/solid/index.d.ts +7 -0
  68. package/dist/ontologies/solid/index.js +8 -0
  69. package/dist/ontologies/solid/index.js.map +1 -0
  70. package/dist/ontologies/solid/interop.json +124 -0
  71. package/dist/ontologies/solid/notify.json +62 -0
  72. package/dist/ontologies/solid/oidc.json +22 -0
  73. package/dist/ontologies/solid/pim.json +15 -0
  74. package/dist/ontologies/solid/solid.json +27 -0
  75. package/dist/service.d.ts +126 -0
  76. package/dist/service.js +56 -0
  77. package/dist/service.js.map +1 -0
  78. package/dist/sub-services/registry.d.ts +40 -0
  79. package/dist/sub-services/registry.js +52 -0
  80. package/dist/sub-services/registry.js.map +1 -0
  81. package/dist/tsconfig.tsbuildinfo +1 -0
  82. package/dist/utils.d.ts +3 -0
  83. package/dist/utils.js +15 -0
  84. package/dist/utils.js.map +1 -0
  85. package/index.ts +9 -0
  86. package/ontologies/core/index.ts +34 -0
  87. package/ontologies/custom/index.ts +11 -0
  88. package/ontologies/solid/index.ts +8 -0
  89. package/ontologies/solid/interop.json +12 -0
  90. package/package.json +12 -5
  91. package/{service.js → service.ts} +25 -13
  92. package/sub-services/registry.ts +66 -0
  93. package/tsconfig.json +10 -0
  94. package/{utils.js → utils.ts} +3 -7
  95. package/actions/getPrefixes.js +0 -12
  96. package/actions/getRdfPrefixes.js +0 -11
  97. package/actions/list.js +0 -7
  98. package/index.js +0 -16
  99. package/ontologies/core/index.js +0 -17
  100. package/ontologies/custom/index.js +0 -11
  101. package/ontologies/solid/index.js +0 -8
  102. package/sub-services/registry.js +0 -44
@@ -0,0 +1,43 @@
1
+ {
2
+ "prefix": "syreen",
3
+ "namespace": "http://syreen.fr/ns/core#",
4
+ "jsonldContext": {
5
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
6
+ "syreen:hasPart": {
7
+ "@type": "@id"
8
+ },
9
+ "syreen:actor": {
10
+ "@type": "@id"
11
+ },
12
+ "syreen:partOf": {
13
+ "@type": "@id"
14
+ },
15
+ "syreen:depictedBy": {
16
+ "@type": "@id"
17
+ },
18
+ "syreen:hasLocation": {
19
+ "@type": "@id"
20
+ },
21
+ "syreen:hasCategory": {
22
+ "@type": "@id"
23
+ },
24
+ "syreen:hasBatiprixCategory": {
25
+ "@type": "@id"
26
+ },
27
+ "syreen:hasUnit": {
28
+ "@type": "@id"
29
+ },
30
+ "syreen:hasStage": {
31
+ "@type": "@id"
32
+ },
33
+ "syreen:hasProjectType": {
34
+ "@type": "@id"
35
+ },
36
+ "syreen:startDate": {
37
+ "@type": "xsd:dateTime"
38
+ },
39
+ "syreen:endDate": {
40
+ "@type": "xsd:dateTime"
41
+ }
42
+ }
43
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "prefix": "tutor",
3
+ "namespace": "http://virtual-assembly.org/ontologies/pair-tutor#",
4
+ "owl": "https://raw.githubusercontent.com/reconnexion/minicourses/master/ontology/pair-tutor.owl",
5
+ "jsonldContext": {
6
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
7
+ "tutor:currentLesson": {
8
+ "@type": "@id"
9
+ },
10
+ "tutor:hasRegistration": {
11
+ "@type": "@id"
12
+ },
13
+ "tutor:registeredFor": {
14
+ "@type": "@id"
15
+ },
16
+ "tutor:registrant": {
17
+ "@type": "@id"
18
+ },
19
+ "tutor:registrationFor": {
20
+ "@type": "@id"
21
+ },
22
+ "tutor:lessonStarted": {
23
+ "@type": "xsd:dateTime"
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,79 @@
1
+ {
2
+ "prefix": "apods",
3
+ "namespace": "http://activitypods.org/ns/core#",
4
+ "jsonldContext": {
5
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
6
+ "apods:closingTime": {
7
+ "@type": "xsd:dateTime"
8
+ },
9
+ "apods:hasFormat": {
10
+ "@type": "@id"
11
+ },
12
+ "apods:hasStatus": {
13
+ "@type": "@id"
14
+ },
15
+ "apods:contacts": {
16
+ "@type": "@id"
17
+ },
18
+ "apods:contactRequests": {
19
+ "@type": "@id"
20
+ },
21
+ "apods:ignoredContacts": {
22
+ "@type": "@id"
23
+ },
24
+ "apods:rejectedContacts": {
25
+ "@type": "@id"
26
+ },
27
+ "apods:announces": {
28
+ "@type": "@id"
29
+ },
30
+ "apods:announcers": {
31
+ "@type": "@id"
32
+ },
33
+ "apods:attendees": {
34
+ "@type": "@id"
35
+ },
36
+ "apods:preferredForTypes": {
37
+ "@type": "@id"
38
+ },
39
+ "apods:application": {
40
+ "@type": "@id"
41
+ },
42
+ "apods:hasSpecialRights": {
43
+ "@type": "@id"
44
+ },
45
+ "apods:acceptedAccessNeeds": {
46
+ "@type": "@id"
47
+ },
48
+ "apods:acceptedSpecialRights": {
49
+ "@type": "@id"
50
+ },
51
+ "apods:registeredClass": {
52
+ "@type": "@id"
53
+ },
54
+ "apods:registeredContainer": {
55
+ "@type": "@id"
56
+ },
57
+ "apods:hasClassDescription": {
58
+ "@type": "@id"
59
+ },
60
+ "apods:preferredForClass": {
61
+ "@type": "@id"
62
+ },
63
+ "apods:describedClass": {
64
+ "@type": "@id"
65
+ },
66
+ "apods:describedBy": {
67
+ "@type": "@id"
68
+ },
69
+ "apods:labelPredicate": {
70
+ "@type": "@id"
71
+ },
72
+ "apods:defaultApp": {
73
+ "@type": "@id"
74
+ },
75
+ "apods:availableApps": {
76
+ "@type": "@id"
77
+ }
78
+ }
79
+ }
@@ -0,0 +1,7 @@
1
+ import apods from './apods.json';
2
+ import interop from './interop.json';
3
+ import notify from './notify.json';
4
+ import oidc from './oidc.json';
5
+ import pim from './pim.json';
6
+ import solid from './solid.json';
7
+ export { apods, interop, notify, oidc, pim, solid };
@@ -0,0 +1,8 @@
1
+ import apods from './apods.json' with { type: 'json' };
2
+ import interop from './interop.json' with { type: 'json' };
3
+ import notify from './notify.json' with { type: 'json' };
4
+ import oidc from './oidc.json' with { type: 'json' };
5
+ import pim from './pim.json' with { type: 'json' };
6
+ import solid from './solid.json' with { type: 'json' };
7
+ export { apods, interop, notify, oidc, pim, solid };
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../ontologies/solid/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,cAAc,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACvD,OAAO,OAAO,MAAM,gBAAgB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC3D,OAAO,MAAM,MAAM,eAAe,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACzD,OAAO,IAAI,MAAM,aAAa,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACrD,OAAO,GAAG,MAAM,YAAY,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACnD,OAAO,KAAK,MAAM,cAAc,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAEvD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC"}
@@ -0,0 +1,124 @@
1
+ {
2
+ "prefix": "interop",
3
+ "namespace": "http://www.w3.org/ns/solid/interop#",
4
+ "jsonldContext": {
5
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
6
+ "interop:accessNecessity": {
7
+ "@type": "@id"
8
+ },
9
+ "interop:accessMode": {
10
+ "@type": "@id"
11
+ },
12
+ "interop:accessScenario": {
13
+ "@type": "@id"
14
+ },
15
+ "interop:preferredScope": {
16
+ "@type": "@id"
17
+ },
18
+ "interop:applicationAuthor": {
19
+ "@type": "@id"
20
+ },
21
+ "interop:authenticatedAs": {
22
+ "@type": "@id"
23
+ },
24
+ "interop:dataOwner": {
25
+ "@type": "@id"
26
+ },
27
+ "interop:grantedAt": {
28
+ "@type": "xsd:dateTime"
29
+ },
30
+ "interop:grantedBy": {
31
+ "@type": "@id"
32
+ },
33
+ "interop:grantedWith": {
34
+ "@type": "@id"
35
+ },
36
+ "interop:grantee": {
37
+ "@type": "@id"
38
+ },
39
+ "interop:granteeType": {
40
+ "@type": "@id"
41
+ },
42
+ "interop:hasAccessAuthorization": {
43
+ "@type": "@id"
44
+ },
45
+ "interop:hasAccessGrant": {
46
+ "@type": "@id"
47
+ },
48
+ "interop:hasAccessNeed": {
49
+ "@type": "@id"
50
+ },
51
+ "interop:hasAccessNeedGroup": {
52
+ "@type": "@id"
53
+ },
54
+ "interop:hasAccessDescriptionSet": {
55
+ "@type": "@id"
56
+ },
57
+ "interop:hasDataAuthorization": {
58
+ "@type": "@id"
59
+ },
60
+ "interop:hasDataGrant": {
61
+ "@type": "@id"
62
+ },
63
+ "interop:satisfiesAccessNeed": {
64
+ "@type": "@id"
65
+ },
66
+ "interop:scopeOfAuthorization": {
67
+ "@type": "@id"
68
+ },
69
+ "interop:scopeOfGrant": {
70
+ "@type": "@id"
71
+ },
72
+ "interop:registeredAgent": {
73
+ "@type": "@id"
74
+ },
75
+ "interop:registeredAt": {
76
+ "@type": "xsd:dateTime"
77
+ },
78
+ "interop:registeredBy": {
79
+ "@type": "@id"
80
+ },
81
+ "interop:registeredWith": {
82
+ "@type": "@id"
83
+ },
84
+ "interop:updatedAt": {
85
+ "@type": "xsd:dateTime"
86
+ },
87
+ "interop:registeredShapeTree": {
88
+ "@type": "@id"
89
+ },
90
+ "interop:usesLanguage": {
91
+ "@type": "xsd:language"
92
+ },
93
+ "interop:hasAuthorizationAgent": {
94
+ "@type": "@id"
95
+ },
96
+ "interop:hasRegistrySet": {
97
+ "@type": "@id"
98
+ },
99
+ "interop:hasAgentRegistry": {
100
+ "@type": "@id"
101
+ },
102
+ "interop:hasAuthorizationRegistry": {
103
+ "@type": "@id"
104
+ },
105
+ "interop:hasDataRegistry": {
106
+ "@type": "@id"
107
+ },
108
+ "interop:hasDataRegistration": {
109
+ "@type": "@id"
110
+ },
111
+ "interop:hasDataInstance": {
112
+ "@type": "@id"
113
+ },
114
+ "interop:delegationOfGrant": {
115
+ "@type": "@id"
116
+ },
117
+ "interop:reciprocalRegistration": {
118
+ "@type": "@id"
119
+ },
120
+ "interop:replaces": {
121
+ "@type": "@id"
122
+ }
123
+ }
124
+ }
@@ -0,0 +1,62 @@
1
+ {
2
+ "prefix": "notify",
3
+ "namespace": "http://www.w3.org/ns/solid/notifications#",
4
+ "owl": "https://www.w3.org/ns/solid/notifications.ttl",
5
+ "jsonldContext": {
6
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
7
+ "notify:channel": {
8
+ "@type": "@id"
9
+ },
10
+ "notify:endAt": {
11
+ "@type": "xsd:dateTime"
12
+ },
13
+ "notify:rate": {
14
+ "@type": "xsd:duration"
15
+ },
16
+ "notify:receiveFrom": {
17
+ "@type": "@id"
18
+ },
19
+ "notify:sender": {
20
+ "@type": "@id"
21
+ },
22
+ "notify:sendTo": {
23
+ "@type": "@id"
24
+ },
25
+ "notify:startAt": {
26
+ "@type": "xsd:dateTime"
27
+ },
28
+ "notify:subscription": {
29
+ "@type": "@id"
30
+ },
31
+ "notify:topic": {
32
+ "@type": "@id"
33
+ },
34
+ "notify:state": {
35
+ "@type": "@id"
36
+ },
37
+ "notify:feature": {
38
+ "@type": "@id"
39
+ },
40
+ "notify:channelType": {
41
+ "@type": "@id"
42
+ },
43
+ "notify:accept": {
44
+ "@type": "@id"
45
+ },
46
+ "notify:EventSourceChannel2023": {
47
+ "@type": "@id"
48
+ },
49
+ "notify:LDNChannel2023": {
50
+ "@type": "@id"
51
+ },
52
+ "notify:StreamingHTTPChannel2023": {
53
+ "@type": "@id"
54
+ },
55
+ "notify:WebhookChannel2023": {
56
+ "@type": "@id"
57
+ },
58
+ "notify:WebSocketChannel2023": {
59
+ "@type": "@id"
60
+ }
61
+ }
62
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "prefix": "oidc",
3
+ "namespace": "http://www.w3.org/ns/solid/oidc#",
4
+ "jsonldContext": {
5
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
6
+ "oidc:client_uri": {
7
+ "@type": "@id"
8
+ },
9
+ "oidc:logo_uri": {
10
+ "@type": "@id"
11
+ },
12
+ "oidc:policy_uri": {
13
+ "@type": "@id"
14
+ },
15
+ "oidc:tos_uri": {
16
+ "@type": "@id"
17
+ },
18
+ "oidc:redirect_uris": {
19
+ "@type": "@id"
20
+ }
21
+ }
22
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "prefix": "pim",
3
+ "namespace": "http://www.w3.org/ns/pim/space#",
4
+ "jsonldContext": {
5
+ "pim:storage": {
6
+ "@type": "@id"
7
+ },
8
+ "pim:preferencesFile": {
9
+ "@type": "@id"
10
+ },
11
+ "pim:workspace": {
12
+ "@type": "@id"
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "prefix": "solid",
3
+ "namespace": "http://www.w3.org/ns/solid/terms#",
4
+ "jsonldContext": {
5
+ "solid:publicTypeIndex": {
6
+ "@type": "@id"
7
+ },
8
+ "solid:privateTypeIndex": {
9
+ "@type": "@id"
10
+ },
11
+ "solid:hasTypeRegistration": {
12
+ "@type": "@id"
13
+ },
14
+ "solid:forClass": {
15
+ "@type": "@id"
16
+ },
17
+ "solid:instance": {
18
+ "@type": "@id"
19
+ },
20
+ "solid:instanceContainer": {
21
+ "@type": "@id"
22
+ },
23
+ "solid:oidcIssuer": {
24
+ "@type": "@id"
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,126 @@
1
+ declare const OntologiesSchema: {
2
+ name: "ontologies";
3
+ settings: {
4
+ ontologies: never[];
5
+ persistRegistry: boolean;
6
+ settingsDataset: string;
7
+ };
8
+ created(this: Moleculer.Service<Moleculer.ServiceSettingSchema>): Promise<void>;
9
+ started(this: Moleculer.Service<Moleculer.ServiceSettingSchema>): Promise<void>;
10
+ actions: {
11
+ findPrefix: {
12
+ visibility: "public";
13
+ params: {
14
+ uri: string;
15
+ };
16
+ handler(ctx: Moleculer.Context<Optionalize<{
17
+ [x: string]: any;
18
+ }>, {}, Moleculer.GenericObject>): Promise<string | null | undefined>;
19
+ };
20
+ findNamespace: {
21
+ visibility: "public";
22
+ params: {
23
+ prefix: string;
24
+ };
25
+ handler(ctx: Moleculer.Context<Optionalize<{
26
+ [x: string]: any;
27
+ }>, {}, Moleculer.GenericObject>): Promise<any>;
28
+ };
29
+ get: {
30
+ visibility: "public";
31
+ params: {
32
+ prefix: {
33
+ type: "string";
34
+ optional: true;
35
+ };
36
+ namespace: {
37
+ type: "string";
38
+ optional: true;
39
+ };
40
+ uri: {
41
+ type: "string";
42
+ optional: true;
43
+ };
44
+ };
45
+ cache: true;
46
+ handler(ctx: Moleculer.Context<Optionalize<{
47
+ [x: string]: any;
48
+ }>, {}, Moleculer.GenericObject>): Promise<any>;
49
+ };
50
+ getPrefixes: {
51
+ visibility: "public";
52
+ cache: true;
53
+ handler(ctx: Moleculer.Context<Optionalize<{
54
+ [x: string]: any;
55
+ }>, {}, Moleculer.GenericObject>): Promise<{
56
+ [k: string]: any;
57
+ }>;
58
+ };
59
+ getRdfPrefixes: {
60
+ visibility: "public";
61
+ cache: true;
62
+ handler(ctx: Moleculer.Context<Optionalize<{
63
+ [x: string]: any;
64
+ }>, {}, Moleculer.GenericObject>): Promise<any>;
65
+ };
66
+ list: {
67
+ visibility: "public";
68
+ cache: true;
69
+ handler(): any[];
70
+ };
71
+ prefixToUri: {
72
+ visibility: "public";
73
+ params: {
74
+ value: string;
75
+ };
76
+ cache: true;
77
+ handler(ctx: Moleculer.Context<Optionalize<{
78
+ [x: string]: any;
79
+ }>, {}, Moleculer.GenericObject>): Promise<any>;
80
+ };
81
+ register: {
82
+ visibility: "public";
83
+ params: {
84
+ prefix: string;
85
+ namespace: string;
86
+ owl: {
87
+ type: "string";
88
+ optional: true;
89
+ };
90
+ jsonldContext: {
91
+ type: "multi";
92
+ rules: ({
93
+ type: "array";
94
+ } | {
95
+ type: "object";
96
+ } | {
97
+ type: "string";
98
+ })[];
99
+ optional: true;
100
+ };
101
+ preserveContextUri: {
102
+ type: "boolean";
103
+ default: boolean;
104
+ };
105
+ persist: {
106
+ type: "boolean";
107
+ default: boolean;
108
+ };
109
+ };
110
+ handler(ctx: Moleculer.Context<Optionalize<{
111
+ [x: string]: any;
112
+ }>, {}, Moleculer.GenericObject>): Promise<void>;
113
+ };
114
+ };
115
+ methods: {
116
+ registerAll(): Promise<void>;
117
+ };
118
+ };
119
+ export default OntologiesSchema;
120
+ declare global {
121
+ export namespace Moleculer {
122
+ interface AllServices {
123
+ [OntologiesSchema.name]: typeof OntologiesSchema;
124
+ }
125
+ }
126
+ }
@@ -0,0 +1,56 @@
1
+ import { TripleStoreAdapter } from '@semapps/triplestore';
2
+ import OntologiesRegistryService from "./sub-services/registry.js";
3
+ import findPrefixAction from "./actions/findPrefix.js";
4
+ import findNamespaceAction from "./actions/findNamespace.js";
5
+ import getAction from "./actions/get.js";
6
+ import getPrefixesAction from "./actions/getPrefixes.js";
7
+ import getRdfPrefixesAction from "./actions/getRdfPrefixes.js";
8
+ import listAction from "./actions/list.js";
9
+ import prefixToUriAction from "./actions/prefixToUri.js";
10
+ import registerAction from "./actions/register.js";
11
+ const OntologiesSchema = {
12
+ name: 'ontologies',
13
+ settings: {
14
+ ontologies: [],
15
+ persistRegistry: false,
16
+ settingsDataset: 'settings'
17
+ },
18
+ async created() {
19
+ const { persistRegistry, settingsDataset } = this.settings;
20
+ if (persistRegistry) {
21
+ // @ts-expect-error TS(2345): Argument of type '{ mixins: { name: "ontologies.re... Remove this comment to see the full error message
22
+ this.broker.createService({
23
+ mixins: [OntologiesRegistryService],
24
+ adapter: new TripleStoreAdapter({ type: 'Ontology', dataset: settingsDataset })
25
+ });
26
+ }
27
+ },
28
+ async started() {
29
+ this.ontologies = {};
30
+ await this.registerAll();
31
+ },
32
+ actions: {
33
+ findPrefix: findPrefixAction,
34
+ findNamespace: findNamespaceAction,
35
+ get: getAction,
36
+ getPrefixes: getPrefixesAction,
37
+ getRdfPrefixes: getRdfPrefixesAction,
38
+ list: listAction,
39
+ prefixToUri: prefixToUriAction,
40
+ register: registerAction
41
+ },
42
+ methods: {
43
+ async registerAll() {
44
+ if (this.settings.persistRegistry) {
45
+ await this.broker.waitForServices(['ontologies.registry']);
46
+ const persistedOntologies = await this.broker.call('ontologies.registry.list');
47
+ this.ontologies = { ...this.ontologies, ...persistedOntologies };
48
+ }
49
+ for (const ontology of this.settings.ontologies) {
50
+ await this.actions.register(ontology);
51
+ }
52
+ }
53
+ }
54
+ };
55
+ export default OntologiesSchema;
56
+ //# sourceMappingURL=service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.js","sourceRoot":"","sources":["../service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,yBAAyB,MAAM,4BAA4B,CAAC;AACnE,OAAO,gBAAgB,MAAM,yBAAyB,CAAC;AACvD,OAAO,mBAAmB,MAAM,4BAA4B,CAAC;AAC7D,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,iBAAiB,MAAM,0BAA0B,CAAC;AACzD,OAAO,oBAAoB,MAAM,6BAA6B,CAAC;AAC/D,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAC3C,OAAO,iBAAiB,MAAM,0BAA0B,CAAC;AACzD,OAAO,cAAc,MAAM,uBAAuB,CAAC;AAEnD,MAAM,gBAAgB,GAAG;IACvB,IAAI,EAAE,YAAqB;IAC3B,QAAQ,EAAE;QACR,UAAU,EAAE,EAAE;QACd,eAAe,EAAE,KAAK;QACtB,eAAe,EAAE,UAAU;KAC5B;IACD,KAAK,CAAC,OAAO;QACX,MAAM,EAAE,eAAe,EAAE,eAAe,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC3D,IAAI,eAAe,EAAE,CAAC;YACpB,qIAAqI;YACrI,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC;gBACxB,MAAM,EAAE,CAAC,yBAAyB,CAAC;gBACnC,OAAO,EAAE,IAAI,kBAAkB,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC;aAChF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,KAAK,CAAC,OAAO;QACX,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;IAC3B,CAAC;IACD,OAAO,EAAE;QACP,UAAU,EAAE,gBAAgB;QAC5B,aAAa,EAAE,mBAAmB;QAClC,GAAG,EAAE,SAAS;QACd,WAAW,EAAE,iBAAiB;QAC9B,cAAc,EAAE,oBAAoB;QACpC,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,iBAAiB;QAC9B,QAAQ,EAAE,cAAc;KACzB;IACD,OAAO,EAAE;QACP,KAAK,CAAC,WAAW;YACf,IAAI,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,CAAC;gBAClC,MAAM,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC;gBAC3D,MAAM,mBAAmB,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;gBAC/E,IAAI,CAAC,UAAU,GAAG,EAAE,GAAG,IAAI,CAAC,UAAU,EAAE,GAAG,mBAAmB,EAAE,CAAC;YACnE,CAAC;YACD,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;gBAChD,MAAM,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACxC,CAAC;QACH,CAAC;KACF;CACsB,CAAC;AAE1B,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,40 @@
1
+ import DbService from 'moleculer-db';
2
+ import { TripleStoreAdapter } from '@semapps/triplestore';
3
+ declare const OntologiesRegistrySchema: {
4
+ name: "ontologies.registry";
5
+ mixins: (typeof DbService)[];
6
+ adapter: TripleStoreAdapter;
7
+ settings: {
8
+ idField: string;
9
+ };
10
+ actions: {
11
+ getByPrefix: {
12
+ handler(ctx: Moleculer.Context<Optionalize<{
13
+ [x: string]: any;
14
+ }>, {}, Moleculer.GenericObject>): Promise<any>;
15
+ };
16
+ getByNamespace: {
17
+ handler(ctx: Moleculer.Context<Optionalize<{
18
+ [x: string]: any;
19
+ }>, {}, Moleculer.GenericObject>): Promise<any>;
20
+ };
21
+ list: {
22
+ handler(ctx: Moleculer.Context<Optionalize<{
23
+ [x: string]: any;
24
+ }>, {}, Moleculer.GenericObject>): Promise<any>;
25
+ };
26
+ updateOrCreate: {
27
+ handler(ctx: Moleculer.Context<Optionalize<{
28
+ [x: string]: any;
29
+ }>, {}, Moleculer.GenericObject>): Promise<void>;
30
+ };
31
+ };
32
+ };
33
+ export default OntologiesRegistrySchema;
34
+ declare global {
35
+ export namespace Moleculer {
36
+ interface AllServices {
37
+ [OntologiesRegistrySchema.name]: typeof OntologiesRegistrySchema;
38
+ }
39
+ }
40
+ }