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,12 +333,18 @@ 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.linkedPredicate("fhir:nodeRole", "fhir:treeRoot", linkResolver == null ? null : linkResolver.resolvePage("rdf.html#tree-root"), null); Subject subject;
if (hasModifierExtension)
subject = section.triple(subjId, "a", "fhir:_" + e.getType());
else
subject = section.triple(subjId, "a", "fhir:" + e.getType());
for (Element child : e.getChildren()) { subject.linkedPredicate("fhir:nodeRole", "fhir:treeRoot", linkResolver == null ? null : linkResolver.resolvePage("rdf.html#tree-root"), null);
composeElement(section, subject, child, null);
} for (Element child : e.getChildren()) {
composeElement(section, subject, child, null);
}
} }