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.dao;
23  
24  import cz.zcu.mre.data.datatable.DataTableQueryCriteria;
25  import java.util.List;
26  import org.apache.jena.query.Query;
27  import org.apache.jena.query.QuerySolution;
28  import org.apache.jena.rdf.model.Model;
29  import org.apache.jena.rdf.model.Resource;
30  import org.apache.jena.update.Update;
31  import org.apache.jena.update.UpdateRequest;
32  import org.springframework.data.domain.Pageable;
33  
34  /**
35   * SPARQL Repository.
36   *
37   * @author Petr Vcelak (vcelak@kiv.zcu.cz)
38   */
39  public interface SPARQLRepository {
40  
41      String getServiceURL();
42  
43      void setServiceURL(String serviceURL);
44  
45      String getAllServicePath();
46  
47      String getUpdateServicePath();
48  
49      String getQueryServicePath();
50  
51      Model getGraphDefault();
52  
53      Model getGraphNamed(String graphURI);
54  
55      void datasetClone(String sparqlServiceFrom, String sparqlServiceTo, String graphURI);
56  
57      void datasetDownload(String sparqlServiceFrom, String graphURI);
58  
59      void datasetDownload(String sparqlServiceFrom, String graphURI, String outputFile, String rdfNotation);
60  
61      void datasetAppend(Model data, String graphURI);
62  
63      void datasetAppend(String sparqlServiceTo, String graphURI, Model sourceModel);
64  
65      boolean queryAsk(String ask);
66  
67      Model queryConstruct(String construct);
68  
69      boolean queryDelete(String delete);
70  
71      Model queryDescribe(String describe);
72  
73      boolean queryInsert(String insert);
74  
75      List<QuerySolution> querySelect(String select);
76  
77      List<QuerySolution> querySelect(String select, Pageable pageable);
78  
79      boolean queryUpdate(String update);
80  
81      boolean removeSubjectAll(Resource uri);
82  
83      Model getModel(String resourceUri);
84  
85  //    boolean isEnabledQueryWrap();
86  
87  //    void setEnabledQueryWrap(boolean enabledQueryWrap);
88  
89      boolean queryUpdate(Update update);
90  
91      boolean queryUpdate(UpdateRequest updateRequest);
92  
93      boolean queryDelete(Update delete);
94  
95      boolean queryInsert(Update insert);
96  
97      Model queryConstruct(Query query);
98  
99      Model queryDescribe(Query describe);
100 
101     List<QuerySolution> querySelect(Query select);
102 
103     List<QuerySolution> querySelect(Query build, DataTableQueryCriteria queryCriteria);
104 
105     List<QuerySolution> querySelect(Query select, Pageable pageable);
106 
107     long queryCount(String queryTotalSize);
108 
109 }