예제 #1
0
  @Test
  public void resetJena() {
    IO_JenaReaders.wireIntoJena();
    IO_JenaReaders.resetJena();
    RDFReaderFImplExposingProtected readerF = new RDFReaderFImplExposingProtected();
    Map<String, String> defaults = readerF.defaultReaders();
    assertFalse(defaults.isEmpty());
    for (String lang : defaults.keySet()) {
      assertEquals(defaults.get(lang), readerF.getLangToClassName().get(lang));
      if (lang.equals("GRDDL")) {
        // Can't load
        continue;
      }
      assertEquals(defaults.get(lang), readerF.getReader(lang).getClass().getName());
    }

    // And unregistered our additional langs
    assertEquals("", readerF.getLangToClassName().get("JSON-LD"));
    assertEquals("", readerF.getLangToClassName().get("RDF/JSON"));
    IO_JenaReaders.wireIntoJena();
  }
예제 #2
0
 @Test
 public void wireIntoJena() {
   IO_JenaReaders.wireIntoJena();
   RDFReaderFImpl readerF = new RDFReaderFImpl();
   assertEquals(RDFReaderRIOT_Web.class, readerF.getReader().getClass());
   assertEquals(RDFReaderRIOT_RDFXML.class, readerF.getReader("RDF/XML").getClass());
   assertEquals(RDFReaderRIOT_RDFXML.class, readerF.getReader("RDF/XML-ABBREV").getClass());
   assertEquals(RDFReaderRIOT_NT.class, readerF.getReader("N-TRIPLES").getClass());
   assertEquals(RDFReaderRIOT_NT.class, readerF.getReader("N-Triples").getClass());
   assertEquals(RDFReaderRIOT_NT.class, readerF.getReader("N-TRIPLE").getClass());
   assertEquals(RDFReaderRIOT_TTL.class, readerF.getReader("N3").getClass());
   assertEquals(RDFReaderRIOT_TTL.class, readerF.getReader("TURTLE").getClass());
   assertEquals(RDFReaderRIOT_TTL.class, readerF.getReader("Turtle").getClass());
   assertEquals(RDFReaderRIOT_TTL.class, readerF.getReader("TTL").getClass());
   assertEquals(RDFReaderRIOT_JSONLD.class, readerF.getReader("JSON-LD").getClass());
   assertEquals(RDFReaderRIOT_JSONLD.class, readerF.getReader("JSONLD").getClass());
   assertEquals(RDFReaderRIOT_RDFJSON.class, readerF.getReader("RDF/JSON").getClass());
 }