Use leading underscore for properties with objects with modifier extensions.
This commit is contained in:
parent
12bf57886f
commit
d596a6c343
|
@ -333,9 +333,8 @@ public class TurtleParser extends ParserBase {
|
||||||
}
|
}
|
||||||
String subjId = genSubjectId(e);
|
String subjId = genSubjectId(e);
|
||||||
|
|
||||||
boolean hasModifierExtension = e.getChildren().stream().anyMatch(p -> p.getName().equals("modifierExtension"));
|
|
||||||
Subject subject;
|
Subject subject;
|
||||||
if (hasModifierExtension)
|
if (hasModifierExtension(e))
|
||||||
subject = section.triple(subjId, "a", "fhir:_" + e.getType());
|
subject = section.triple(subjId, "a", "fhir:_" + e.getType());
|
||||||
else
|
else
|
||||||
subject = section.triple(subjId, "a", "fhir:" + e.getType());
|
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) {
|
protected String getURIType(String uri) {
|
||||||
if(uri.startsWith("<" + FHIR_URI_BASE))
|
if(uri.startsWith("<" + FHIR_URI_BASE))
|
||||||
if(uri.substring(FHIR_URI_BASE.length() + 1).contains("/"))
|
if(uri.substring(FHIR_URI_BASE.length() + 1).contains("/"))
|
||||||
|
@ -480,7 +483,10 @@ public class TurtleParser extends ParserBase {
|
||||||
if (en.endsWith("[x]"))
|
if (en.endsWith("[x]"))
|
||||||
en = en.substring(0, en.length()-3);
|
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) {
|
static public String ttlLiteral(String value, String type) {
|
||||||
|
|
Loading…
Reference in New Issue