@igea/oac_backend 1.0.45 → 1.0.47

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.
@@ -1,31 +1,28 @@
1
1
  @prefix sh: <http://www.w3.org/ns/shacl#> .
2
2
  @prefix ex: <http://example.org/shapes/> .
3
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
3
4
  @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
4
5
  @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
5
- @prefix crm: <http://www.cidoc-crm.org/cidoc-crm/> .
6
6
  @prefix owl: <http://www.w3.org/2002/07/owl#> .
7
- @prefix dcterms: <http://purl.org/dc/terms/> .
7
+ @prefix crm: <http://www.cidoc-crm.org/cidoc-crm/> .
8
+ @prefix basecpm: <http://ontome.net/ns/cpm/> .
9
+ #@prefix j.0: <http://www.cidoc-crm.org/extensions/crmsci/> .
10
+ #@prefix crmsci: <http://www.ics.forth.gr/isl/CRMsci> .
11
+ @prefix base: <http://www.ics.forth.gr/isl/CRMinf/> .
12
+ #@prefix skos: <http://www.w3.org/2004/02/skos/core> .
13
+ #@prefix pref: <http://indagine/> .
14
+
8
15
 
9
- ex:E7ActivityShape
10
- a sh:NodeShape ;
16
+ ex:E7ActivityShape # INDAGINE
17
+ a sh:NodeShape, rdfs:Class ;
11
18
  sh:targetClass crm:E7_Activity ;
12
- #rdfs:label "Indagine" ;
13
- #sh:description "Indagine" ;
14
- #sh:group ex:NameGroup ;
15
19
  sh:property [
16
20
  sh:path crm:P48_has_preferred_identifier ;
17
- sh:node ex:E42IdentifierShape ;
21
+ sh:node ex:E42Identifier01Shape ;
18
22
  sh:name "ID indagine" ;
19
23
  sh:maxCount 1 ;
20
24
  sh:minCount 1 ;
21
25
  ] ;
22
- sh:property [
23
- sh:path crm:P2_has_type ;
24
- sh:node ex:E55Type01Shape ;
25
- sh:name "Tipo indagine" ;
26
- sh:maxCount 1 ;
27
- sh:minCount 1 ;
28
- ] ;
29
26
  sh:property [
30
27
  sh:path crm:P17_was_motivated_by ;
31
28
  sh:node ex:I12AdoptedBeliefShape ;
@@ -34,76 +31,118 @@ ex:E7ActivityShape
34
31
  sh:minCount 1 ;
35
32
  ] ;
36
33
  sh:property [
37
- sh:path crm:P14_was_carried_out_by ;
34
+ sh:path crm:P14_carried_out_by ;
38
35
  sh:node ex:E29ActorShape ;
39
36
  sh:name "Attori" ;
40
- #sh:maxCount 1 ;
37
+ sh:maxCount 1 ;
41
38
  ] ;
42
39
  sh:property [
43
40
  sh:path crm:P16_used_specific_object ;
44
- sh:node ex:S13Sample ;
41
+ sh:node ex:S13SampleShape ;
45
42
  sh:name "Campione" ;
46
43
  sh:maxCount 1 ;
44
+ ] .
45
+
46
+ ex:E29ActorShape # ATTORI
47
+ a sh:NodeShape, rdfs:Class ;
48
+ sh:targetClass crm:E29_Actor ;
49
+ sh:property [
50
+ sh:path crm:P2_has_type ;
51
+ sh:node ex:E55Type03Shape ;
52
+ sh:name "Attori coinvolti" ;
53
+ sh:maxCount 1 ;
54
+ ] .
55
+
56
+ ex:S13SampleShape # CAMPIONE
57
+ a sh:NodeShape, rdfs:Class ;
58
+ sh:targetClass crm:S13_Sample ;
59
+ sh:property [
60
+ sh:path crm:P2_has_type ;
61
+ sh:node ex:E55Type05Shape ;
62
+ sh:name "Tipo campione" ;
63
+ sh:maxCount 1 ;
64
+ sh:minCount 1 ;
47
65
  ] ;
48
66
  sh:property [
49
- sh:path crm:xxx ;
50
- sh:node ex:E7Activity1 ;
51
- sh:name "Attività dignostica" ;
52
- #sh:maxCount 1 ;
67
+ sh:path basecpm:Pc43i_uses ;
68
+ sh:node ex:CP2ArchitectureWorkShape ;
69
+ sh:name "Bene di riferimento" ;
70
+ sh:maxCount 1 ;
53
71
  ] .
54
-
55
- ex:E42IdentifierShape
56
- a sh:NodeShape ;
72
+
73
+ ex:CP2ArchitectureWorkShape # BENE DI RIFERIMENTO
74
+ a sh:NodeShape, rdfs:Class ;
75
+ sh:targetClass basecpm:CP2_Architecture_Work ;
76
+ sh:property [
77
+ sh:path crm:P1_is_identified_by ;
78
+ sh:node ex:E41Appellation02Shape ;
79
+ sh:name "Denominazione bene" ;
80
+ sh:maxCount 1 ;
81
+ sh:minCount 1 ;
82
+ ] .
83
+
84
+ ex:E42Identifier01Shape #ID INDAGINE
85
+ a sh:NodeShape, rdfs:Class ;
57
86
  sh:targetClass crm:E42_Identifier ;
58
87
  sh:property [
59
- sh:path ex:P48_has_preferred_identifier ;
60
- sh:datatype xsd:string ;
88
+ sh:path ex:P48haspreferredidentifier01 ;
89
+ #sh:datatype xsd:string ;
61
90
  sh:name "ID" ;
62
- sh:nodeKind sh:IRI;
63
- sh:description "http://diagnostica/indagine/$UUID$" ;
64
- sh:maxCount 1 ;
91
+ sh:description "http://indagine/$SEQ1$" ;
92
+ sh:nodeKind sh:IRI ;
93
+ sh:maxCount 1 ;
65
94
  sh:minCount 1 ;
66
95
  ] .
67
96
 
68
- ex:E55Type01Shape
69
- a sh:NodeShape ;
70
- sh:targetClass crm:E55_Type ;
97
+ ex:I12AdoptedBeliefShape # QUESITO DIAGNOSTICO
98
+ a sh:NodeShape, rdfs:Class ;
99
+ sh:targetClass base:I12_Adopted_Belief ;
71
100
  sh:property [
72
- sh:class owl:Class ;
73
- sh:path crm:P127_has_broader_term ;
74
- owl:imports <OAC_EXPOSED_PROTOCOL://OAC_EXPOSED_HOST:OAC_EXPOSED_PORT/backend/fuseki/get-vocabolary-terms/fase-di-analisi> ;
75
- sh:name "Tipo" ;
101
+ sh:path crm:P2_has_type ;
102
+ sh:node ex:E55Type02Shape ;
103
+ sh:name "Tipo quesito diagnostico" ;
76
104
  sh:maxCount 1 ;
77
105
  sh:minCount 1 ;
78
106
  ] .
79
107
 
80
- ex:I12AdoptedBeliefShape
81
- a sh:NodeShape ;
82
- sh:targetClass crm:I12_Adopted_Belief ;
108
+ ex:E41Appellation01Shape # ENTE E SCHEDATORE
109
+ a sh:NodeShape, rdfs:Class ;
110
+ sh:targetClass crm:E41_Appellation ;
83
111
  sh:property [
84
- sh:path crm:P2_has_type ;
85
- sh:node ex:E55Type02Shape ;
86
- sh:name "Tipo quesito diagnostico" ;
87
- sh:maxCount 1 ;
112
+ sh:path ex:ente_richiedente ;
113
+ sh:datatype xsd:string ;
114
+ sh:name "Ente richiedente" ;
115
+ sh:maxCount 1 ;
116
+ ] ;
117
+ sh:property [
118
+ sh:path ex:schedatore ;
119
+ sh:datatype xsd:string ;
120
+ sh:name "Schedatore" ;
121
+ sh:maxCount 1 ;
88
122
  sh:minCount 1 ;
89
123
  ] .
90
124
 
91
- ex:E55Type02Shape
92
- a sh:NodeShape ;
125
+ ex:E41Appellation02Shape # DENOMINAZIONE BENE
126
+ a sh:NodeShape, rdfs:Class ;
127
+ sh:targetClass crm:E41_Appellation ;
128
+ sh:property [
129
+ sh:path ex:P1isidentifiedby ;
130
+ sh:datatype xsd:string ;
131
+ sh:name "Denominazione" ;
132
+ sh:maxCount 1 ;
133
+ sh:minCount 1 ;
134
+ ] .
135
+
136
+ ex:E55Type02Shape # TIPO QUESITO DIAGNOSTICO
137
+ a sh:NodeShape, rdfs:Class ;
93
138
  sh:targetClass crm:E55_Type ;
94
139
  sh:property [
140
+ sh:path ex:P2hastype02 ;
141
+ sh:class owl:Class ; # vocabolario QUESITO DIAGNOSTICO (8) id="quesito-diagnostico"
142
+ owl:imports <OAC_EXPOSED_PROTOCOL://OAC_EXPOSED_HOST:OAC_EXPOSED_PORT/backend/fuseki/get-vocabolary-terms/quesito-diagnostico> ;
95
143
  sh:name "Tipo" ;
96
144
  sh:maxCount 1 ;
97
145
  sh:minCount 1 ;
98
- #sh:class crm:E55_Type ;
99
- sh:class owl:Class ;
100
- sh:path crm:P127_has_broader_term ;
101
- owl:imports <OAC_EXPOSED_PROTOCOL://OAC_EXPOSED_HOST:OAC_EXPOSED_PORT/backend/fuseki/get-vocabolary-terms/quesito-diagnostico> ;
102
-
103
- #sh:class owl:Class ;
104
- #sh:path dcterms:subject ;
105
- #owl:imports <https://raw.githubusercontent.com/tibonto/DFG-Fachsystematik-Ontology/refs/heads/main/dfgfo.ttl> ;
106
-
107
146
  ] ;
108
147
  sh:property [
109
148
  sh:path crm:P3_has_note ;
@@ -112,25 +151,25 @@ ex:E55Type02Shape
112
151
  sh:maxCount 1 ;
113
152
  ] .
114
153
 
115
- ex:E29ActorShape
116
- a sh:NodeShape ;
117
- sh:targetClass crm:E29_Actor ;
154
+ ex:E55Type03Shape # TIPOLOGIA ATTORI COINVOLTI
155
+ a sh:NodeShape, rdfs:Class ;
156
+ sh:targetClass crm:E55_Type ;
118
157
  sh:property [
119
- sh:path ex:ente_richiedente ;
120
- sh:datatype xsd:string ;
121
-
122
- #sh:name "Ente richiedente" ;
158
+ sh:path crm:P1_is_defined_by ;
159
+ sh:node ex:E41Appellation01Shape ;
160
+ sh:name "Tipologia attori" ;
123
161
  #sh:maxCount 1 ;
162
+ ] .
124
163
 
125
- sh:name "ID" ;
126
- sh:nodeKind sh:IRI;
127
- sh:description "http://diagnostica/actor/$SEQ3$" ;
128
164
 
129
- ] ;
165
+ ex:E55Type05Shape # TIPO CAMPIONE
166
+ a sh:NodeShape, rdfs:Class ;
167
+ sh:targetClass crm:E55_Type ;
130
168
  sh:property [
131
- sh:path ex:schedatore ;
132
- sh:datatype xsd:string ;
133
- sh:name "Schedatore" ;
134
- sh:maxCount 1 ;
169
+ sh:path ex:P2hastype05 ;
170
+ sh:class owl:Class ; # vocabolario TIPO CAMPIONE (21) id="tipo-campione
171
+ owl:imports <OAC_EXPOSED_PROTOCOL://OAC_EXPOSED_HOST:OAC_EXPOSED_PORT/backend/fuseki/get-vocabolary-terms/tipo-campione> ;
172
+ sh:name "Tipo" ;
173
+ sh:maxCount 1 ;
135
174
  sh:minCount 1 ;
136
175
  ] .
@@ -44,7 +44,10 @@ describe('Vocabolaries.Parsers', () => {
44
44
  it('should get the insert query for the vocabolaries.xml file', async () => {
45
45
  const parser = Parser.GET_INSTANCE();
46
46
  var query = await parser.insertQuery(__dirname + '/vocabolaries.xml');
47
- expect(query.length).to.be.equal(40619);
47
+ expect(query.length).to.be.equal(3);
48
+ expect(query[0].length).to.be.equal(5279);
49
+ expect(query[1].length).to.be.equal(2665);
50
+ expect(query[2].length).to.be.equal(35150);
48
51
  });
49
52
 
50
53
  });
@@ -0,0 +1,36 @@
1
+ const chai = require('chai');
2
+ const expect = chai.expect;
3
+ const request = require('supertest');
4
+ const Splitter = require('../../../src/models/vocabolaries/splitter');
5
+
6
+
7
+ describe('Vocabolaries.Splitter', () => {
8
+
9
+ beforeEach(() => {
10
+
11
+ });
12
+
13
+ it('should create a parser instance', () => {
14
+ const splitter = new Splitter(__dirname, 'vocabolaries_2.xml');
15
+ expect(splitter).to.be.an.instanceof(Splitter);
16
+ });
17
+
18
+ it('should get group of classes', () => {
19
+ const splitter = new Splitter(__dirname, 'vocabolaries_2.xml');
20
+ const groups = splitter.splitByClass();
21
+ expect(Object.keys(groups).length).to.be.equal(6);
22
+ });
23
+
24
+ it('should get group of classes', () => {
25
+ const splitter = new Splitter(__dirname, 'vocabolaries_2.xml', true);
26
+ const files = splitter.splitFiles();
27
+ expect(files.length).to.be.equal(6);
28
+ expect(files[0].class).to.be.equal("base:I2_Belief");
29
+ expect(files[1].class).to.be.equal("basecpm:CP42_Material_Decay");
30
+ expect(files[2].class).to.be.equal("basecpm:CP43_Structural_Damage");
31
+ expect(files[3].class).to.be.equal("crm:E29_Design_or_Procedure");
32
+ expect(files[4].class).to.be.equal("crm:E55_Type");
33
+ expect(files[5].class).to.be.equal("crm:E58_Measurement_Unit");
34
+ });
35
+
36
+ });
@@ -401,7 +401,7 @@
401
401
  <term id="competenza">
402
402
  <name lang="it">Competenza</name>
403
403
  <sub-terms>
404
- <term id="antropologia ">
404
+ <term id="antropologia">
405
405
  <name lang="it">Antropologia </name>
406
406
  <sub-terms>
407
407
  <term id="culturale">