Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added a method to add triples to a store directly from a String

  • Loading branch information...
commit dc04e6eb19a807cbd05f0b79656fb39dd7dd5d66 1 parent d9fa423
@egonw egonw authored
View
13 plugins/net.bioclipse.rdf/src/net/bioclipse/rdf/business/IRDFManager.java
@@ -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," +
@@ -79,6 +77,17 @@ public IRDFStore importFromStream(
) 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)
throws IOException, BioclipseException, CoreException;
View
7 plugins/net.bioclipse.rdf/src/net/bioclipse/rdf/business/RDFManager.java
@@ -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);
Please sign in to comment.
Something went wrong with that request. Please try again.