Skip to content

Commit

Permalink
Do not fail upon encountering a bogus range.
Browse files Browse the repository at this point in the history
When parsing an ID range file, do not fail if we encounter a single
range with an invalid definition.

Instead, wait until the entire file has been parsed, and fail if we
could not find a single valid range.
  • Loading branch information
gouttegd committed Mar 25, 2024
1 parent b735ad7 commit 7f91921
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,16 @@ public IIDRangePolicy parse() throws IDRangePolicyException {

for ( OWLDatatypeDefinitionAxiom ax : ont.getDatatypeDefinitions(datatype) ) {
IDRange range = ax.getDataRange().accept(visitor);
if ( range == null ) {
throw new IDRangePolicyException("Invalid range definition");
if ( range != null ) {
policy.ranges.put(name, range);
}
policy.ranges.put(name, range);
}
}

if ( policy.ranges.isEmpty() ) {
throw new IDRangePolicyException("No correct ranges found in ID range policy");
}

return policy;
}

Expand Down

0 comments on commit 7f91921

Please sign in to comment.