for (j = 1; j < lastInProp; j++) { int eq = args[j].indexOf("="); rdr.setProperty( args[j].substring(0, eq), args[j].substring(eq + 1));
reader.setProperty(ResourceMapConstants.JENA_ERROR_MODE_URI, ResourceMapConstants.JENA_ERROR_MODE_STRICT); ResourceMapUtil.loadRDF(reader, loaded, baseDir, rdfUri); loadedRems.add(rdfUri);
reader.setProperty(ResourceMapConstants.JENA_ERROR_MODE_URI, ResourceMapConstants.JENA_ERROR_MODE_STRICT); ResourceMapUtil.loadRDF(reader, loaded, baseDir, rdfUri); loadedRems.add(rdfUri);
/** * Create a new session using properties specified in the context. * * @param ctx * The context creating this session object. * The context contains all the configuration settings for this object. * @param args * Runtime session arguments. */ protected RdfParserSession(RdfParser ctx, ParserSessionArgs args) { super(ctx, args); this.ctx = ctx; model = ModelFactory.createDefaultModel(); addModelPrefix(ctx.getJuneauNs()); addModelPrefix(ctx.getJuneauBpNs()); pRoot = model.createProperty(ctx.getJuneauNs().getUri(), RDF_juneauNs_ROOT); pValue = model.createProperty(ctx.getJuneauNs().getUri(), RDF_juneauNs_VALUE); pType = model.createProperty(ctx.getJuneauBpNs().getUri(), RDF_juneauNs_TYPE); pRdfType = model.createProperty("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"); rdfReader = model.getReader(ctx.getRdfLanguage()); // Note: NTripleReader throws an exception if you try to set any properties on it. if (! ctx.getRdfLanguage().equals(LANG_NTRIPLE)) { for (Map.Entry<String,Object> e : ctx.jenaSettings.entrySet()) rdfReader.setProperty(e.getKey(), e.getValue()); } }
private void checkAndLoad(Resource resmap, File base_dir, Model model) throws PackageValidationException { RDFReader reader = model.getReader(); reader.setProperty(JENA_ERROR_MODE_URI, JENA_ERROR_MODE_STRICT); SimpleRDFErrorHandler handler = new SimpleRDFErrorHandler(); reader.setErrorHandler(handler); try { ResourceMapUtil.loadRDF(reader, model, base_dir, resmap.getURI()); } catch (PackageException e) { throw new PackageValidationException(e); } if (!handler.isErrorFree()) { throw new PackageValidationException("Error loading resource map " + resmap + ": " + handler.getErrorDetails()); } }
reader.setProperty(JENA_ERROR_MODE_URI, JENA_ERROR_MODE_STRICT);