Skip to content

Package: Properties

Properties

Coverage

1: /**
2: * Copyright (C) 2016 Czech Technical University in Prague
3: *
4: * This program is free software: you can redistribute it and/or modify it under
5: * the terms of the GNU General Public License as published by the Free Software
6: * Foundation, either version 3 of the License, or (at your option) any
7: * later version.
8: *
9: * This program is distributed in the hope that it will be useful, but WITHOUT
10: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12: * details. You should have received a copy of the GNU General Public License
13: * along with this program. If not, see <http://www.gnu.org/licenses/>.
14: */
15: package cz.cvut.kbss.ontodriver;
16:
17: import cz.cvut.kbss.ontodriver.exception.OntoDriverException;
18: import cz.cvut.kbss.ontodriver.model.Assertion;
19: import cz.cvut.kbss.ontodriver.model.Axiom;
20: import cz.cvut.kbss.ontodriver.model.NamedResource;
21: import cz.cvut.kbss.ontodriver.model.Value;
22:
23: import java.net.URI;
24: import java.util.Collection;
25: import java.util.Map;
26: import java.util.Set;
27:
28: /**
29: * This interface provides access to properties not mapped by the object model.
30: */
31: public interface Properties {
32:
33: /**
34: * Loads property values for the specified individual.
35: * <p>
36: * This method essentially does the same as
37: * {@link Connection#find(cz.cvut.kbss.ontodriver.descriptor.AxiomDescriptor)}.
38: * It is up to the OOM provider to decide which values are part of the object model and which are unmapped.
39: *
40: * @param individual Individual for which property values should be loaded
41: * @param context Context from which to load the property values
42: * @param includeInferred Whether to included inferred knowledge
43: * @return Collection of axioms representing property values
44: * @throws OntoDriverException When storage access error occurs
45: */
46: Collection<Axiom<?>> getProperties(NamedResource individual, URI context, boolean includeInferred)
47: throws OntoDriverException;
48:
49: /**
50: * Adds the specified property values into the ontology.
51: * <p>
52: * The property values are either URIs (in case of object properties) or data literals of the appropriate Java type.
53: *
54: * @param individual Property subject
55: * @param context Context into which to store the property values
56: * @param properties The values to add
57: * @throws OntoDriverException When storage access error occurs
58: */
59: void addProperties(NamedResource individual, URI context, Map<Assertion, Set<Value<?>>> properties)
60: throws OntoDriverException;
61:
62: /**
63: * Removes the specified property values from the ontology.
64: * <p>
65: * The property values are either URIs (in case of object properties) or data literals of the appropriate Java type.
66: *
67: * @param individual Property subject
68: * @param context Context from which to remove the property values
69: * @param properties The values to remove
70: * @throws OntoDriverException When storage access error occurs
71: */
72: void removeProperties(NamedResource individual, URI context, Map<Assertion, Set<Value<?>>> properties)
73: throws OntoDriverException;
74:
75: }