Skip to contentMethod: IntegrityConstraintFactoryImpl()
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.jopa.ic.impl;
19:
20: import cz.cvut.kbss.jopa.ic.api.*;
21: import org.semanticweb.owlapi.model.OWLClass;
22: import org.semanticweb.owlapi.model.OWLDataProperty;
23: import org.semanticweb.owlapi.model.OWLDatatype;
24: import org.semanticweb.owlapi.model.OWLObjectProperty;
25:
26: public class IntegrityConstraintFactoryImpl implements IntegrityConstraintFactory {
27:
28: public AtomicSubClassConstraint SubClassConstraint(final OWLClass sub, final OWLClass sup) {
29: return new AtomicSubClassConstraintImpl(sub, sup);
30: }
31:
32: @Override
33: public DataParticipationConstraint MinDataParticipationConstraint(final OWLClass s, final OWLDataProperty p,
34: final OWLDatatype o, final int card) {
35: return new DataParticipationConstraintImpl(s, p, o, card, -1);
36: }
37:
38: @Override
39: public DataParticipationConstraint MaxDataParticipationConstraint(
40: final OWLClass s, final OWLDataProperty p, final OWLDatatype o,
41: final int card) {
42: return new DataParticipationConstraintImpl(s, p, o, 0, card);
43: }
44:
45: @Override
46: public DataParticipationConstraint DataParticipationConstraint(
47: final OWLClass s, final OWLDataProperty p, final OWLDatatype o,
48: final int min, int max) {
49: return new DataParticipationConstraintImpl(s, p, o, min, max);
50: }
51:
52: @Override
53: public ObjectParticipationConstraint MinObjectParticipationConstraint(
54: final OWLClass s, final OWLObjectProperty p, final OWLClass o,
55: final int card) {
56: return new ObjectParticipationConstraintImpl(s, p, o, card, -1);
57: }
58:
59: @Override
60: public ObjectParticipationConstraint MaxObjectParticipationConstraint(
61: final OWLClass s, final OWLObjectProperty p, final OWLClass o,
62: final int card) {
63: return new ObjectParticipationConstraintImpl(s, p, o, 0, card);
64: }
65:
66: @Override
67: public ObjectParticipationConstraint ObjectParticipationConstraint(
68: final OWLClass s, final OWLObjectProperty p, final OWLClass o,
69: final int min, int max) {
70: return new ObjectParticipationConstraintImpl(s, p, o, min, max);
71: }
72:
73: @Override
74: public ObjectDomainConstraint ObjectPropertyDomainConstraint(
75: final OWLObjectProperty p, final OWLClass s) {
76: return new ObjectDomainConstraintImpl(p, s);
77: }
78:
79: @Override
80: public ObjectRangeConstraint ObjectPropertyRangeConstraint(
81: final OWLClass subj, final OWLObjectProperty p, final OWLClass s) {
82: return new ObjectRangeConstraintImpl(subj, p, s);
83: }
84:
85: @Override
86: public DataDomainConstraint DataPropertyDomainConstraint(
87: final OWLDataProperty p, final OWLClass s) {
88: return new DataDomainConstraintImpl(p, s);
89: }
90:
91: @Override
92: public DataRangeConstraint DataPropertyRangeConstraint(
93: final OWLClass subj, final OWLDataProperty p, final OWLDatatype s) {
94: return new DataRangeConstraintImpl(subj, p, s);
95: }
96: }