/** * {@inheritDoc} */ @Override public Model union(Model model) { return super.object.union(model); }
public Model union(Model model) { return model.union(model); }
/** * Get all two types of RDF Metadata through GRDDL XSLT: * http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1415068_253892949 */ public Model getRDFMetadata() throws Exception { Model m = getInContentMetadata().union(this.getManifestRDFMetadata()); return m; }
/** * Get in-content metadata cache model * * @return The in-content metadata cache model * @throws Exception */ public Model getInContentMetadataFromCache() throws Exception { Model m = ModelFactory.createDefaultModel(); // find and merge the RDF triples cache from the OdfXMLFile files for (OdfXMLFile file : OdfXMLFile.values()) { for (Model m1 : this.getFileDom(file).getInContentMetadataCache().values()) { m = m.union(m1); } } return m; }
/** * Get in-content metadata model of bookmarks * * @return The in-content metadata model of bookmarks * @throws Exception */ public Model getBookmarkRDFMetadata() throws Exception { Model m = ModelFactory.createDefaultModel(); for (OdfXMLFile file : OdfXMLFile.values()) { OdfFileDom dom = getFileDom(file); m = m.union(dom.getBookmarkRDFMetadata()); } return m; } }
ResourceMapUtil.loadRDF(reader, loaded, baseDir, rdfUri); loadedRems.add(rdfUri); m = load(m.union(loaded), baseDir, loadedRems);
/** * Get In Content RDF Metadata through GRDDL XSLT * http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1415070_253892949 */ public Model getInContentMetadata() throws Exception { Model documentRDFModel = ModelFactory.createDefaultModel(); Model fileRDFModel = null; for (String internalPath : this.getPackage().getFilePaths()) { for (OdfXMLFile file : OdfXMLFile.values()) { if (Util.isSubPathOf(internalPath, this.getDocumentPath()) && internalPath.endsWith(file.getFileName())) { fileRDFModel = getXMLFileMetadata(internalPath); if (fileRDFModel.size() > 0) { documentRDFModel = documentRDFModel.union(fileRDFModel); } break; } } } if (fileRDFModel.size() > 0) { documentRDFModel = documentRDFModel.union(fileRDFModel); } return documentRDFModel; }
ResourceMapUtil.loadRDF(reader, loaded, baseDir, rdfUri); loadedRems.add(rdfUri); m = load(m.union(loaded), baseDir, loadedRems);
/** * Get RDF metadata from manifest.rdf and those rdf files registered in the * manifest.xml as "application/rdf+xml" through GRDDL XSLT * http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1415072_253892949 */ public Model getManifestRDFMetadata() throws Exception { Model m = ModelFactory.createDefaultModel(); for (String internalPath : this.getPackage().getFilePaths()) { if (Util.isSubPathOf(internalPath, this.getDocumentPath()) && this.getPackage().getMediaTypeString(internalPath).endsWith("application/rdf+xml")) { Model m1 = ModelFactory.createDefaultModel(); String RDFBaseUri = Util.getRDFBaseUri(this.getPackage().getBaseURI(), internalPath); m1.read(new InputStreamReader(this.getPackage().getInputStream(internalPath), "utf-8"), RDFBaseUri); // remove the last SLASH at the end of the RDFBaseUri: // test_rdfmeta.odt/ --> test_rdfmeta.odt ResourceUtils.renameResource(m1.getResource(RDFBaseUri), RDFBaseUri.substring(0, RDFBaseUri.length() - 1)); if (m1.size() > 0) { m = m.union(m1); } } } return m; }