Skip to content

Commit

Permalink
Allow saving of empty linearization parent.
Browse files Browse the repository at this point in the history
  • Loading branch information
soimugeo committed Oct 21, 2024
1 parent a0c6ca7 commit c758079
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
import edu.stanford.protege.webprotege.linearizationservice.events.*;
import edu.stanford.protege.webprotege.linearizationservice.model.*;
import org.semanticweb.owlapi.model.IRI;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.*;
import org.springframework.stereotype.Component;

import java.util.*;
Expand All @@ -15,6 +14,7 @@ public class LinearizationEventMapper {


private final static Logger LOGGER = LoggerFactory.getLogger(LinearizationEventMapper.class);

public Set<LinearizationEvent> mapLinearizationSpecificationsToEvents(WhoficEntityLinearizationSpecification linearizationSpecification) {
if (linearizationSpecification.linearizationSpecifications() != null) {
return linearizationSpecification.linearizationSpecifications()
Expand Down Expand Up @@ -107,7 +107,7 @@ private void addLinearizationParentEvent(List<LinearizationSpecificationEvent> e
}

private void addLinearizationParentEvent(List<LinearizationSpecificationEvent> events, LinearizationSpecification specification, LinearizationSpecification oldSpecification) {
if ((specification.getLinearizationParent() != null && !specification.getLinearizationParent().isEmpty())
if ((specification.getLinearizationParent() != null)
&& (oldSpecification == null || oldSpecification.getLinearizationParent() == null || !oldSpecification.getLinearizationParent().equals(specification.getLinearizationParent()))) {
events.add(new SetLinearizationParent(specification.getLinearizationParent().toString(), specification.getLinearizationView().toString()));
}
Expand Down

0 comments on commit c758079

Please sign in to comment.