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