Skip to content

Commit

Permalink
Added a method to return a Turtle string representation of a store
Browse files Browse the repository at this point in the history
  • Loading branch information
egonw committed Dec 24, 2012
1 parent be24cd4 commit 94f1ad2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
Expand Up @@ -228,6 +228,14 @@ public void saveRDFN3(IRDFStore store, String fileName)
public String asRDFN3(IRDFStore store)
throws BioclipseException;

@Recorded
@PublishedMethod(
params = "IRDFStore store",
methodSummary = "Returns a String with the Turtle serialization."
)
public String asTurtle(IRDFStore store)
throws BioclipseException;

@Recorded
@PublishedMethod(
params = "IRDFStore store, String fileName",
Expand Down
Expand Up @@ -304,8 +304,21 @@ public String asRDFN3(IRDFStore store)

public String asRDFN3(IRDFStore store, IProgressMonitor monitor)
throws BioclipseException {
String type = "N3";
return asRDF(store, "N3", monitor);
}

public String asTurtle(IRDFStore store)
throws BioclipseException {
return asTurtle(store, null);
};

public String asTurtle(IRDFStore store, IProgressMonitor monitor)
throws BioclipseException {
return asRDF(store, "TURTLE", monitor);
}

private String asRDF(IRDFStore store, String type, IProgressMonitor monitor)
throws BioclipseException {
if (monitor == null)
monitor = new NullProgressMonitor();
monitor.beginTask("Converting into N3", 1);
Expand Down

0 comments on commit 94f1ad2

Please sign in to comment.