[MOBY-guts] biomoby commit
Eddie Kawas
kawas at dev.open-bio.org
Fri Feb 15 08:20:50 UTC 2008
kawas
Fri Feb 15 03:20:50 EST 2008
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder
In directory dev.open-bio.org:/tmp/cvs-serv27231/Java/src/main/org/biomoby/client/rdf/builder
Modified Files:
ServiceInstanceRDF.java
Log Message:
added some new methods, etc.
moby-live/Java/src/main/org/biomoby/client/rdf/builder ServiceInstanceRDF.java,1.35,1.36
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java 2008/02/14 02:59:32 1.35
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java 2008/02/15 08:20:50 1.36
@@ -226,12 +226,15 @@
private final String createRDF(MobyService[] services) {
Model model = createRDFModel(ModelFactory.createDefaultModel(),
services, true);
+ return serializeModel(model);
+ }
+
+ public final String serializeModel(Model model) {
FilteredStream stream = new FilteredStream(new ByteArrayOutputStream());
RDFWriter writer = model.getWriter("RDF/XML-ABBREV");
writer.setProperty("showXmlDeclaration", "false");
- writer.setProperty("tab", "5");
+ writer.setProperty("tab", "1");
writer.write(model, stream, null);
-
return stream.getOutput();
}
@@ -242,13 +245,7 @@
private final String createRDF(MobyService[] services, boolean useLSIDs) {
Model model = createRDFModel(ModelFactory.createDefaultModel(),
services, useLSIDs);
- FilteredStream stream = new FilteredStream(new ByteArrayOutputStream());
- RDFWriter writer = model.getWriter("RDF/XML-ABBREV");
- writer.setProperty("showXmlDeclaration", "false");
- writer.setProperty("tab", "5");
- writer.write(model, stream, null);
-
- return stream.getOutput();
+ return serializeModel(model);
}
/**
@@ -264,6 +261,9 @@
*/
public final Model createRDFModel(Model model, MobyService[] services,
boolean useLSIDs) {
+ if (model == null) {
+ model = ModelFactory.createDefaultModel();
+ }
// set up the prefixes/namespaces
Map map = model.getNsPrefixMap();
map.put("mobyService", SRV);
More information about the MOBY-guts
mailing list