Package org.deri.grefine.reconcile.model

Examples of org.deri.grefine.reconcile.model.ReconciliationService


    String entityId = request.getParameter("id");   
    return registry.previewEntity(service, entityId, callback);
  }
 
  public String previewResource(String serviceName, HttpServletRequest request) throws Exception {
    ReconciliationService service = getService(serviceName);
    String entityId = request.getParameter("id");   
    return registry.previewResource(service, entityId);
  }
View Full Code Here


    Set<String> services = this.registry.getServiceIds();
    Pattern pattern = Pattern.compile("rdf-extension\\/services\\/([-.a-zA-Z0-9_]+)");
    Set<String> ids = getServiceIds(urls,pattern);
    services.removeAll(ids);
    for(String id:services){
      ReconciliationService service =registry.removeService(id);
      File modelFile = new File(workingDir,service.getId()+".ttl");
      if(modelFile.exists()){
        modelFile.delete();
      }
    }
    FileOutputStream servicesFile = new FileOutputStream(new File(workingDir,"services"));
View Full Code Here

  public Set<String> getServiceIds(){
    return new HashSet<String>(services.keySet());
  }
 
  public ReconciliationService getService(String id, FileInputStream in){
    ReconciliationService service = services.get(id);
    if(in!=null){
      service.initialize(in);
    }
    return service;
  }
View Full Code Here

            JSONObject obj = (JSONObject) tokener.nextValue();
            JSONArray services = obj.getJSONArray("services");
            for(int i=0;i<services.length();i++){
              JSONObject serviceObj = services.getJSONObject(i);
              String type = serviceObj.getString("type");
              ReconciliationService service;
              if(type.equals("rdf")){
                service = loadRdfServiceFromJSON(serviceObj);
              }else if(type.equals("sindice")){
                service = loadSindiceServiceFromJSON(serviceObj);
              }else{
                //unknown service ignore
                continue;
              }
              this.services.put(service.getId(), service);
            }
        }finally {
            in.close();
        }
   
View Full Code Here

    //validate
    if(name.isEmpty() || url.isEmpty() || propUris.size()==0){
      throw new RuntimeException("name, endpoint URL and at least one label property ar needed");
    }
    String datasource = request.getParameter("datasource");
    ReconciliationService service;
    if(datasource.equals("sparql")){
      service = getSparqlService(name,id,url,propUris,request);
      GRefineServiceManager.singleton.addService(service);
    }else{
      String format = request.getParameter("file_format");
View Full Code Here

      //plain
      PlainSparqlQueryFactory queryFactory = new PlainSparqlQueryFactory();
      QueryExecutor queryExecutor = new RemoteQueryExecutor(url, graph);
      queryEndpoint = new PlainSparqlQueryEndpoint(queryFactory, queryExecutor);
    }
    ReconciliationService service = new RdfReconciliationService(id, name, propUris, queryEndpoint, DEFAULT_MATCH_THRESHOLD);
    return service;
  }
View Full Code Here

public class InitializeServicesCommand extends AbstractAddServiceCommand{

  @Override
  protected ReconciliationService getReconciliationService(HttpServletRequest request) throws JSONException, IOException {
    ReconciliationService service = new SindiceService("sindice", "Sindice", null);
    try {
      JSONArray arr = ParsingUtilities.evaluateJsonStringToArray(request.getParameter("services"));
      Set<String> urls = new HashSet<String>();
      for(int i=0;i<arr.length();i++){
        urls.add(arr.getString(i));
View Full Code Here

      StringWriter sw = new StringWriter();
      JSONWriter w = new JSONWriter(sw);
      w.object();
          w.key("code"); w.value("ok");
          w.key("service");
          ReconciliationService service = getReconciliationService(request);
          service.writeAsJson(w);
          w.endObject();
          sw.flush();
      //out.print("<html><body><textarea>" + sw.toString() + "</textarea></body></html>");
          out.print(sw.toString());
          out.flush();
View Full Code Here

        queryExecutor = new DumpQueryExecutor(model,propUris.get(0));
      }else{
        queryExecutor = new DumpQueryExecutor(model);
      }
      QueryEndpoint queryEndpoint = new QueryEndpointImpl(queryFactory, queryExecutor);
      ReconciliationService service = new RdfReconciliationService(id, name, propUris, queryEndpoint, AddServiceCommand.DEFAULT_MATCH_THRESHOLD);
      GRefineServiceManager.singleton.addAndSaveService(service);
      return service;
    }catch(FileUploadException fe){
      throw new IOException(fe);
    }
View Full Code Here

      throw new RuntimeException("Sindice service for domain '" + domain + "' is already defined!");
    }
    if(domain.trim().isEmpty()){
      throw new RuntimeException("doamin is required");
    }
    ReconciliationService service = new SindiceService(id, name, domain);
    GRefineServiceManager.singleton.addService(service);
    return service;
  }
View Full Code Here

TOP

Related Classes of org.deri.grefine.reconcile.model.ReconciliationService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.