Package org.deri.grefine.reconcile.rdf.endpoints

Examples of org.deri.grefine.reconcile.rdf.endpoints.QueryEndpoint


    List<String> searchPropertyUris = new ArrayList<String>();
    JSONArray propertiesArray = serviceObj.getJSONArray("searchPropertyUris");
    for(int i=0;i<propertiesArray.length();i++){
      searchPropertyUris.add(propertiesArray.getString(i));
    }
    QueryEndpoint endpoint = loadEndpointFromJSON(serviceObj.getJSONObject("endpoint"));
    return new RdfReconciliationService(serviceId, serviceObj.getString("name"),
        ImmutableList.copyOf(searchPropertyUris), endpoint, serviceObj.getDouble("matchThreshold"));
  }
View Full Code Here


      queryExecutor = new DumpQueryExecutor(model, propUris.get(0));
    }else{
      queryExecutor = new DumpQueryExecutor(model);
    }
    SparqlQueryFactory queryFactory = new JenaTextSparqlQueryFactory();
    QueryEndpoint queryEndpoint = new QueryEndpointImpl(queryFactory, queryExecutor);
    return new RdfReconciliationService(id, name, queryEndpoint, DEFAULT_MATCH_THRESHOLD);
  }
View Full Code Here

  private ReconciliationService getSparqlService(String name, String id,String url, ImmutableList<String> propUris, HttpServletRequest request) {
    String type = request.getParameter("type");
    String graph = request.getParameter("graph");

    graph = graph==null || graph.trim().isEmpty()?null:graph;
    QueryEndpoint queryEndpoint;
    if(type.equals("jena-text")){
      SparqlQueryFactory queryFactory = new JenaTextSparqlQueryFactory();
      QueryExecutor queryExecutor = new RemoteQueryExecutor(url, graph);
      queryEndpoint = new QueryEndpointImpl(queryFactory, queryExecutor);
    }else if(type.equals("virtuoso")){
View Full Code Here

      ImmutableList<String> empty = ImmutableList.of();
      Set<ReconciliationCandidate> candidates = new LinkedHashSet<ReconciliationCandidate>();
      int limit = request.getLimit();
      for(String[] pair: urlPairs){
        Model model = broker.getModelForUrl(pair[0], pair[1],jsonUtilities);
        QueryEndpoint endpoint = queryEndpointFactory.getLarqQueryEndpoint(model);
        request.setLimit(limit - candidates.size());
        candidates.addAll(endpoint.reconcileEntities(request, empty, 0.9));
        if(candidates.size()>=limit){
          break;
        }
      }
View Full Code Here

  @Override
  public String getPreviewHtmlForResource(String resourceId) throws Exception {
    Model model = rdfUtilities.dereferenceUri(resourceId);
   
    QueryEndpoint endpoint = this.queryEndpointFactory.getLarqQueryEndpoint(model);
    Multimap<String, String> propertiesMap   = endpoint.getResourcePropertiesMap(previewResourceCannedQuery, resourceId);
    VelocityContext context = new VelocityContext();
    context.put("resourceUri", resourceId);
    context.put("propertiesMap", propertiesMap);
   
    return getHtmlFromTemplate("templates/resource_preview.vt", context);
View Full Code Here

      if(propUris.size()==1){
        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

TOP

Related Classes of org.deri.grefine.reconcile.rdf.endpoints.QueryEndpoint

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.