Use leading underscore for properties with objects with modifier extensions.

This commit is contained in:
Jim Balhoff 2023-02-01 19:49:24 -05:00
parent 12bf57886f
commit d596a6c343
1 changed files with 10 additions and 4 deletions

View File

@ -333,9 +333,8 @@ public class TurtleParser extends ParserBase {
}
String subjId = genSubjectId(e);
boolean hasModifierExtension = e.getChildren().stream().anyMatch(p -> p.getName().equals("modifierExtension"));
Subject subject;
if (hasModifierExtension)
if (hasModifierExtension(e))
subject = section.triple(subjId, "a", "fhir:_" + e.getType());
else
subject = section.triple(subjId, "a", "fhir:" + e.getType());
@ -348,6 +347,10 @@ public class TurtleParser extends ParserBase {
}
private boolean hasModifierExtension(Element e) {
return e.getChildren().stream().anyMatch(p -> p.getName().equals("modifierExtension"));
}
protected String getURIType(String uri) {
if(uri.startsWith("<" + FHIR_URI_BASE))
if(uri.substring(FHIR_URI_BASE.length() + 1).contains("/"))
@ -480,7 +483,10 @@ public class TurtleParser extends ParserBase {
if (en.endsWith("[x]"))
en = en.substring(0, en.length()-3);
return en;
if (hasModifierExtension(element))
return "_" + en;
else
return en;
}
static public String ttlLiteral(String value, String type) {