Skip to content

Package: Types

Types

Coverage

1: /*
2: * JOPA
3: * Copyright (C) 2023 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;
19:
20: import cz.cvut.kbss.ontodriver.exception.OntoDriverException;
21: import cz.cvut.kbss.ontodriver.model.Axiom;
22: import cz.cvut.kbss.ontodriver.model.NamedResource;
23:
24: import java.net.URI;
25: import java.util.Collection;
26: import java.util.Set;
27:
28: /**
29: * This interface is used for working with individuals' types.
30: */
31: public interface Types {
32:
33: /**
34: * Gets types associated with the specified individual.
35: *
36: * @param individual Resource for which types should be found
37: * @param contexts Context in which to look for the types. Empty collection indicates the default context
38: * @param includeInferred Whether to include inferred types as well
39: * @return Set of type URIs
40: * @throws OntoDriverException When an ontology access error occurs
41: */
42: Set<Axiom<URI>> getTypes(NamedResource individual, Collection<URI> contexts, boolean includeInferred)
43: throws OntoDriverException;
44:
45: /**
46: * Adds the specified types to the named individual in the ontology.
47: *
48: * @param individual The types subject
49: * @param context Context into which the type statements will be added
50: * @param types The types to add
51: * @throws OntoDriverException When an ontology access error occurs
52: */
53: void addTypes(NamedResource individual, URI context, Set<URI> types) throws OntoDriverException;
54:
55: /**
56: * Removes the specified types of the named individual in the ontology.
57: *
58: * @param individual The types subject
59: * @param context Context into which the type statements will be added
60: * @param types The types to add
61: * @throws OntoDriverException When an ontology access error occurs
62: */
63: void removeTypes(NamedResource individual, URI context, Set<URI> types) throws OntoDriverException;
64: }