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: * @author ledvima1
32: */
33: public interface Properties {
34:
35: /**
36: * Loads property values for the specified individual.
37: * <p/>
38: * This method essentially does the same as
39: * {@link Connection#find(cz.cvut.kbss.ontodriver.descriptor.AxiomDescriptor)}.
40: * It is up to the OOM provider to decide which values are part of the object model and which are unmapped.
41: *
42: * @param individual Individual for which property values should be loaded
43: * @param context Context from which to load the property values
44: * @param includeInferred Whether to included inferred knowledge
45: * @return Collection of axioms representing property values
46: */
47: public Collection<Axiom<?>> getProperties(NamedResource individual, URI context, boolean includeInferred) 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: */
58: public void addProperties(NamedResource individual, URI context, Map<Assertion, Set<Value<?>>> properties) throws OntoDriverException;
59:
60: /**
61: * Removes the specified property values from the ontology.
62: * <p/>
63: * The property values are either URIs (in case of object properties) or data literals of the appropriate Java type.
64: *
65: * @param individual Property subject
66: * @param context Context from which to remove the property values
67: * @param properties The values to remove
68: */
69: public void removeProperties(NamedResource individual, URI context, Map<Assertion, Set<Value<?>>> properties) throws OntoDriverException;
70:
71: }