Skip to content

Commit 3f15c56

Browse files
committed
Added Instance Classes to fix that notifies users of it's placeholderiness.
1 parent 8ff9b5c commit 3f15c56

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

src/model/conversion/ttl/Converter.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
import java.util.stream.Collectors;
99
import java.util.stream.Stream;
1010

11+
import static model.conceptual.Vertex.GraphElemType.*;
12+
1113
/**
1214
* Class that is responsible for the conversion of a visual graph into a .ttl string.
1315
*/
@@ -68,20 +70,20 @@ private static String getFixes() {
6870
fixString.append(".\n");
6971
}
7072

71-
// reminding the user that instance literals will be replaced by their corresponding instance level data when
73+
// reminding the user that instance elements will be replaced by their corresponding instance level data when
7274
// converted to instance-level .ttl.
73-
if (classes.stream().anyMatch(c -> c.getElementType() == Vertex.GraphElemType.INSTANCE_LITERAL)){
74-
fixString.append("# The following Literals are placeholders for instance-level data that will be populate" +
75-
"d during instance-level .ttl creation: \n# ");
75+
if (classes.stream().anyMatch(c -> c.getElementType() == INSTANCE_LITERAL)){
76+
fixString.append("# The following Elements are placeholders for instance-level data that will be populate" +
77+
"d during instance-level .ttl creation: \n# ");
7678
classes.stream()
77-
.filter(c -> c.getElementType() == Vertex.GraphElemType.INSTANCE_LITERAL)
79+
.filter(c -> c.getElementType() == INSTANCE_LITERAL || c.getElementType() == INSTANCE_CLASS)
7880
.forEach(c -> fixString.append(c.getName()).append(", "));
7981
fixString.delete(fixString.length() - 2, fixString.length());
8082
fixString.append(".\n");
8183
}
8284

8385
Stream<String> ttlClassPrefixesStream = classes.stream()
84-
.filter(c -> c.getElementType() == Vertex.GraphElemType.GLOBAL_CLASS && !c.isIri())
86+
.filter(c -> c.getElementType() == GLOBAL_CLASS && !c.isIri())
8587
.map(c -> c.getName().split(":")[0]);
8688
Stream<String> ttlPropPrefixesStream = properties.stream()
8789
.filter(p -> !p.isIri())
@@ -265,7 +267,7 @@ private static String convertGClasses() {
265267
for (Vertex graphClass : classes) {
266268
isBlanknode = config.get(1) && graphClass.isBlank();
267269

268-
if (graphClass.getElementType() == Vertex.GraphElemType.GLOBAL_CLASS && !isBlanknode)
270+
if (graphClass.getElementType() == GLOBAL_CLASS && !isBlanknode)
269271
classStrs.append(convertTriple(graphClass));
270272
}
271273

@@ -407,7 +409,7 @@ private static String convertObject(Vertex object) {
407409
dedentTab();
408410
objectStr += tabs + "]";
409411
} else objectStr = "[" + predicateObjectList + "]";
410-
} else if (object.getElementType() == Vertex.GraphElemType.INSTANCE_LITERAL) {
412+
} else if (object.getElementType() == INSTANCE_LITERAL) {
411413
String dataType = object.getDataType();
412414
objectStr = "\"" + objectStr + "\"" +
413415
(dataType != null && dataType.length() != 0 ? "^^" + object.getDataType() : "");

0 commit comments

Comments
 (0)