use of org.hl7.fhir.dstu3.utils.formats.Turtle.TTLObject in project org.hl7.fhir.core by hapifhir.
the class TurtleParser method parseChildren.
private void parseChildren(Turtle src, String path, TTLComplex object, Element element, boolean primitive) throws FHIRException {
List<Property> properties = element.getProperty().getChildProperties(element.getName(), null);
Set<String> processed = new HashSet<String>();
if (primitive)
processed.add(FHIR_URI_BASE + "value");
// first pass: process the properties
for (Property property : properties) {
if (property.isChoice()) {
for (TypeRefComponent type : property.getDefinition().getType()) {
String eName = property.getName().substring(0, property.getName().length() - 3) + Utilities.capitalize(type.getCode());
parseChild(src, object, element, processed, property, path, getFormalName(property, eName));
}
} else {
parseChild(src, object, element, processed, property, path, getFormalName(property));
}
}
// second pass: check for things not processed
if (policy != ValidationPolicy.NONE) {
for (String u : object.getPredicates().keySet()) {
if (!processed.contains(u)) {
TTLObject n = object.getPredicates().get(u);
logError(n.getLine(), n.getCol(), path, IssueType.STRUCTURE, context.formatMessage(I18nConstants.UNRECOGNISED_PREDICATE_, u), IssueSeverity.ERROR);
}
}
}
}
Aggregations