For resources with a modifierExtension, use a leading underscore for the rdf:type.

This commit is contained in:
Jim Balhoff 2023-02-01 13:05:47 -05:00
parent 5dc19cd052
commit 12bf57886f
1 changed files with 11 additions and 5 deletions

View File

@ -333,7 +333,13 @@ public class TurtleParser extends ParserBase {
} }
String subjId = genSubjectId(e); String subjId = genSubjectId(e);
Subject subject = section.triple(subjId, "a", "fhir:" + e.getType()); boolean hasModifierExtension = e.getChildren().stream().anyMatch(p -> p.getName().equals("modifierExtension"));
Subject subject;
if (hasModifierExtension)
subject = section.triple(subjId, "a", "fhir:_" + e.getType());
else
subject = section.triple(subjId, "a", "fhir:" + e.getType());
subject.linkedPredicate("fhir:nodeRole", "fhir:treeRoot", linkResolver == null ? null : linkResolver.resolvePage("rdf.html#tree-root"), null); subject.linkedPredicate("fhir:nodeRole", "fhir:treeRoot", linkResolver == null ? null : linkResolver.resolvePage("rdf.html#tree-root"), null);
for (Element child : e.getChildren()) { for (Element child : e.getChildren()) {