Package com.google.refine.org.deri.reconcile.model

Examples of com.google.refine.org.deri.reconcile.model.ReconciliationRequest


    assertResult("http://data.linkedmdb.org/resource/film_series/261", resultset,"http://data.linkedmdb.org/resource/film/930","http://data.linkedmdb.org/resource/film/329");
  }
 
  @Test
  public void executeReconciliationQueryWithContext(){
    ReconciliationRequest request = new ReconciliationRequest(queryString, limit);
    request.setTypes(new String[] {"http://data.linkedmdb.org/resource/movie/film"});
   
    PropertyContext prop1 = new PropertyContext("http://data.linkedmdb.org/resource/movie/initial_release_date",
                            new TextualValueContext("2006"));
    PropertyContext prop2 = new PropertyContext("http://data.linkedmdb.org/resource/movie/director",
                            new IdentifiedValueContext("http://data.linkedmdb.org/resource/movie/director3"));
    request.setContext(new ReconciliationRequestContext(prop1 ,prop2));
    String sparql = factory.getReconciliationSparqlQuery(request, searchPropertyUris);
    ResultSet resultset = executor.sparql(sparql);
    assertResult("http://data.linkedmdb.org/resource/film/329", resultset,"http://data.linkedmdb.org/resource/film/930");
  }
View Full Code Here


    factory = new PlainSparqlQueryFactory();
  }
 
  @Test
  public void executeSimpleReconciliationQuery(){
    ReconciliationRequest request = new ReconciliationRequest(queryString, limit);
    String sparql = factory.getReconciliationSparqlQuery(request, searchPropertyUris);
    ResultSet resultset = executor.sparql(sparql);
    assertResult(null,resultset,"http://data.linkedmdb.org/resource/film/930","http://data.linkedmdb.org/resource/film/329",
    "http://data.linkedmdb.org/resource/film_series/261");
  }
View Full Code Here

    "http://data.linkedmdb.org/resource/film_series/261");
  }
 
  @Test
  public void executeOneLabelOneTypeReconciliationQuery(){
    ReconciliationRequest request = new ReconciliationRequest(queryString, limit);
    request.setTypes(new String[] {"http://data.linkedmdb.org/resource/movie/film"});
    String sparql = factory.getReconciliationSparqlQuery(request, ImmutableList.of("http://www.w3.org/2000/01/rdf-schema#label"));
    ResultSet resultset = executor.sparql(sparql);
    assertResult(null,resultset,"http://data.linkedmdb.org/resource/film/930","http://data.linkedmdb.org/resource/film/329");
  }
View Full Code Here

    assertResult(null,resultset,"http://data.linkedmdb.org/resource/film/930","http://data.linkedmdb.org/resource/film/329");
  }
 
  @Test
  public void executeReconciliationQueryWithType(){
    ReconciliationRequest request = new ReconciliationRequest(queryString, limit);
    request.setTypes(new String[] {"http://data.linkedmdb.org/resource/movie/film"});
    String sparql = factory.getReconciliationSparqlQuery(request, searchPropertyUris);
    ResultSet resultset = executor.sparql(sparql);
    assertResult("http://data.linkedmdb.org/resource/film_series/261", resultset,"http://data.linkedmdb.org/resource/film/930","http://data.linkedmdb.org/resource/film/329");
  }
View Full Code Here

    assertResult("http://data.linkedmdb.org/resource/film_series/261", resultset,"http://data.linkedmdb.org/resource/film/930","http://data.linkedmdb.org/resource/film/329");
  }
 
  @Test
  public void executeSimpleExactMatchReconciliationQuery(){
    ReconciliationRequest request = new ReconciliationRequest(exactMatchQueryString, limit);
    String sparql = factory.getExactMatchReconciliationSparqlQuery(request, searchPropertyUris);
    ResultSet resultset = executor.sparql(sparql);
    assertResult("http://data.linkedmdb.org/resource/film/329",resultset,"http://data.linkedmdb.org/resource/film/930");
  }
View Full Code Here

    assertResult("http://data.linkedmdb.org/resource/film/329",resultset,"http://data.linkedmdb.org/resource/film/930");
  }
 
  @Test
  public void executeOneLabelOneTypeExactMatchReconciliationQuery(){
    ReconciliationRequest request = new ReconciliationRequest(exactMatchQueryString, limit);
    request.setTypes(new String[] {"http://data.linkedmdb.org/resource/movie/film"});
    String sparql = factory.getExactMatchReconciliationSparqlQuery(request, ImmutableList.of("http://www.w3.org/2000/01/rdf-schema#label"));
    ResultSet resultset = executor.sparql(sparql);
    assertResult("http://data.linkedmdb.org/resource/film/329",resultset,"http://data.linkedmdb.org/resource/film/930");
  }
View Full Code Here

    assertResult("http://data.linkedmdb.org/resource/film/329",resultset,"http://data.linkedmdb.org/resource/film/930");
  }
 
  @Test
  public void executeExactMatchReconciliationQueryWithType(){
    ReconciliationRequest request = new ReconciliationRequest(exactMatchQueryString, limit);
    request.setTypes(new String[] {"http://data.linkedmdb.org/resource/movie/film"});
    String sparql = factory.getExactMatchReconciliationSparqlQuery(request, searchPropertyUris);
    ResultSet resultset = executor.sparql(sparql);
    assertResult("http://data.linkedmdb.org/resource/film_series/261", resultset,"http://data.linkedmdb.org/resource/film/930");
  }
View Full Code Here

    assertResult("http://data.linkedmdb.org/resource/film_series/261", resultset,"http://data.linkedmdb.org/resource/film/930");
  }

  @Test
  public void executeExactMatchWithContextReconciliationQueryWithType(){
    ReconciliationRequest request = new ReconciliationRequest(exactMatchQueryString, limit);
    request.setTypes(new String[] {"http://data.linkedmdb.org/resource/movie/film"});
    PropertyContext prop1 = new PropertyContext("http://example.org/ontology/worksFor", new IdentifiedValueContext("http://example.org/resource/DERI"));
    PropertyContext prop2 = new PropertyContext("http://xmlns.com/foaf/0.1/nick", new TextualValueContext("fadmaa"));
    request.setContext(new ReconciliationRequestContext(prop1, prop2));
    String sparql = factory.getExactMatchReconciliationSparqlQuery(request, searchPropertyUris);
    ResultSet resultset = executor.sparql(sparql);
    assertTrue(!resultset.hasNext());//empty result
  }
View Full Code Here

    registry.loadFromFile(in);
    //verify service is loaded
    ReconciliationService service2 = registry.getService(id, null);
    verifyCorrectService(service2, service);
    //verify service is not initialized
    ReconciliationRequest request = new ReconciliationRequest("query", 10);
    String msg = "";
    try{
      service2.reconcile(request);
    }catch(RuntimeException e){
      msg = e.getMessage();
View Full Code Here

    factory = new BigOwlImSparqlQueryFactory();
  }
 
  @Test
  public void oneLabelTest(){
    ReconciliationRequest request = new ReconciliationRequest(query, limit);
    //this will assure that empty string for type is ignored
    request.setTypes(new String[] {""});
    ImmutableList<String> searchPropertyUris = ImmutableList.of("http://www.w3.org/2000/01/rdf-schema#label");
    String sparql = factory.getReconciliationSparqlQuery(request, searchPropertyUris);
   
    String expected =
      "PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> "+
View Full Code Here

TOP

Related Classes of com.google.refine.org.deri.reconcile.model.ReconciliationRequest

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.