-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmim2onto.yaml
978 lines (978 loc) · 34.2 KB
/
mim2onto.yaml
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
title: MIM conversie
version: 0.1
prefixes:
owl: http://www.w3.org/2002/07/owl#
skos: http://www.w3.org/2004/02/skos/core#
rdfs: http://www.w3.org/2000/01/rdf-schema#
sh: http://www.w3.org/ns/shacl#
dct: http://purl.org/dc/terms/
mim-item-ns: http://ontology.mim-namespace.org/def/modelname#
mim-model-ns: http://ontology.mim-namespace.org/
queries:
- title: create technical names
query: >
PREFIX mim: <http://bp4mc2.org/def/mim#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
INSERT {
GRAPH <urn:input> {
?item skos:notation ?codefixed
}
}
WHERE {
GRAPH <urn:input> {
?item mim:naam ?naam
BIND (replace(?naam,"[^a-zA-Z0-9_-]","_") as ?codefixed)
}
}
- title: convert mim:Package (and subclasses of mim:Package)
query: >
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
INSERT {
GRAPH <urn:output> {
?ontology a owl:Ontology.
?ontology rdfs:label ?naam.
?ontology skos:notation ?code.
?ontology rdfs:seeAlso ?package.
}
}
WHERE {
SELECT (iri(concat("http://ontology.mim-namespace.org/",?code)) as ?ontology) ?code ?naam ?package
WHERE {
GRAPH <urn:input> {
?package a ?packagetype.
?package mim:naam ?naam.
?package skos:notation ?code.
FILTER (?packagetype=mim:Informatiemodel || ?packagetype=mim:Domein)
}
}
}
- title: convert mim:Objecttype
query: >
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
INSERT {
GRAPH <urn:output> {
?class a owl:Class, sh:NodeShape.
?class sh:targetClass ?class.
?class rdfs:label ?naam.
?class skos:notation ?code.
?class rdfs:seeAlso ?objecttype.
}
}
WHERE {
SELECT (iri(concat("http://ontology.mim-namespace.org/def/modelname#",?code)) as ?class) ?code ?naam ?objecttype
WHERE {
GRAPH <urn:input> {
?objecttype a mim:Objecttype.
?objecttype mim:naam ?naam.
?objecttype skos:notation ?code.
}
}
}
- title: convert mim:Gegevensgroeptype
query: >
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
INSERT {
GRAPH <urn:output> {
?class a owl:Class, sh:NodeShape.
?class sh:targetClass ?class.
?class rdfs:label ?naam.
?class skos:notation ?code.
?class rdfs:seeAlso ?gegevensgroeptype.
}
}
WHERE {
SELECT (iri(concat("http://ontology.mim-namespace.org/def/modelname#",?code)) as ?class) ?code ?naam ?gegevensgroeptype
WHERE {
GRAPH <urn:input> {
?gegevensgroeptype a mim:Gegevensgroeptype.
?gegevensgroeptype mim:naam ?naam.
?gegevensgroeptype skos:notation ?code.
}
}
}
- title: convert mim:Relatieklasse
query: >
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
INSERT {
GRAPH <urn:output> {
?class a owl:Class, sh:NodeShape.
?class sh:targetClass ?class.
?class rdfs:label ?naam.
?class skos:notation ?code.
?class rdfs:seeAlso ?relatieklasse.
}
}
WHERE {
SELECT (iri(concat("http://ontology.mim-namespace.org/def/modelname#",?code)) as ?class) ?code ?naam ?relatieklasse
WHERE {
GRAPH <urn:input> {
?relatieklasse a mim:Relatieklasse.
?relatieklasse mim:naam ?naam.
?relatieklasse skos:notation ?code.
}
}
}
- title: convert mim:Attribuutsoort / mim:dataElement
query: >
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
INSERT {
GRAPH <urn:output> {
?property a owl:DatatypeProperty.
?property rdfs:label ?naam.
?property rdfs:seeAlso ?attribuutsoort.
?ownershape sh:property ?predicate.
?predicate a sh:PropertyShape.
?predicate sh:name ?code.
?predicate sh:path ?property.
?predicate rdfs:seeAlso ?attribuutsoort
}
}
WHERE {
SELECT (iri(concat("http://ontology.mim-namespace.org/def/modelname#",?code)) as ?property)
(iri(concat("http://ontology.mim-namespace.org/def/modelname#",?ownercode,".",?code)) as ?predicate)
(iri(concat("http://ontology.mim-namespace.org/def/modelname#",?ownercode)) as ?ownershape)
?code ?naam ?attribuutsoort
WHERE {
GRAPH <urn:input> {
?owner a ?mimtype.
?owner ?mimrel ?attribuutsoort.
?owner skos:notation ?ownercode.
?attribuutsoort a ?mimattr.
?attribuutsoort mim:naam ?naam.
?attribuutsoort skos:notation ?code.
FILTER ((?mimattr = mim:Attribuutsoort && ?mimrel = mim:attribuut) || (?mimattr = mim:DataElement && ?mimrel = mim:dataElement))
FILTER (?mimtype = mim:Objecttype || ?mimtype = mim:Gegevensgroeptype || ?mimtype = mim:Relatieklasse || ?mimtype = mim:GestructureerdDatatype)
}
}
}
- title: convert mim:Relatiesoort
query: >
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
INSERT {
GRAPH <urn:output> {
?property a owl:ObjectProperty.
?property rdfs:label ?naam.
?property rdfs:seeAlso ?relatiesoort.
?owner sh:property ?predicate.
?predicate a sh:PropertyShape.
?predicate sh:name ?code.
?predicate sh:path ?property.
?predicate sh:nodeKind sh:IRI.
?predicate sh:class ?class.
?predicate rdfs:seeAlso ?relatiesoort
}
}
WHERE {
SELECT (iri(concat("http://ontology.mim-namespace.org/def/modelname#",?code)) as ?property)
(iri(concat("http://ontology.mim-namespace.org/def/modelname#",?ownercode,".",?code)) as ?predicate)
(iri(concat("http://ontology.mim-namespace.org/def/modelname#",?ownercode)) as ?owner)
(iri(concat("http://ontology.mim-namespace.org/def/modelname#",?classcode)) as ?class)
?code ?naam ?relatiesoort
WHERE {
GRAPH <urn:input> {
?relatiesoort a mim:Relatiesoort.
?relatiesoort mim:naam ?naam.
?relatiesoort mim:bron ?bron.
?relatiesoort mim:doel ?doel.
?relatiesoort skos:notation ?code.
?bron skos:notation ?ownercode.
?doel skos:notation ?classcode.
FILTER NOT EXISTS {
?relatiesoort mim:relatierol ?relatieroldoel.
?relatieroldoel a mim:RelatierolDoel.
?relatieroldoel mim:naam ?relatieroldoelnaam
}
}
}
}
- title: convert mim:ExterneKoppeling
query: >
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
INSERT {
GRAPH <urn:output> {
?property a owl:ObjectProperty.
?property rdfs:label ?naam.
?property rdfs:seeAlso ?externekoppeling.
?owner sh:property ?predicate.
?predicate a sh:PropertyShape.
?predicate sh:name ?code.
?predicate sh:path ?property.
?predicate sh:nodeKind sh:IRI.
?predicate sh:class ?class.
?predicate rdfs:seeAlso ?externekoppeling
}
}
WHERE {
SELECT (iri(concat("http://ontology.mim-namespace.org/def/modelname#",?code)) as ?property)
(iri(concat("http://ontology.mim-namespace.org/def/modelname#",?ownercode,".",?code)) as ?predicate)
(iri(concat("http://ontology.mim-namespace.org/def/modelname#",?ownercode)) as ?owner)
(iri(concat("http://ontology.mim-namespace.org/def/modelname#",?classcode)) as ?class)
?code ?naam ?externekoppeling
WHERE {
GRAPH <urn:input> {
?externekoppeling a mim:ExterneKoppeling.
?externekoppeling mim:naam ?naam.
?externekoppeling mim:bron ?bron.
?externekoppeling mim:doel ?doel.
?externekoppeling skos:notation ?code.
?bron skos:notation ?ownercode.
?doel skos:notation ?classcode.
}
}
}
- title: convert mim:PrimitiefDatatype
query: >
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
INSERT {
GRAPH <urn:output> {
?datatype a rdf:Datatype.
?datatype rdfs:label ?naam.
?datatype rdfs:seeAlso ?type.
}
}
WHERE {
SELECT (iri(concat("http://ontology.mim-namespace.org/def/modelname#",?code)) as ?datatype) ?naam ?type
WHERE {
GRAPH <urn:input> {
?type a mim:PrimitiefDatatype.
?type mim:naam ?naam.
?type skos:notation ?code.
}
}
}
- title: convert mim:GestructureerdDatatype
query: >
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
INSERT {
GRAPH <urn:output> {
?datatype a owl:Class, sh:NodeShape.
?datatype sh:targetClass ?datatype.
?datatype rdfs:label ?naam.
?datatype skos:notation ?code.
?datatype rdfs:seeAlso ?type.
}
}
WHERE {
SELECT (iri(concat("http://ontology.mim-namespace.org/def/modelname#",?code)) as ?datatype) ?naam ?type
WHERE {
GRAPH <urn:input> {
?type a mim:GestructureerdDatatype.
?type mim:naam ?naam.
?type skos:notation ?code.
}
}
}
- title: convert mim:Enumeratie
query: >
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
INSERT {
GRAPH <urn:output> {
?enumeratie a owl:Class, sh:NodeShape.
?enumeratie sh:targetClass ?enumeratie.
?enumeratie rdfs:subClassOf skos:Concept.
?enumeratie rdfs:label ?naam.
?enumeratie skos:notation ?code.
?enumeratie rdfs:seeAlso ?type.
}
}
WHERE {
SELECT (iri(concat("http://ontology.mim-namespace.org/def/modelname#",?code)) as ?enumeratie) ?naam ?type
WHERE {
GRAPH <urn:input> {
?type a mim:Enumeratie.
?type mim:naam ?naam.
?type skos:notation ?code.
}
}
}
- title: convert mim:Enumeratiewaarde
query: >
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
INSERT {
GRAPH <urn:output> {
?item a ?type.
?item rdfs:label ?naam.
?item rdfs:seeAlso ?waarde.
}
}
WHERE {
SELECT (iri(concat("http://ontology.mim-namespace.org/def/modelname#",?enum)) as ?type) (iri(concat("http://ontology.mim-namespace.org/def/modelname#",?code)) as ?item) ?naam ?waarde
WHERE {
GRAPH <urn:input> {
?enumeratie mim:waarde ?waarde.
?enumeratie skos:notation ?enum.
?waarde a mim:Enumeratiewaarde.
?waarde mim:naam ?naam.
?waarde skos:notation ?code.
}
}
}
- title: convert mim:RelatierolBron
query: >
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
INSERT {
GRAPH <urn:output> {
?property a owl:ObjectProperty.
?property rdfs:label ?naam.
?property rdfs:seeAlso ?relatierolbron.
?owner sh:property ?predicate.
?predicate a sh:PropertyShape.
?predicate sh:name ?code.
?predicate sh:path ?property.
?predicate sh:nodeKind sh:IRI.
?predicate sh:class ?class.
?predicate rdfs:seeAlso ?relatierolbron
}
}
WHERE {
SELECT (iri(concat("http://ontology.mim-namespace.org/def/modelname#",?code)) as ?property)
(iri(concat("http://ontology.mim-namespace.org/def/modelname#",?ownercode,".",?code)) as ?predicate)
(iri(concat("http://ontology.mim-namespace.org/def/modelname#",?ownercode)) as ?owner)
(iri(concat("http://ontology.mim-namespace.org/def/modelname#",?classcode)) as ?class)
?code ?naam ?relatierolbron
WHERE {
GRAPH <urn:input> {
?relatierolbron a mim:RelatierolBron.
?relatierolbron mim:naam ?naam.
?relatierolbron skos:notation ?code.
?relatiesoort mim:relatierol ?relatierolbron.
?relatiesoort mim:bron ?bron.
?relatiesoort mim:doel ?doel.
?doel skos:notation ?ownercode.
?bron skos:notation ?classcode.
}
}
}
- title: convert mim:RelatierolDoel
query: >
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
INSERT {
GRAPH <urn:output> {
?property a owl:ObjectProperty.
?property rdfs:label ?naam.
?property rdfs:seeAlso ?relatieroldoel.
?owner sh:property ?predicate.
?predicate a sh:PropertyShape.
?predicate sh:name ?code.
?predicate sh:path ?property.
?predicate sh:nodeKind sh:IRI.
?predicate sh:class ?class.
?predicate rdfs:seeAlso ?relatieroldoel.
?predicate mim:equivalent ?relatiesoort.
}
}
WHERE {
SELECT (iri(concat("http://ontology.mim-namespace.org/def/modelname#",?code)) as ?property)
(iri(concat("http://ontology.mim-namespace.org/def/modelname#",?ownercode,".",?code)) as ?predicate)
(iri(concat("http://ontology.mim-namespace.org/def/modelname#",?ownercode)) as ?owner)
(iri(concat("http://ontology.mim-namespace.org/def/modelname#",?classcode)) as ?class)
?code ?naam ?relatieroldoel ?relatiesoort
WHERE {
GRAPH <urn:input> {
?relatieroldoel a mim:RelatierolDoel.
?relatieroldoel mim:naam ?naam.
?relatieroldoel skos:notation ?code.
?relatiesoort mim:relatierol ?relatieroldoel.
?relatiesoort mim:bron ?bron.
?relatiesoort mim:doel ?doel.
?doel skos:notation ?classcode.
?bron skos:notation ?ownercode.
}
}
}
- title: convert mim:RelatierolDoel of mim:Relatieklasse
query: >
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
INSERT {
GRAPH <urn:output> {
?statement rdfs:subClassOf rdf:Statement.
?statement sh:property ?subjectps.
?statement sh:property ?predicateps.
?statement sh:property ?objectps.
?predicateps a sh:PropertyShape.
?predicateps sh:path rdf:predicate.
?predicateps sh:hasValue ?predicate.
?predicateps sh:minCount 1 .
?predicateps sh:maxCount 1 .
?subjectps a sh:PropertyShape.
?subjectps sh:path rdf:subject.
?subjectps sh:nodeKind sh:IRI.
?subjectps sh:class ?subject.
?objectps a sh:PropertyShape.
?objectps sh:path rdf:object.
?objectps sh:nodeKind sh:IRI.
?objectps sh:class ?object.
}
}
WHERE {
SELECT (iri(concat("http://ontology.mim-namespace.org/def/modelname#",?code)) as ?statement)
(iri(concat("http://ontology.mim-namespace.org/def/modelname#",?objectcode)) as ?object)
(iri(concat("http://ontology.mim-namespace.org/def/modelname#",?subjectcode)) as ?subject)
(iri(concat("http://ontology.mim-namespace.org/def/modelname#",?predicatecode)) as ?predicate)
(iri(concat("http://ontology.mim-namespace.org/def/modelname#",?code,".object")) as ?objectps)
(iri(concat("http://ontology.mim-namespace.org/def/modelname#",?code,".subject")) as ?subjectps)
(iri(concat("http://ontology.mim-namespace.org/def/modelname#",?code,".predicate")) as ?predicateps)
?code ?naam ?relatieroldoel
WHERE {
GRAPH <urn:input> {
?relatieroldoel a mim:RelatierolDoel.
?relatieroldoel skos:notation ?predicatecode.
?relatieklasse a mim:Relatieklasse.
?relatieklasse mim:relatierol ?relatieroldoel.
?relatieklasse mim:bron ?bron.
?relatieklasse mim:doel ?doel.
?relatieklasse skos:notation ?code.
?doel skos:notation ?objectcode.
?bron skos:notation ?subjectcode.
}
}
}
- title: convert mim:Gegevensgroep
query: >
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
INSERT {
GRAPH <urn:output> {
?property a owl:ObjectProperty.
?property rdfs:label ?naam.
?property rdfs:seeAlso ?attribuutsoort.
?ownershape sh:property ?predicate.
?predicate a sh:PropertyShape.
?predicate sh:name ?code.
?predicate sh:path ?property.
?predicate sh:nodeKind sh:BlankNode.
?predicate sh:class ?class.
?predicate rdfs:seeAlso ?gegevensgroep
}
}
WHERE {
SELECT (iri(concat("http://ontology.mim-namespace.org/def/modelname#",?code)) as ?property)
(iri(concat("http://ontology.mim-namespace.org/def/modelname#",?ownercode,".",?code)) as ?predicate)
(iri(concat("http://ontology.mim-namespace.org/def/modelname#",?ownercode)) as ?ownershape)
(iri(concat("http://ontology.mim-namespace.org/def/modelname#",?typecode)) as ?class)
?code ?naam ?gegevensgroep
WHERE {
GRAPH <urn:input> {
?owner a mim:Objecttype.
?owner mim:gegevensgroep ?gegevensgroep.
?owner skos:notation ?ownercode.
?gegevensgroep a mim:Gegevensgroep.
?gegevensgroep mim:naam ?naam.
?gegevensgroep mim:gegevensgroeptype ?type.
?gegevensgroep skos:notation ?code.
?type skos:notation ?typecode.
}
}
}
- title: convert mim:Referentielijst
query: >
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
INSERT {
GRAPH <urn:output> {
?class a owl:Class, sh:NodeShape.
?class sh:targetClass ?class.
?class rdfs:label ?naam.
?class skos:notation ?code.
?class rdfs:seeAlso ?referentielijst.
}
}
WHERE {
SELECT (iri(concat("http://ontology.mim-namespace.org/def/modelname#",?code)) as ?class) ?code ?naam ?referentielijst
WHERE {
GRAPH <urn:input> {
?referentielijst a mim:Referentielijst.
?referentielijst mim:naam ?naam.
?referentielijst skos:notation ?code.
}
}
}
- title: convert mim:Codelijst
query: >
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
INSERT {
GRAPH <urn:output> {
?class a owl:Class, sh:NodeShape.
?class sh:targetClass ?class.
?class rdfs:label ?naam.
?class skos:notation ?code.
?class rdfs:seeAlso ?codelijst.
}
}
WHERE {
SELECT (iri(concat("http://ontology.mim-namespace.org/def/modelname#",?code)) as ?class) ?code ?naam ?codelijst
WHERE {
GRAPH <urn:input> {
?codelijst a mim:Codelijst.
?codelijst mim:naam ?naam.
?codelijst skos:notation ?code.
}
}
}
- title: convert mim:Generalisatie
query: >
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
INSERT {
GRAPH <urn:output> {
?subclass rdfs:subClassOf ?superclass
}
}
WHERE {
GRAPH <urn:input> {
?generalisatie a mim:Generalisatie.
?generalisatie mim:subtype ?subtype.
?generalisatie mim:supertype ?supertype.
}
GRAPH <urn:output> {
?subclass rdfs:seeAlso ?subtype.
?superclass rdfs:seeAlso ?supertype.
}
}
- title: convert mim:begrip
query: >
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
PREFIX dct: <http://purl.org/dc/terms/>
INSERT {
GRAPH <urn:output> {
?element dct:subject ?begrip
}
}
WHERE {
GRAPH <urn:input> {
?item mim:begrip ?begrip
}
GRAPH <urn:output> {
?element rdfs:seeAlso ?item
}
}
- title: convert mim:definitie
query: >
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
INSERT {
GRAPH <urn:output> {
?element rdfs:comment ?definitie
}
}
WHERE {
GRAPH <urn:input> {
?item mim:definitie ?definitie
}
GRAPH <urn:output> {
?element rdfs:seeAlso ?item
}
}
- title: convert mim:formeelPatroon
query: >
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
INSERT {
GRAPH <urn:output> {
?element sh:pattern ?patroon
}
}
WHERE {
GRAPH <urn:input> {
?item mim:formeelPatroon ?patroon
}
GRAPH <urn:output> {
?element rdfs:seeAlso ?item
}
}
- title: convert mim:type (mim:PrimitiefDatatype)
query: >
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
INSERT {
GRAPH <urn:output> {
?pshape sh:datatype ?datatype.
?pshape sh:nodeKind sh:Literal.
}
}
WHERE {
{
GRAPH <urn:input> {
?item mim:type ?type.
?type a mim:PrimitiefDatatype.
FILTER NOT EXISTS {?type owl:sameAs ?datatype}
}
GRAPH <urn:output> {
?pshape a sh:PropertyShape.
?pshape rdfs:seeAlso ?item.
?datatype rdfs:seeAlso ?type.
}
}
UNION
{
GRAPH <urn:input> {
?item mim:type ?type.
?type a mim:PrimitiefDatatype.
?type owl:sameAs ?datatype
}
GRAPH <urn:output> {
?pshape a sh:PropertyShape.
?pshape rdfs:seeAlso ?item.
}
}
}
- title: convert mim:type (mim:GestructureerdDatatype)
query: >
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
INSERT {
GRAPH <urn:output> {
?pshape sh:class ?datatype.
?pshape sh:nodeKind sh:BlankNode.
}
}
WHERE {
GRAPH <urn:input> {
?item mim:type ?type.
?type a mim:GestructureerdDatatype.
}
GRAPH <urn:output> {
?pshape a sh:PropertyShape.
?pshape rdfs:seeAlso ?item.
?datatype rdfs:seeAlso ?type.
}
}
- title: convert mim:type (mim:Enumeratie)
query: >
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
INSERT {
GRAPH <urn:output> {
?pshape sh:class ?enumeratie.
}
}
WHERE {
GRAPH <urn:input> {
?item mim:type ?type.
?type a mim:Enumeratie.
}
GRAPH <urn:output> {
?pshape a sh:PropertyShape.
?pshape rdfs:seeAlso ?item.
?enumeratie rdfs:seeAlso ?type.
}
}
- title: convert mim:type (mim:Referentielijst)
query: >
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
INSERT {
GRAPH <urn:output> {
?pshape sh:class ?refclass
}
}
WHERE {
GRAPH <urn:input> {
?item mim:type ?type.
?type a mim:Referentielijst.
}
GRAPH <urn:output> {
?pshape a sh:PropertyShape.
?pshape rdfs:seeAlso ?item.
?refclass rdfs:seeAlso ?type.
}
}
- title: convert mim:type (mim:Codelijst)
query: >
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
INSERT {
GRAPH <urn:output> {
?pshape sh:class ?refclass
}
}
WHERE {
GRAPH <urn:input> {
?item mim:type ?type.
?type a mim:Codelijst.
}
GRAPH <urn:output> {
?pshape a sh:PropertyShape.
?pshape rdfs:seeAlso ?item.
?refclass rdfs:seeAlso ?type.
}
}
- title: change owl:DatatypeProperty to owl:ObjectProperty for non-primitive datatypes
query: >
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
DELETE {
GRAPH <urn:output> {
?property a owl:DatatypeProperty
}
}
INSERT {
GRAPH <urn:output> {
?property a owl:ObjectProperty
}
}
WHERE {
GRAPH <urn:output> {
?pshape a sh:PropertyShape.
?pshape sh:class ?class.
?pshape sh:path ?property.
}
}
- title: convert mim:lengte (minimum)
query: >
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
INSERT {
GRAPH <urn:output> {
?pshape sh:minLength ?minlength.
}
}
WHERE {
{
SELECT ?pshape (strdt(strbefore(concat(?lengte,".."),".."), xsd:integer) as ?minlength)
WHERE {
GRAPH <urn:input> {
?element mim:lengte ?lengte
}
GRAPH <urn:output> {
?pshape a sh:PropertyShape.
?pshape rdfs:seeAlso ?element
}
}
}
FILTER (?minlength>0)
}
- title: convert mim:lengte (maximum)
query: >
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
INSERT {
GRAPH <urn:output> {
?pshape sh:maxLength ?maxlength.
}
}
WHERE {
{
SELECT ?pshape (strdt(strafter(?lengte,".."), xsd:integer) as ?maxlength)
WHERE {
GRAPH <urn:input> {
?element mim:lengte ?lengte
}
GRAPH <urn:output> {
?pshape a sh:PropertyShape.
?pshape rdfs:seeAlso ?element
}
}
}
FILTER (?maxlength>0)
}
- title: convert mim:kardinaliteit (minimum)
query: >
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
INSERT {
GRAPH <urn:output> {
?pshape sh:minCount ?mincount.
}
}
WHERE {
{
SELECT ?pshape (strdt(strbefore(concat(?kardinaliteit,".."),".."), xsd:integer) as ?mincount)
WHERE {
GRAPH <urn:input> {
?element mim:kardinaliteit ?kardinaliteit
}
GRAPH <urn:output> {
?pshape a sh:PropertyShape.
?pshape rdfs:seeAlso ?element
}
}
}
FILTER (?mincount>0)
}
- title: convert mim:kardinaliteit (maximum)
query: >
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
INSERT {
GRAPH <urn:output> {
?pshape sh:maxCount ?maxcount.
}
}
WHERE {
{
SELECT ?pshape (strdt(replace(strafter(if(regex(?kardinaliteit,"\\.\\."),?kardinaliteit,concat(?kardinaliteit,"..",?kardinaliteit)),".."),"\\*","-1"), xsd:integer) as ?maxcount)
WHERE {
GRAPH <urn:input> {
?element mim:kardinaliteit ?kardinaliteit
}
GRAPH <urn:output> {
{
?pshape a sh:PropertyShape.
?pshape rdfs:seeAlso ?element
}
UNION
{
?pshape a sh:PropertyShape.
?pshape rdfs:seeAlso ?relatiesoort.
?relatiesoort mim:relatierol ?element
}
}
}
}
FILTER (?maxcount>0)
}
- title: convert mim:bevatModelelement for mim:Packages
query: >
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
INSERT {
GRAPH <urn:output> {
?ontology owl:imports ?import
}
}
WHERE {
GRAPH <urn:input> {
?parent mim:bevatModelelement ?item.
}
GRAPH <urn:output> {
?ontology a owl:Ontology.
?import a owl:Ontology.
?ontology rdfs:seeAlso ?parent.
?import rdfs:seeAlso ?item.
}
}
- title: convert mim:bevatModelelement for other modelelements
query: >
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
INSERT {
GRAPH <urn:output> {
?element rdfs:isDefinedBy ?ontology
}
}
WHERE {
GRAPH <urn:input> {
?parent mim:bevatModelelement ?item.
}
GRAPH <urn:output> {
?ontology a owl:Ontology.
?ontology rdfs:seeAlso ?parent.
?element rdfs:seeAlso ?item.
?element a ?elementtype
FILTER (?elementtype=owl:Class || ?elementtype=owl:DatatypeProperty || ?elementtype=owl:ObjectProperty)
}
}
- title: remove rdfs:seeAlso / Add mim:equivalent
query: >
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX mim: <http://bp4mc2.org/def/mim#>
DELETE {
GRAPH <urn:output> {
?s rdfs:seeAlso ?o
}
}
INSERT {
GRAPH <urn:output> {
?s mim:equivalent ?o
}
}
WHERE {
GRAPH <urn:output> {
?s rdfs:seeAlso ?o
}
}