Revision fb736afc
Added by Andreas Kohlbecker over 8 years ago
src/main/java/org/bgbm/biovel/drf/checklist/EEA_BDC_Client.java | ||
---|---|---|
1 | 1 |
package org.bgbm.biovel.drf.checklist; |
2 | 2 |
|
3 |
import java.io.IOException; |
|
3 | 4 |
import java.net.URI; |
4 | 5 |
import java.util.ArrayList; |
5 | 6 |
import java.util.EnumSet; |
... | ... | |
13 | 14 |
import org.apache.jena.rdf.model.StmtIterator; |
14 | 15 |
import org.bgbm.biovel.drf.client.ServiceProviderInfo; |
15 | 16 |
import org.bgbm.biovel.drf.query.SparqlClient; |
17 |
import org.bgbm.biovel.drf.store.TripleStore; |
|
16 | 18 |
import org.bgbm.biovel.drf.tnr.msg.Classification; |
17 | 19 |
import org.bgbm.biovel.drf.tnr.msg.NameType; |
18 | 20 |
import org.bgbm.biovel.drf.tnr.msg.Query; |
... | ... | |
118 | 120 |
|
119 | 121 |
if(USE_REMOTE_SERVICE) { |
120 | 122 |
// use SPARQL end point |
121 |
queryClient = new SparqlClient(SPARQL_ENDPOINT_URL, SparqlClient.Opmode.SPARCLE_ENDPOINT);
|
|
123 |
queryClient = new SparqlClient(SPARQL_ENDPOINT_URL); |
|
122 | 124 |
} else { |
125 |
TripleStore tripleStore = new TripleStore(); |
|
123 | 126 |
if(REFRESH_TDB) { |
124 | 127 |
// use downloadable rdf |
125 |
queryClient = new SparqlClient(RDF_FILE_URL, SparqlClient.Opmode.RDF_ARCHIVE); |
|
126 |
}else { |
|
127 |
// reuse existing TDB_STORE |
|
128 |
queryClient = new SparqlClient(null, SparqlClient.Opmode.RDF_ARCHIVE); |
|
128 |
try { |
|
129 |
tripleStore.loadIntoStore(RDF_FILE_URL); |
|
130 |
} catch (IOException e) { |
|
131 |
logger.error("Loading " + RDF_FILE_URL + " into TripleStore failed", e); |
|
132 |
} |
|
129 | 133 |
} |
134 |
queryClient = new SparqlClient(tripleStore); |
|
135 |
|
|
130 | 136 |
} |
131 | 137 |
} |
132 | 138 |
|
Also available in: Unified diff
externalizing TripleStore functionality from SparqlClient