Skip to content

Method: setPluralQueryAttribute(Set)

1: /**
2: * Copyright (C) 2022 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.jopa.test;
16:
17: import cz.cvut.kbss.jopa.model.annotations.Id;
18: import cz.cvut.kbss.jopa.model.annotations.OWLClass;
19: import cz.cvut.kbss.jopa.model.annotations.OWLDataProperty;
20: import cz.cvut.kbss.jopa.model.annotations.Sparql;
21:
22: import java.net.URI;
23: import java.util.Set;
24:
25: @OWLClass(iri = Vocabulary.C_OwlClassWithQueryAttr3)
26: public class OWLClassWithQueryAttr3 implements HasUri {
27:
28: private static final String QUERY = "SELECT ?pluralAttribute\n" +
29: "WHERE {?this <" + Vocabulary.P_HAS_SIMPLE_LIST + "> ?pluralAttribute}";
30:
31: @Id
32: private URI uri;
33:
34: @OWLDataProperty(iri = Vocabulary.P_HAS_SIMPLE_LIST, simpleLiteral = true)
35: private Set<String> pluralAttribute;
36:
37: @Sparql(query = QUERY, enableReferencingAttributes = false)
38: private Set<String> pluralQueryAttribute;
39:
40: public OWLClassWithQueryAttr3() {
41: }
42:
43: public OWLClassWithQueryAttr3(URI uri) {
44: this.uri = uri;
45: }
46:
47: public void setUri(URI uri) {
48: this.uri = uri;
49: }
50:
51: @Override
52: public URI getUri() {
53: return uri;
54: }
55:
56: public Set<String> getPluralAttribute() {
57: return pluralAttribute;
58: }
59:
60: public void setPluralAttribute(Set<String> pluralAttribute) {
61: this.pluralAttribute = pluralAttribute;
62: }
63:
64: public Set<String> getPluralQueryAttribute() {
65: return pluralQueryAttribute;
66: }
67:
68: public void setPluralQueryAttribute(Set<String> pluralQueryAttribute) {
69: this.pluralQueryAttribute = pluralQueryAttribute;
70: }
71:
72: public static String getSparqlQuery() {
73: return QUERY;
74: }
75:
76: @Override
77: public String toString() {
78: String out = "OWLClassWithQueryAttr: uri = " + uri;
79: out += ", pluralAttribute = " + pluralAttribute;
80: return out;
81: }
82: }