Skip to content

Method: overrides(TransactionalChange)

1: /*
2: * JOPA
3: * Copyright (C) 2024 Czech Technical University in Prague
4: *
5: * This library is free software; you can redistribute it and/or
6: * modify it under the terms of the GNU Lesser General Public
7: * License as published by the Free Software Foundation; either
8: * version 3.0 of the License, or (at your option) any later version.
9: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library.
17: */
18: package cz.cvut.kbss.ontodriver.owlapi.change;
19:
20: import org.semanticweb.owlapi.model.OWLOntology;
21: import org.semanticweb.owlapi.model.OWLOntologyChange;
22:
23: import java.util.List;
24:
25: /**
26: * Represents a change in data made during a transaction.
27: */
28: public interface TransactionalChange {
29:
30: /**
31: * Translates this transactional change to corresponding OWLAPI change axioms.
32: *
33: * @param targetOntology Ontology to which the changes are applied
34: * @return A list of OWL change axioms corresponding to this change
35: */
36: List<OWLOntologyChange> toOwlChanges(OWLOntology targetOntology);
37:
38: /**
39: * Whether this change overrides the specified existing change.
40: * <p>
41: * The most typical case is a subject-property remove change overriding an existing add axiom asserting the
42: * specified property value.
43: * <p>
44: * Note that a remove change need not be overriden by an add change, because if applied in a sequence, the addition
45: * occurs after removal.
46: *
47: * @param existing Possibly overriden existing transactional change
48: * @return {@code true} if this change overrides the specified one, {@code false} otherwise
49: */
50: default boolean overrides(TransactionalChange existing) {return false;}
51: }