private void writeHeader(OWLOntology ontology, Writer writer) throws OWLRendererException { OBOTagValuePairList tvpList = new OBOTagValuePairList(OBOVocabulary.getHeaderTags()); tvpList.setDefault(OBOVocabulary.DEFAULT_NAMESPACE, defaultPrefix); for (OWLAnnotation ax : ontology.getAnnotations()) { if (ax.getProperty().isComment()) { tvpList.addPair(OBOVocabulary.REMARK, ((OWLLiteral) ax.getValue()).getLiteral()); } else { tvpList.visit(ax); } } for (OWLImportsDeclaration importDecl : ontology.getImportsDeclarations()) { tvpList.addPair(OBOVocabulary.IMPORT, importDecl.getIRI().toString()); } Map<String, String> namespace2PrefixMap = loadUsedNamespaces(ontology); for (String namespace : namespace2PrefixMap.keySet()) { String mapping = namespace2PrefixMap.get(namespace) + " " + namespace; tvpList.addPair(OBOVocabulary.ID_SPACE, mapping); } // overwrite the existing values for below tvpList.setPair(OBOVocabulary.FORMAT_VERSION, "1.2"); tvpList.setPair(OBOVocabulary.DATE, getTimestampFormatter().format(new Date(System.currentTimeMillis()))); tvpList.setPair(OBOVocabulary.SAVED_BY, System.getProperty("user.name")); tvpList.setPair(OBOVocabulary.AUTO_GENERATED_BY, VersionInfo.getVersionInfo().toString()); tvpList.write(writer); }
private void writeHeader(OWLOntology ontology, Writer writer) throws OWLRendererException { OBOTagValuePairList tvpList = new OBOTagValuePairList(OBOVocabulary.getHeaderTags()); tvpList.setDefault(OBOVocabulary.DEFAULT_NAMESPACE, defaultPrefix); for (OWLAnnotation ax : ontology.getAnnotations()) { if (ax.getProperty().isComment()) { tvpList.addPair(OBOVocabulary.REMARK, ((OWLLiteral) ax.getValue()).getLiteral()); } else { tvpList.visit(ax); } } for (OWLImportsDeclaration importDecl : ontology.getImportsDeclarations()) { tvpList.addPair(OBOVocabulary.IMPORT, importDecl.getIRI().toString()); } Map<String, String> namespace2PrefixMap = loadUsedNamespaces(ontology); for (String namespace : namespace2PrefixMap.keySet()) { String mapping = namespace2PrefixMap.get(namespace) + " " + namespace; tvpList.addPair(OBOVocabulary.ID_SPACE, mapping); } // overwrite the existing values for below tvpList.setPair(OBOVocabulary.FORMAT_VERSION, "1.2"); tvpList.setPair(OBOVocabulary.DATE, getTimestampFormatter().format(new Date(System.currentTimeMillis()))); tvpList.setPair(OBOVocabulary.SAVED_BY, System.getProperty("user.name")); tvpList.setPair(OBOVocabulary.AUTO_GENERATED_BY, VersionInfo.getVersionInfo().toString()); tvpList.write(writer); }
private void writeHeader(OWLOntology ontology, Writer writer) { OBOTagValuePairList tvpList = new OBOTagValuePairList(OBOVocabulary.getHeaderTags()); tvpList.setDefault(OBOVocabulary.DEFAULT_NAMESPACE, defaultPrefix); for (OWLAnnotation ax : ontology.getAnnotations()) { if (ax.getProperty().isComment()) { tvpList.addPair(OBOVocabulary.REMARK, ((OWLLiteral) ax.getValue()).getLiteral()); } else { tvpList.visit(ax); } } for (OWLImportsDeclaration importDecl : ontology.getImportsDeclarations()) { tvpList.addPair(OBOVocabulary.IMPORT, importDecl.getIRI().toString()); } Map<String, String> namespace2PrefixMap = loadUsedNamespaces(ontology); for (String namespace : namespace2PrefixMap.keySet()) { String mapping = namespace2PrefixMap.get(namespace) + " " + namespace; tvpList.addPair(OBOVocabulary.ID_SPACE, mapping); } // overwrite the existing values for below tvpList.setPair(OBOVocabulary.FORMAT_VERSION, "1.2"); tvpList.setPair(OBOVocabulary.DATE, getTimestampFormatter().format(new Date(System.currentTimeMillis()))); tvpList.setPair(OBOVocabulary.SAVED_BY, System.getProperty("user.name")); tvpList.setPair(OBOVocabulary.AUTO_GENERATED_BY, VersionInfo.getVersionInfo().toString()); tvpList.write(writer); }