Skip to content

Commit

Permalink
changed in db regarding autoindexing requested by search team
Browse files Browse the repository at this point in the history
  • Loading branch information
sepidetari committed Jun 29, 2018
1 parent 7afee63 commit f90871a
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.apache.jena.update.UpdateRequest;
import org.apache.log4j.Logger;
import org.dice_research.sask.database_ms.RDFTriples.AutoIndexDTO;
import org.dice_research.sask.database_ms.RDFTriples.EndPointParameters;
import org.dice_research.sask.database_ms.RDFTriples.TripleDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
Expand Down Expand Up @@ -219,8 +220,10 @@ private void updateAutoIndex() {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
// have to replace with the required values
dto.setUrl("http://localhost:3030/sask/query");
dto.setEntitySelectQuery("SELECT ?subject ?object WHERE { ?subject ?predicate ?object }");
EndPointParameters endPointParameters = dto.getEndPointParameters();
endPointParameters.setUrl("http://localhost:3030/sask/query");
endPointParameters.setEntitySelectQuery("SELECT ?subject ?object WHERE { ?subject ?predicate ?object }");

This comment has been minimized.

Copy link
@prasanthhs

prasanthhs Jun 29, 2018

Contributor

@sepidetari This query will be modified to the query which @RicardoUsbeck suggested in issue #60

This comment has been minimized.

Copy link
@sepidetari

sepidetari Jul 4, 2018

Author Collaborator

@prasanthhs As we have discussed that query did not work so I have modified it according your need.

endPointParameters.setIsEntityCustomized(true);
dto.setUseLocalDataSource(true);
HttpEntity<AutoIndexDTO> entity = new HttpEntity<AutoIndexDTO>(dto, headers);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,14 @@
package org.dice_research.sask.database_ms.RDFTriples;

public class AutoIndexDTO {
private String url = "";

private String entitySelectQuery = "";
private EndPointParameters endPointParameters;
private boolean useLocalDataSource = true;

public String getUrl() {
return url;
}

public void setUrl(String url) {
this.url = url;
}

public String getEntitySelectQuery() {
return entitySelectQuery;
}

public void setEntitySelectQuery(String entitySelectQuery) {
this.entitySelectQuery = entitySelectQuery;
public EndPointParameters getEndPointParameters() {
if(this.endPointParameters == null) {
endPointParameters = new EndPointParameters();
}
return this.endPointParameters;
}

public boolean isUseLocalDataSource() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package org.dice_research.sask.database_ms.RDFTriples;

public class EndPointParameters{
private String url = "";
private Boolean isEntityCustomized = false;
private String entitySelectQuery = "";

public void setUrl(String url) {
this.url = url;
}

public String getUrl() {
return this.url;
}

public void setIsEntityCustomized(Boolean isEntityCustomized) {
this.isEntityCustomized = isEntityCustomized;
}

public void setEntitySelectQuery(String entitySelectQuery) {
this.entitySelectQuery = entitySelectQuery;
}

public Boolean getIsEntityCustomized() {
return this.isEntityCustomized;
}

public String getEntitySelectQuery() {
return this.entitySelectQuery;
}



}

0 comments on commit f90871a

Please sign in to comment.