/** * Adds RDF statements to the model. * A subsequent call to {@link #build()} is required for committing the data to the model. * * @param rdfInput An input stream to RDF/XML data. * @param format The base uri to be used when converting relative URI's to absolute URI's. */ @Override public void addRDF(InputStream rdfInput, String format) { model.read(rdfInput, format); }
/** * Adds RDF statements to the model. * A subsequent call to {@link #build()} is required for committing the data to the model. * * @param url An URL to RDF data in RDF/XML format. * @param format The base uri to be used when converting relative URI's to absolute URI's. */ @Override public void addRDF(String url, String format) { model.read(url, format); }
/** * Adds RDF statements to the model. * A subsequent call to {@link #build()} is required for committing the data to the model. * * @param rdfInput An input stream to the RDF data. Its format is defined by the <code>format</code> parameter. * @param base The base uri to be used when converting relative URI's to absolute URI's. * @param format The format of the RDF data. One of "RDF/XML", "N-TRIPLE", "TURTLE" (or "TTL") and "N3" */ @Override public void addRDF(InputStream rdfInput, String base, String format) { model.read(rdfInput, base, format); }
/** * Adds RDF statements to the underlying model. * * @param url URL to a RDF/XML file containing the RDF data to be added. */ @Override public void addRDF(String url) { model.read(url); }
/** * Adds RDF statements to the model. * A subsequent call to {@link #build()} is required for committing the data to the model. * * @param url An URL to RDF data in the specified format. * @param base The base uri to be used when converting relative URI's to absolute URI's. * @param format The format of the RDF data. One of "RDF/XML", "N-TRIPLE", "TURTLE" (or "TTL") and "N3" */ @Override public void addRDF(String url, String base, String format) { model.read(url, base, format); }
public OntModel readJenaModel(InputStream in) { OntModel ontModel = createModel(); // ontModel.setStrictMode(true); // ontModel.getReader().setProperty("error-mode", "strict"); ontModel.read(in, ""); //ontModel.loadImports(); return ontModel; }
private LocalWorld() { File modelFile = new File(calculateComponentsDirectory(), FILENAME); model = createOntologyModel(); try { if (modelFile.exists()) model.read(new StringReader(readFileToString(modelFile)), null, ENCODING); } catch (IOException e) { logger.error("failed to construct local annotation world", e); } }
private LocalWorld() { File modelFile = new File(calculateComponentsDirectory(), FILENAME); model = createOntologyModel(); try { if (modelFile.exists()) model.read(new StringReader(readFileToString(modelFile)), null, ENCODING); } catch (IOException e) { logger.error("failed to construct local annotation world", e); } }
model.read(new StringReader(IOUtils.toString(in, "UTF-8")), url.toString()); } catch (MalformedURLException e) {
model.read(new StringReader(IOUtils.toString(in, "UTF-8")), url.toString()); } catch (MalformedURLException e) {
ontHandler.getOntModel().read(s, null, "N3"); else if (Files.getFileExtension(sourceFile.getName()).equalsIgnoreCase("TTL")) ontHandler.getOntModel().read(s, null, "TURTLE"); else if (Files.getFileExtension(sourceFile.getName()).equalsIgnoreCase("NT")) ontHandler.getOntModel().read(s, null, "N-TRIPLE"); else ontHandler.getOntModel().read(s, null); // default lang = "RDF/XML"
this.model.read(in, "http://myevaluation.com#");
input.read(new ByteArrayInputStream(bytes), "");
/** * Read a stream in RDF and return the corresponding set of services * as Java Objects * * @param in The input stream of MSM services * @param baseUri Base URI to use for parsing * @param syntax used within the stream * @return The collection of Services parsed from the stream */ @Override public List<Service> parse(InputStream in, String baseUri, Syntax syntax) { OntModel model = null; List<Service> result = new ArrayList<Service>(); try { // create an empty model model = ModelFactory.createOntologyModel(OntModelSpec.RDFS_MEM); // Parse the stream into a model model.read(in, baseUri, syntax.getName()); result = parseService(model); } finally { if (model != null) model.close(); } return result; }
jenamodel.read(new ByteArrayInputStream(out.toByteArray()), id.toString().replace("<", "") .replace(">", ""), format);
input.read(url);
/** * This shows no problems * * @param fName * @throws NdlException */ public void openModel(String fName) throws NdlException { String ndlRequest = loadFile(fName); ByteArrayInputStream modelStream = new ByteArrayInputStream(ndlRequest.getBytes()); requestModel = NdlModel.getRequestModelFromStream(modelStream, OntModelSpec.OWL_MEM_RDFS_INF, true); // need some imports for inference to work for (String model : inferenceModels) requestModel.read(NdlCommons.ORCA_NS + model); ValidityReport rep = requestModel.validate(); getValidityOutput(rep); }
public JenaEditorMap(BioPAXLevel level) { super(level); OntModel ontologyDefinition = JenaIOHandler.createModel(); ontologyDefinition.read(this.level.getLevelFileAsStream(), this.level.getNameSpace()); init(); preprocessClasses(ontologyDefinition); preprocessProperties(ontologyDefinition); preprocessRestrictions(ontologyDefinition); }
ontModel.read(inOnt, null);