Skip to content

Commit 5ca8056

Browse files
logic for visualizing imported relations
1 parent 2398e53 commit 5ca8056

File tree

1 file changed

+9
-4
lines changed
  • io.opencaesar.rosetta.sirius.viewpoint/src/io/opencaesar/rosetta/sirius/viewpoint/internal

1 file changed

+9
-4
lines changed

io.opencaesar.rosetta.sirius.viewpoint/src/io/opencaesar/rosetta/sirius/viewpoint/internal/OmlViewpoint.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,15 @@ public static Set<SpecializableTerm> getVisualizedTerms(Vocabulary vocabulary) {
249249
.map(s -> s.getSpecializedTerm())
250250
.collect(Collectors.toSet()));
251251
// related terms
252-
terms.addAll(vocabulary.getOwnedStatements().stream()
253-
.filter(e -> e instanceof RelationEntity)
252+
terms.addAll(
253+
OmlRead
254+
.getAllImportedOntologies(vocabulary, true).stream()
255+
.filter(o -> o instanceof Vocabulary)
256+
.map(v -> (Vocabulary)v)
257+
.flatMap(v -> v.getOwnedStatements().stream())
258+
.filter(t -> t instanceof RelationEntity)
254259
.map(e -> (RelationEntity)e)
255-
.flatMap(r -> Stream.of(r.getSource(), r.getTarget()))
260+
.flatMap(r -> Stream.of(r, r.getSource(), r.getTarget()))
256261
.collect(Collectors.toSet()));
257262
// range restricted entities
258263
terms.addAll(vocabulary.getOwnedStatements().stream()
@@ -407,7 +412,7 @@ public static String getLabel(Ontology ontology, DifferentFromPredicate predicat
407412
}
408413

409414
public static String getLabel(RelationRangeRestrictionAxiom axiom) {
410-
String q = (axiom.getKind() == RangeRestrictionKind.ALL) ? "" : "";
415+
String q = (axiom.getKind() == RangeRestrictionKind.ALL) ? "\u2200" : "\u2203";
411416
return q + getLabel(axiom.getOntology(), axiom.getRelation());
412417
}
413418

0 commit comments

Comments
 (0)