@Override public Object getUnderlyingModelImplementation() { return this.delegatedModel.getUnderlyingModelImplementation(); }
@Override public Object getUnderlyingModelImplementation() { return this.delegatedModel.getUnderlyingModelImplementation(); }
@Override public Object getUnderlyingModelImplementation() { log.debug("getUnderlyingModelImplementation"); return this.model.getUnderlyingModelImplementation(); }
@Override public void addModel(Model model) { if (model.getUnderlyingModelImplementation() instanceof com.hp.hpl.jena.rdf.model.Model) { com.hp.hpl.jena.rdf.model.Model otherJenaModel = (com.hp.hpl.jena.rdf.model.Model) model .getUnderlyingModelImplementation(); this.jenaModel.add(otherJenaModel); } else { super.addModel(model); } } }
public static void write(Model m, String filename, String format) throws ModelRuntimeException { Model jenaModel = new ModelImplJena(Reasoning.none); jenaModel.addAll(m.iterator()); com.hp.hpl.jena.rdf.model.Model jm = (com.hp.hpl.jena.rdf.model.Model)jenaModel .getUnderlyingModelImplementation(); DumpUtils.addCommonPrefixesToJenaModel(jm); try { // encoding! if(format.equalsIgnoreCase("rdf/xml")) { log.error("Writing RDF/XML in UTF-8..."); FileOutputStream fos; fos = new FileOutputStream(new File(filename)); OutputStreamWriter osw = new OutputStreamWriter(fos, StandardCharsets.UTF_8); // Jena is not adding this to the XML file, when choosing UTF-8 // encoding osw.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"); jm.write(osw, "RDF/XML", ""); } else jm.write(new FileWriter(new File(filename)), format, ""); } catch(FileNotFoundException e) { throw new ModelRuntimeException(e); } catch(IOException e) { throw new ModelRuntimeException(e); } }
@Override public void addModel(Model model, URI contextURI) { for (String prefix : model.getNamespaces().keySet()) { this.dataset.getDefaultModel().setNsPrefix(prefix, model.getNamespace(prefix)); } if (model instanceof ModelImplJena) { this.dataset.getNamedModel(contextURI.toString()).add( ((com.hp.hpl.jena.rdf.model.Model) model .getUnderlyingModelImplementation())); } else { super.addModel(model, contextURI); } } }
public static void write(Model m, Writer w) throws ModelRuntimeException { Model jenaModel = new ModelImplJena(Reasoning.none); jenaModel.addAll(m.iterator()); com.hp.hpl.jena.rdf.model.Model jm = (com.hp.hpl.jena.rdf.model.Model)jenaModel .getUnderlyingModelImplementation(); try { writeJenaModel(jm, w); } catch(IOException e) { throw new ModelRuntimeException(e); } }
@Override public boolean addModel(Model model) { for (String prefix : model.getNamespaces().keySet()) { this.dataset.getDefaultModel().setNsPrefix(prefix, model.getNamespace(prefix)); } if (model instanceof ModelImplJena) { this.dataset.getNamedModel(model.getContextURI().toString()).add( ((com.hp.hpl.jena.rdf.model.Model) model .getUnderlyingModelImplementation())); return true; } else { return super.addModel(model); } }
if(source.getUnderlyingModelImplementation().equals( target.getUnderlyingModelImplementation().getClass())) {