Skip to content

Commit

Permalink
Added a method to add triples to a store directly from a String
Browse files Browse the repository at this point in the history
  • Loading branch information
egonw committed Nov 6, 2011
1 parent d9fa423 commit dc04e6e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Expand Up @@ -27,8 +27,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;

import com.hp.hpl.jena.rdf.model.Model;

@PublishedClass("Contains RDF related methods")
@TestClasses(
"net.bioclipse.rdf.tests.APITest," +
Expand Down Expand Up @@ -78,6 +76,17 @@ public IRDFStore importFromStream(
IRDFStore store, InputStream stream, String format
) throws IOException, BioclipseException, CoreException;

@Recorded
@PublishedMethod(
params = "IRDFStore store, String rdfContent, String format",
methodSummary = "Loads triples from the String in the given format " +
"(\"RDF/XML\", \"N-TRIPLE\", \"TURTLE\" and \"N3\") into " +
"the given store"
)
public IRDFStore importFromString(
IRDFStore store, String rdfContent, String format
) throws IOException, BioclipseException, CoreException;

@Recorded
public IRDFStore importFile(IRDFStore store, IFile target, String format,
IProgressMonitor monitor)
Expand Down
Expand Up @@ -107,6 +107,13 @@ public IRDFStore importFromStream(IRDFStore store, InputStream stream,
return store;
}

public IRDFStore importFromString(IRDFStore store, String rdfContent,
String format, IProgressMonitor monitor)
throws IOException, BioclipseException, CoreException {
InputStream input = new ByteArrayInputStream(rdfContent.getBytes());
return importFromStream(store, input, format, monitor);
}

public IRDFStore importURL(IRDFStore store, String url, IProgressMonitor monitor)
throws IOException, BioclipseException, CoreException {
URL realURL = new URL(url);
Expand Down

0 comments on commit dc04e6e

Please sign in to comment.