View Javadoc
1   /*
2    * Copyright 2018-2022 Medical Information Systems Research Group (https://medical.zcu.cz),
3    * Department of Computer Science and Engineering, University of West Bohemia.
4    * Address: Univerzitni 8, 306 14 Plzen, Czech Republic.
5    *
6    * Author Petr Vcelak (vcelak@kiv.zcu.cz).
7    *
8    * This file is part of MRECore project.
9    *
10   * MRECore is free software: you can redistribute it and/or modify
11   * it under the terms of the GNU General Public License as published by
12   * the Free Software Foundation, either version 3 of the License.
13   *
14   * MRECore is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17   * GNU General Public License for more details.
18   *
19   * You should have received a copy of the GNU General Public License
20   * along with MRECore. If not, see <http://www.gnu.org/licenses/>.
21   */
22  package cz.zcu.mre.data.core;
23  
24  import java.io.Serializable;
25  import java.util.List;
26  import java.util.Set;
27  import org.apache.jena.rdf.model.Literal;
28  import org.apache.jena.rdf.model.Property;
29  import org.apache.jena.rdf.model.Resource;
30  
31  /**
32   * Main interface for MRE data instance.
33   *
34   * @author Petr Vcelak (vcelak@kiv.zcu.cz)
35   */
36  public interface MREData extends Serializable {
37  
38      boolean isEmpty();
39  
40      boolean hasURI();
41  
42      Resource generateNewResource();
43  
44      Resource getResource();
45  
46      void setResource(Resource resource);
47  
48      void setResource(String uri);
49  
50      String getUri();
51  
52      String getId();
53  
54      void setId(String id);
55  
56      Set<Resource> getType();
57  
58      boolean hasType();
59  
60      public boolean hasType(Resource type);
61  
62      List<? extends Resource> getTypeList();
63  
64      void setTypeList(List<Resource> typeset);
65  
66      void setType(Resource type);
67  
68      String getTitle();
69  
70      String getTitle(String lang);
71  
72      void setTitle(String title);
73  
74      void setTitle(String title, String lang);
75  
76      String getLabel();
77  
78      void setLabel(String label);
79  
80      void setLabel(String label, String lang);
81  
82      String getLabelPreferred();
83  
84      void setLabelPreferred(String title);
85  
86      void setLabelPreferred(String title, String lang);
87  
88      void addValue(Property property, String string);
89  
90      void addValue(Property property, String string, String lang);
91  
92      void addValue(Property property, Resource res);
93  
94      void removeValues(Property property);
95  
96      Set<Resource> getValuesResource(Property property);
97  
98      Set<Literal> getValuesLiteral(Property property);
99  
100     Set<String> getValuesString(Property property);
101 
102     Set<Object> getValuesObject(Property property);
103 
104     boolean hasProperty(Property property);
105 
106     boolean hasValue(final Property property);
107 
108     boolean hasValue(final Property property, final Object value);
109 
110     //Object getPropertyValue(final Property property, final boolean convertType);
111     //Object getPropertyValue(final Property property);
112     //
113     //
114     //
115     //
116     //
117     //
118 //    List<Property> getPropertiesList();
119 //
120 //    List<String> getFormHiddenPropertiesList();
121 //
122 //    List<String> getPropertiesLocalNameList();
123 //
124 //    void setPropertiesList(List<Property> propertiesList);
125 //
126 //    boolean isPropertiesListEmpty();
127 //
128 //    Map<String, MREDataPersistent> getData();
129 //
130 //    void insertValue(Property property, Object value);
131 //
132 //    void insertAll(Property property, Collection<Object> vals);
133 //
134 //    void insertAll(Property property, List<Object> vals);
135 //
136 //    String getFormType(String property);
137 //
138 //    String getFormAttrTFString(String property);
139 //
140 //    void removeValue(String instanceString);
141 }