Package com.hp.hpl.jena.rdf.model

Examples of com.hp.hpl.jena.rdf.model.RDFReader


//      Normalizer.  isNormalized(
//              "\u0bcd\u0ba4\u0bbf\u0baf\u0bbe"
//              ,Normalizer.NFC,0);
     
      Model m = createMemModel();
      RDFReader rdr = m.getReader();
      try(FileInputStream r = new FileInputStream("testing/arp/i18n/icubug.rdf")){
          rdr.setErrorHandler(this);
          expected = new int[] { WARN_STRING_COMPOSING_CHAR  };
          rdr.read(m, r, "http://example.org/");
      }
      checkExpected();
  }
View Full Code Here


//        Normalizer.  isNormalized(
//                "\u0bcd\u0ba4\u0bbf\u0baf\u0bbe"
//                ,Normalizer.NFC,0);

      Model m = createMemModel();
      RDFReader rdr = m.getReader();
      try(FileInputStream r = new FileInputStream("testing/arp/i18n/icubugtwo.rdf")) {
          rdr.setErrorHandler(this);
          expected = new int[] { WARN_STRING_NOT_NORMAL_FORM_C };
          rdr.read(m, r, "http://example.org/");
      }
      checkExpected();
  }
View Full Code Here

    if (r.getEncoding().startsWith("UTF")) {
      // see above for warning message.
      return;
    }
    Model m = createMemModel();
    RDFReader rdr = m.getReader();
   
    rdr.setErrorHandler(this);
    expected = new int[] { WARN_ENCODING_MISMATCH, ERR_ENCODING_MISMATCH };
    rdr.read(m, r, "http://example.org/");

    checkExpected();
  }
View Full Code Here

  }

  public void testNullBaseParamOK() throws IOException {
    Model m = createMemModel();
    Model m1 = createMemModel();
    RDFReader rdr = m.getReader();
    try (FileInputStream fin = new FileInputStream("testing/wg/rdfms-identity-anon-resources/test001.rdf") ) {
        rdr.setErrorHandler(this);
        expected = new int[] {};
        rdr.read(m, fin, "http://example.org/");
    }
    try (FileInputStream fin = new FileInputStream("testing/wg/rdfms-identity-anon-resources/test001.rdf")) {
        rdr.read(m1, fin, null);
    }
    assertTrue("Base URI should have no effect.", m.isIsomorphicWith(m1));
    checkExpected();
  }
View Full Code Here

        assertTrue("Dan Bri nested XML Base.", m.isIsomorphicWith(m1));
    }

  public void testNullBaseParamError() throws IOException {
    Model m = createMemModel();
    RDFReader rdr = m.getReader();
    try (FileInputStream fin = new FileInputStream("testing/wg/rdfms-difference-between-ID-and-about/test1.rdf")) {
      rdr.setErrorHandler(this);
      expected = new int[] { ERR_RESOLVING_URI_AGAINST_NULL_BASE, WARN_RELATIVE_URI};
      rdr.read(m, fin, null);
    }
    checkExpected();
  }
View Full Code Here

  }

  public void testEmptyBaseParamOK() throws IOException {
      Model m = createMemModel();
      Model m1 = createMemModel();
      RDFReader rdr = m.getReader();
      try (FileInputStream fin = new FileInputStream("testing/wg/rdfms-identity-anon-resources/test001.rdf")){
          rdr.setErrorHandler(this);
          expected = new int[] {};
          rdr.read(m, fin, "http://example.org/");
      }
      try (FileInputStream fin = new FileInputStream("testing/wg/rdfms-identity-anon-resources/test001.rdf")) {
          rdr.read(m1, fin, "");
      }
      assertTrue("Empty base URI should have no effect.[" + m1.toString()
                 + "]", m.isIsomorphicWith(m1));
      checkExpected();
  }
View Full Code Here

      checkExpected();
  }

  public void testEmptyBaseParamError() throws IOException {
    Model m = createMemModel();
    RDFReader rdr = m.getReader();
    try (FileInputStream fin = new FileInputStream("testing/wg/rdfms-difference-between-ID-and-about/test1.rdf")) {
        rdr.setErrorHandler(this);
        expected = new int[] { WARN_RESOLVING_URI_AGAINST_EMPTY_BASE};
        rdr.read(m, fin, "");
    }
    Model m1 = createMemModel();
    m1.createResource("#foo").addProperty(RDF.value, "abc");
    assertTrue("Empty base URI should produce relative URI.["
        + m.toString() + "]", m.isIsomorphicWith(m1));
View Full Code Here

    checkExpected();
  }

    public void testBadBaseParamError() throws IOException {
        Model m = createMemModel();
        RDFReader rdr = m.getReader();
        try (FileInputStream fin = new FileInputStream("testing/wg/rdfms-difference-between-ID-and-about/test1.rdf")) {
            rdr.setErrorHandler(this);
            expected = new int[] { WARN_MALFORMED_URI,
                WARN_MALFORMED_URI,
                //        WARN_RELATIVE_URI, ERR_RESOLVING_AGAINST_MALFORMED_BASE};
                ERR_RESOLVING_AGAINST_MALFORMED_BASE};
            rdr.read(m, fin, "http://jjc^3.org/demo.mp3");
        }
        Model m1 = createMemModel();
        assertTrue("Bad base URI should produce no URIs in model.["
                + m.toString() + "]", m.isIsomorphicWith(m1));
        checkExpected();
View Full Code Here

  public void testLang() throws Exception {
      Model m = ModelFactory.createDefaultModel();
      Model m2 = ModelFactory.createDefaultModel();
      RDFEHArray eh = new RDFEHArray();
      try ( InputStream in = new FileInputStream("testing/wg/rdfms-xmllang/test004.rdf") ) {
          RDFReader w = m.getReader();
          w.setErrorHandler(eh);
          w.read(m, in, "http://example.org/");
      }

      RDFEHArray eh2 = new RDFEHArray();

      try ( InputStream in = new FileInputStream("testing/wg/rdfms-xmllang/test003.rdf") ) {
View Full Code Here

    }
   
    public void testBadBaseParamOK() throws IOException {
        Model m = createMemModel();
        Model m1 = createMemModel();
        RDFReader rdr = m.getReader();
        try (FileInputStream fin = new FileInputStream("testing/wg/rdfms-identity-anon-resources/test001.rdf")) {

            rdr.setErrorHandler(this);
            expected = new int[] { WARN_MALFORMED_URI };
            rdr.read(m, fin, "http://jjc^3.org/demo.mp3");
        }
        try(FileInputStream fin = new FileInputStream("testing/wg/rdfms-identity-anon-resources/test001.rdf")) {
            rdr.read(m1, fin, "");
        }
        assertTrue("Bad base URI should have no effect on model.[" + m1.toString()
                   + "]", m.isIsomorphicWith(m1));
        checkExpected();
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.rdf.model.RDFReader

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.