-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* #T19191 lib update for parent child: a top level field needs to be added in elastic for this to work * undo change * rename variable * refactor * rename to content_join_field * use Consumer instead, also revert the constructors so current projects dont get affected and use a @builder instead * change to BiConsumer because I need to pass the type too * replace nested conditions to make code more readable * add postIndexInterceptor to allow editing index document before it's sent to elasticsearch --------- Co-authored-by: domi.vds <[email protected]>
- Loading branch information
1 parent
554c0a6
commit 97bf8a8
Showing
3 changed files
with
119 additions
and
41 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
access/src/main/java/zone/cogni/asquare/sparqlservice/RdfStoreSparqlService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package zone.cogni.asquare.sparqlservice; | ||
|
||
import org.apache.jena.query.ResultSet; | ||
import org.apache.jena.rdf.model.Model; | ||
import org.springframework.core.io.FileSystemResource; | ||
import zone.cogni.asquare.triplestore.RdfStoreService; | ||
import zone.cogni.libs.jena.utils.JenaUtils; | ||
import zone.cogni.libs.sparqlservice.SparqlService; | ||
|
||
import java.io.File; | ||
import java.util.function.Function; | ||
|
||
public class RdfStoreSparqlService implements SparqlService { | ||
private final RdfStoreService rdfStoreService; | ||
|
||
public RdfStoreSparqlService(RdfStoreService rdfStoreService) { | ||
this.rdfStoreService = rdfStoreService; | ||
} | ||
|
||
@Override | ||
public void uploadTtlFile(File file) { | ||
Model model = JenaUtils.read(new FileSystemResource(file)); | ||
rdfStoreService.addData(model); | ||
} | ||
|
||
@Override | ||
public Model queryForModel(String query) { | ||
return rdfStoreService.executeConstructQuery(query); | ||
} | ||
|
||
@Override | ||
public void executeUpdateQuery(String updateQuery) { | ||
rdfStoreService.executeUpdateQuery(updateQuery); | ||
} | ||
|
||
@Override | ||
public boolean executeAskQuery(String updateQuery) { | ||
return rdfStoreService.executeAskQuery(updateQuery); | ||
} | ||
|
||
@Override | ||
public void upload(Model model, String graphUri) { | ||
rdfStoreService.addData(model); | ||
} | ||
|
||
@Override | ||
public <R> R executeSelectQuery(String query, Function<ResultSet, R> resultHandler) { | ||
return rdfStoreService.executeSelectQuery(query, resultHandler::apply); | ||
} | ||
|
||
@Override | ||
public void dropGraph(String graphUri) { | ||
rdfStoreService.deleteGraph(graphUri); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 44 additions & 30 deletions
74
service/src/main/java/zone/cogni/asquare/service/index/IndexConfigProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters