29
29
import org .eclipse .core .resources .IFile ;
30
30
import org .eclipse .core .resources .ResourcesPlugin ;
31
31
import org .eclipse .core .runtime .Path ;
32
- import org .eclipse .draw2d .IFigure ;
33
32
import org .eclipse .emf .common .util .URI ;
34
33
import org .eclipse .emf .ecore .EObject ;
35
- import org .eclipse .emf .ecore .plugin .EcorePlugin ;
36
34
import org .eclipse .emf .ecore .resource .Resource ;
37
- import org .eclipse .swt .graphics .Image ;
38
- import org .eclipse .swt .widgets .Display ;
39
35
import org .eclipse .ui .IEditorPart ;
40
36
import org .eclipse .ui .IWorkbenchPage ;
41
37
import org .eclipse .ui .PartInitException ;
66
62
import io .opencaesar .oml .Ontology ;
67
63
import io .opencaesar .oml .Predicate ;
68
64
import io .opencaesar .oml .PropertyValueAssertion ;
69
- import io .opencaesar .oml .QuotedLiteral ;
70
65
import io .opencaesar .oml .RangeRestrictionKind ;
71
66
import io .opencaesar .oml .RelationCardinalityRestrictionAxiom ;
72
67
import io .opencaesar .oml .RelationEntity ;
@@ -391,7 +386,7 @@ public static boolean hasNWDecoration(EObject e) {
391
386
392
387
public static String getNWDecorationImage (EObject e ) {
393
388
return getConceptInstanceForVocabularyAnnotationPropertyValue (e ,
394
- URI . createURI ( "http://opencaesar.io/viewpoint" ) , "http://opencaesar.io/viewpoint#decoration-nw" );
389
+ "http://opencaesar.io/viewpoint" , "http://opencaesar.io/viewpoint#decoration-nw" );
395
390
}
396
391
397
392
public static boolean hasNEDecoration (EObject e ) {
@@ -400,7 +395,7 @@ public static boolean hasNEDecoration(EObject e) {
400
395
401
396
public static String getNEDecorationImage (EObject e ) {
402
397
return getConceptInstanceForVocabularyAnnotationPropertyValue (e ,
403
- URI . createURI ( "http://opencaesar.io/viewpoint" ) , "http://opencaesar.io/viewpoint#decoration-ne" );
398
+ "http://opencaesar.io/viewpoint" , "http://opencaesar.io/viewpoint#decoration-ne" );
404
399
}
405
400
406
401
public static boolean hasSWDecoration (EObject e ) {
@@ -409,7 +404,7 @@ public static boolean hasSWDecoration(EObject e) {
409
404
410
405
public static String getSWDecorationImage (EObject e ) {
411
406
return getConceptInstanceForVocabularyAnnotationPropertyValue (e ,
412
- URI . createURI ( "http://opencaesar.io/viewpoint" ) , "http://opencaesar.io/viewpoint#decoration-sw" );
407
+ "http://opencaesar.io/viewpoint" , "http://opencaesar.io/viewpoint#decoration-sw" );
413
408
}
414
409
415
410
public static boolean hasSEDecoration (EObject e ) {
@@ -418,7 +413,7 @@ public static boolean hasSEDecoration(EObject e) {
418
413
419
414
public static String getSEDecorationImage (EObject e ) {
420
415
return getConceptInstanceForVocabularyAnnotationPropertyValue (e ,
421
- URI . createURI ( "http://opencaesar.io/viewpoint" ) , "http://opencaesar.io/viewpoint#decoration-se" );
416
+ "http://opencaesar.io/viewpoint" , "http://opencaesar.io/viewpoint#decoration-se" );
422
417
}
423
418
424
419
public static boolean hasCDecoration (EObject e ) {
@@ -427,7 +422,7 @@ public static boolean hasCDecoration(EObject e) {
427
422
428
423
public static String getCDecorationImage (EObject e ) {
429
424
return getConceptInstanceForVocabularyAnnotationPropertyValue (e ,
430
- URI . createURI ( "http://opencaesar.io/viewpoint" ) , "http://opencaesar.io/viewpoint#decoration-c" );
425
+ "http://opencaesar.io/viewpoint" , "http://opencaesar.io/viewpoint#decoration-c" );
431
426
}
432
427
433
428
public static boolean hasNDecoration (EObject e ) {
@@ -436,7 +431,7 @@ public static boolean hasNDecoration(EObject e) {
436
431
437
432
public static String getNDecorationImage (EObject e ) {
438
433
return getConceptInstanceForVocabularyAnnotationPropertyValue (e ,
439
- URI . createURI ( "http://opencaesar.io/viewpoint" ) , "http://opencaesar.io/viewpoint#decoration-n" );
434
+ "http://opencaesar.io/viewpoint" , "http://opencaesar.io/viewpoint#decoration-n" );
440
435
}
441
436
442
437
public static boolean hasSDecoration (EObject e ) {
@@ -445,7 +440,7 @@ public static boolean hasSDecoration(EObject e) {
445
440
446
441
public static String getSDecorationImage (EObject e ) {
447
442
return getConceptInstanceForVocabularyAnnotationPropertyValue (e ,
448
- URI . createURI ( "http://opencaesar.io/viewpoint" ) , "http://opencaesar.io/viewpoint#decoration-s" );
443
+ "http://opencaesar.io/viewpoint" , "http://opencaesar.io/viewpoint#decoration-s" );
449
444
}
450
445
451
446
public static boolean hasEDecoration (EObject e ) {
@@ -454,7 +449,7 @@ public static boolean hasEDecoration(EObject e) {
454
449
455
450
public static String getEDecorationImage (EObject e ) {
456
451
return getConceptInstanceForVocabularyAnnotationPropertyValue (e ,
457
- URI . createURI ( "http://opencaesar.io/viewpoint" ) , "http://opencaesar.io/viewpoint#decoration-e" );
452
+ "http://opencaesar.io/viewpoint" , "http://opencaesar.io/viewpoint#decoration-e" );
458
453
}
459
454
460
455
public static boolean hasWDecoration (EObject e ) {
@@ -463,15 +458,15 @@ public static boolean hasWDecoration(EObject e) {
463
458
464
459
public static String getWDecorationImage (EObject e ) {
465
460
return getConceptInstanceForVocabularyAnnotationPropertyValue (e ,
466
- URI . createURI ( "http://opencaesar.io/viewpoint" ) , "http://opencaesar.io/viewpoint#decoration-w" );
461
+ "http://opencaesar.io/viewpoint" , "http://opencaesar.io/viewpoint#decoration-w" );
467
462
}
468
463
469
- public static String getConceptInstanceForVocabularyAnnotationPropertyValue (EObject e , URI annotationVocabulary ,
464
+ public static String getConceptInstanceForVocabularyAnnotationPropertyValue (EObject e , String annotationVocabulary ,
470
465
String annotationPropertyIRI ) {
471
466
if (!(e instanceof ConceptInstance ))
472
467
return null ;
473
468
ConceptInstance ci = (ConceptInstance ) e ;
474
- URI uri = OmlRead .getResolvedUri (ci .eResource (), annotationVocabulary );
469
+ URI uri = OmlRead .getUriByIri (ci .eResource (), annotationVocabulary );
475
470
Resource r = ci .eResource ().getResourceSet ().getResource (uri , true );
476
471
Member p = OmlRead .getMemberByIri (r , annotationPropertyIRI );
477
472
if (p instanceof AnnotationProperty ) {
@@ -504,7 +499,7 @@ public static boolean checkConceptInstanceForVocabularyAnnotationPropertyValue(E
504
499
if (cts .size () == 1 ) {
505
500
ConceptTypeAssertion a = cts .get (0 );
506
501
Concept c = a .getType ();
507
- var property = (AnnotationProperty ) OmlRead .getMemberByIri (c , annotationPropertyIRI );
502
+ var property = (AnnotationProperty ) OmlRead .getMemberByIri (c . eResource (). getResourceSet () , annotationPropertyIRI );
508
503
Literal value = OmlSearch .findAnnotationValue (c , property );
509
504
Object v = OmlRead .getValue (value );
510
505
if (v instanceof String ) {
@@ -526,7 +521,7 @@ public static boolean checkConceptInstanceForDescriptionAnnotationPropertyValue(
526
521
if (!(e instanceof ConceptInstance ))
527
522
return false ;
528
523
ConceptInstance ci = (ConceptInstance ) e ;
529
- var property = (AnnotationProperty ) OmlRead .getMemberByIri (ci , annotationPropertyIRI );
524
+ var property = (AnnotationProperty ) OmlRead .getMemberByIri (ci . eResource (). getResourceSet () , annotationPropertyIRI );
530
525
Literal value = OmlSearch .findAnnotationValue (ci , property );
531
526
Object v = OmlRead .getValue (value );
532
527
if (v instanceof String ) {
0 commit comments