Skip to content

Package: Properties

Properties

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.Assertion;
22: import cz.cvut.kbss.ontodriver.model.Axiom;
23: import cz.cvut.kbss.ontodriver.model.NamedResource;
24: import cz.cvut.kbss.ontodriver.model.Value;
25:
26: import java.net.URI;
27: import java.util.Collection;
28: import java.util.Map;
29: import java.util.Set;
30:
31: /**
32: * This interface provides access to properties not mapped by the object model.
33: */
34: public interface Properties {
35:
36: /**
37: * Loads property values for the specified individual.
38: * <p>
39: * This method essentially does the same as
40: * {@link Connection#find(cz.cvut.kbss.ontodriver.descriptor.AxiomDescriptor)}.
41: * It is up to the OOM provider to decide which values are part of the object model and which are unmapped.
42: *
43: * @param individual Individual for which property values should be loaded
44: * @param context Context from which to load the property values
45: * @param includeInferred Whether to included inferred knowledge
46: * @return Collection of axioms representing property values
47: * @throws OntoDriverException When storage access error occurs
48: */
49: Collection<Axiom<?>> getProperties(NamedResource individual, URI context, boolean includeInferred)
50: throws OntoDriverException;
51:
52: /**
53: * Adds the specified property values into the ontology.
54: * <p>
55: * The property values are either URIs (in case of object properties) or data literals of the appropriate Java type.
56: *
57: * @param individual Property subject
58: * @param context Context into which to store the property values
59: * @param properties The values to add
60: * @throws OntoDriverException When storage access error occurs
61: */
62: void addProperties(NamedResource individual, URI context, Map<Assertion, Set<Value<?>>> properties)
63: throws OntoDriverException;
64:
65: /**
66: * Removes the specified property values from the ontology.
67: * <p>
68: * The property values are either URIs (in case of object properties) or data literals of the appropriate Java type.
69: *
70: * @param individual Property subject
71: * @param context Context from which to remove the property values
72: * @param properties The values to remove
73: * @throws OntoDriverException When storage access error occurs
74: */
75: void removeProperties(NamedResource individual, URI context, Map<Assertion, Set<Value<?>>> properties)
76: throws OntoDriverException;
77:
78: }