Model read(String file, boolean type) throws IOException { if (!type) { return loadNT(factory.open(file),file); } final String uri = file; return loadRDF( new InFactoryX(){ @Override public InputStream open() throws IOException { return factory.open(uri); } } , this, uri); }
Model read(String file, boolean type) throws IOException { if (!type) { return loadNT(factory.open(file),file); } final String uri = file; return loadRDF( new InFactoryX(){ @Override public InputStream open() throws IOException { return factory.open(uri); } } , this, uri); }
private Model loadRDF(final InputStreamFactoryTests fact, final String file) { Model m = null; String base = fact.getBase().toString(); if (!base.endsWith("/")) base = base + "/"; try ( InputStream in = fact.fullyOpen(file) ) { if (in == null ) return null; m = loadRDF(new InFactoryX(){ @Override public InputStream open() throws IOException { return fact.fullyOpen(file); } }, null, base + file); } catch (JenaException e) { // System.out.println(e.getMessage()); throw e; } catch (Exception e) { // e.printStackTrace(); if (file.equals("Manifest.rdf")) { System.err.println("Failed to open Manifest.rdf"); e.printStackTrace(); } } return m; }
private Model loadRDF(final InputStreamFactoryTests fact, final String file) { Model m = null; String base = fact.getBase().toString(); if (!base.endsWith("/")) base = base + "/"; try ( InputStream in = fact.fullyOpen(file) ) { if (in == null ) return null; m = loadRDF(new InFactoryX(){ @Override public InputStream open() throws IOException { return fact.fullyOpen(file); } }, null, base + file); } catch (JenaException e) { // System.out.println(e.getMessage()); throw e; } catch (Exception e) { // e.printStackTrace(); if (file.equals("Manifest.rdf")) { System.err.println("Failed to open Manifest.rdf"); e.printStackTrace(); } } return m; }
Model read(Property p) throws IOException { Resource file = testID.getRequiredProperty(p).getResource(); Resource t = file.getRequiredProperty(RDF.type).getResource(); final String uri = file.getURI(); if (ntriple.equals(t)) { return loadNT(factory.open(uri),uri); } else if (rdfxml.equals(t)) { return loadRDF( new InFactoryX(){ @Override public InputStream open() throws IOException { return factory.open(uri); } } , this, uri); } else { fail("Unrecognized file type: " + t); } return null; } @Override
Model read(Property p) throws IOException { Resource file = testID.getRequiredProperty(p).getResource(); Resource t = file.getRequiredProperty(RDF.type).getResource(); final String uri = file.getURI(); if (ntriple.equals(t)) { return loadNT(factory.open(uri),uri); } else if (rdfxml.equals(t)) { return loadRDF( new InFactoryX(){ @Override public InputStream open() throws IOException { return factory.open(uri); } } , this, uri); } else { fail("Unrecognized file type: " + t); } return null; } @Override