Package com.google.refine.rdf

Examples of com.google.refine.rdf.RdfSchema


    project.update();
    //Guard assertion
    assertEquals(project.rows.size(),2);
   
    //preparing the RDF schema skeleton
    RdfSchema schema = RdfSchema.reconstruct(ParsingUtilities.evaluateJsonStringToObject(json));
    project.overlayModels.put("rdfSchema", schema);
   
    //building the expected model
    expected = new SailRepository(new MemoryStore());
    expected.initialize();
View Full Code Here


public class AddPrefixTest {

  @Test
  public void testAddNewPrefix() throws Exception{
    RdfSchema schema = new RdfSchema();
    assertFalse(schema.getPrefixesMap().containsKey("foaf"));
    schema.addPrefix("foaf", "http://xmlns.com/foaf/0.1/");
   
    assertTrue(schema.getPrefixesMap().containsKey("foaf"));
  }
View Full Code Here

    ctxt.setVocabularySearcher(searcher);
  }
 
  @Test
  public void testAddPrefixCommand() throws Exception{
    RdfSchema schema = new RdfSchema();
    AddPrefixCommand command = new FakeAddPrefixCommand(ctxt,schema);
    MockHttpServletRequest request = new MockHttpServletRequest();
    MockHttpServletResponse response = new MockHttpServletResponse();
   
    request.addParameter("name", name);
    request.addParameter("uri", uri);
    request.addParameter("fetch", "web");
    request.addParameter("project", projectId);
    request.addParameter("fetch-url", uri);
   
    assertFalse(schema.getPrefixesMap().containsKey("foaf"));
    assertTrue(searcher.searchClasses("foaf:P", projectId).isEmpty());
    command.doPost(request, response);
    //verification
   
    //prefix is added to the project
    assertTrue(schema.getPrefixesMap().containsKey("foaf"));
    //search
    assertFalse(searcher.searchClasses("foaf:P", projectId).isEmpty());
  }
View Full Code Here

TOP

Related Classes of com.google.refine.rdf.RdfSchema

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.