Skip to content

Package: PropertiesHandler

PropertiesHandler

nameinstructionbranchcomplexitylinemethod
PropertiesHandler(StorageConnector)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
addProperties(NamedResource, URI, Map)
M: 0 C: 10
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
getProperties(NamedResource, URI, boolean)
M: 0 C: 9
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
removeProperties(NamedResource, URI, Map)
M: 0 C: 10
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%

Coverage

1: /**
2: * Copyright (C) 2020 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.jena;
16:
17: import cz.cvut.kbss.ontodriver.Properties;
18: import cz.cvut.kbss.ontodriver.jena.connector.StorageConnector;
19: import cz.cvut.kbss.ontodriver.model.Assertion;
20: import cz.cvut.kbss.ontodriver.model.Axiom;
21: import cz.cvut.kbss.ontodriver.model.NamedResource;
22: import cz.cvut.kbss.ontodriver.model.Value;
23:
24: import java.net.URI;
25: import java.util.Collection;
26: import java.util.Map;
27: import java.util.Set;
28:
29: class PropertiesHandler implements Properties {
30:
31: private final StorageConnector connector;
32:
33: PropertiesHandler(StorageConnector connector) {
34: this.connector = connector;
35: }
36:
37: @Override
38: public Collection<Axiom<?>> getProperties(NamedResource individual, URI context, boolean includeInferred) {
39: return new ExplicitAxiomLoader(connector).find(individual, context);
40: }
41:
42: @Override
43: public void addProperties(NamedResource individual, URI context, Map<Assertion, Set<Value<?>>> properties) {
44: new AxiomSaver(connector).saveAxioms(individual, properties, context);
45: }
46:
47: @Override
48: public void removeProperties(NamedResource individual, URI context, Map<Assertion, Set<Value<?>>> properties) {
49: new EpistemicAxiomRemover(connector).remove(individual, properties, context);
50: }
51: }