Package: OWLClassWithQueryAttr2
OWLClassWithQueryAttr2
name | instruction | branch | complexity | line | method | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
OWLClassWithQueryAttr2() |
|
|
|
|
|
||||||||||||||||||||
OWLClassWithQueryAttr2(URI) |
|
|
|
|
|
||||||||||||||||||||
getEntityAttribute() |
|
|
|
|
|
||||||||||||||||||||
getEntityQueryAttribute() |
|
|
|
|
|
||||||||||||||||||||
getPersistenceContext() |
|
|
|
|
|
||||||||||||||||||||
getUri() |
|
|
|
|
|
||||||||||||||||||||
setEntityAttribute(OWLClassA) |
|
|
|
|
|
||||||||||||||||||||
setEntityQueryAttribute(OWLClassA) |
|
|
|
|
|
||||||||||||||||||||
setPersistenceContext(UnitOfWorkImpl) |
|
|
|
|
|
||||||||||||||||||||
setUri(URI) |
|
|
|
|
|
||||||||||||||||||||
static {...} |
|
|
|
|
|
||||||||||||||||||||
toString() |
|
|
|
|
|
Coverage
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.*;
18:
19: import java.net.URI;
20:
21: @SparqlResultSetMapping(name = OWLClassWithQueryAttr2.MAPPING_NAME, entities = {
22: @EntityResult(entityClass = OWLClassWithQueryAttr2.class, fields = {
23: @FieldResult(name = "uri", variable = "x"),
24: @FieldResult(name = "entityAttribute", variable = "y"),
25: @FieldResult(name = "entityQueryAttribute", variable = "z")
26: })
27: })
28: @OWLClass(iri = Vocabulary.C_OwlClassWithQueryAttr2)
29: public class OWLClassWithQueryAttr2 implements HasUri {
30:
31: public static final String MAPPING_NAME = "OWLClassWithQueryAttr2.entityMapping";
32:
33: private static final String QUERY_ENTITY = "SELECT ?x\n" +
34: "WHERE {?this <" + Vocabulary.P_HAS_OWL_CLASS_A + "> ?x }";
35:
36: @Id
37: private URI uri;
38:
39: @OWLObjectProperty(iri = Vocabulary.P_HAS_OWL_CLASS_A, fetch = FetchType.EAGER)
40: private OWLClassA entityAttribute;
41:
42: @Sparql(query = QUERY_ENTITY)
43: private OWLClassA entityQueryAttribute;
44:
45: public OWLClassWithQueryAttr2() {
46: }
47:
48: public OWLClassWithQueryAttr2(URI uri) {
49: this.uri = uri;
50: }
51:
52: public void setUri(URI uri) {
53: this.uri = uri;
54: }
55:
56: @Override
57: public URI getUri() {
58: return uri;
59: }
60:
61: public OWLClassA getEntityAttribute() {
62: return entityAttribute;
63: }
64:
65: public void setEntityAttribute(OWLClassA entityAttribute) {
66: this.entityAttribute = entityAttribute;
67: }
68:
69: public OWLClassA getEntityQueryAttribute() {
70: return entityQueryAttribute;
71: }
72:
73: public void setEntityQueryAttribute(OWLClassA entityQueryAttribute) {
74: this.entityQueryAttribute = entityQueryAttribute;
75: }
76:
77: @Override
78: public String toString() {
79: String out = "OWLClassWithQueryAttr2: uri = " + uri;
80: out += ", entityAttribute = " + entityAttribute;
81: return out;
82: }
83: }