Package com.stardog.stark.io
Class RDFParsers
java.lang.Object
com.stardog.stark.io.RDFParsers
Utilities for working with RDFParser
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Michael Grove
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturn theparserassociated with the given formatread(InputStream theStream, RDFFormat theFormat) Parse the RDF from theinputand return the resulting statementsread(InputStream theStream, RDFFormat theFormat, Options theOptions) Parse the RDF from theinputand return the resulting statementsstatic <T> Tread(InputStream theStream, RDFFormat theFormat, Options theOptions, CollectingRDFHandler<T> theHandler) Parse the RDF from the specified streamstatic voidread(InputStream theStream, RDFFormat theFormat, Options theOptions, RDFHandler theHandler) Parse the RDF from the specified streamParse the RDF from the given `String` input and return the resulting statements using the default parsing optionsParser the RDF from the given `String` input and return the resulting statements.Parse the RDF in the specified file and return the resulting statements.Parse the RDF in the specified file and return the resulting statements.Parse the RDF in the specified file and return the resulting statementsstatic <T> Tread(Path thePath, RDFFormat theFormat, Options theOptions, CollectingRDFHandler<T> theHandler) Parse the RDF in the specified filestatic void
-
Method Details
-
register
-
forFormat
Return theparserassociated with the given format- Parameters:
theFormat- the format you wish to parse- Returns:
- the parser for the format
-
read
@Nonnull public static Set<Statement> read(@Nonnull InputStream theStream, @Nonnull RDFFormat theFormat) throws IOException Parse the RDF from theinputand return the resulting statements- Parameters:
theStream- the `InputStream` to read fromtheFormat- the format of the RDF- Returns:
- the parsed RDF
- Throws:
IOException- if there was an error while reading from the streamInvalidRDF- if the RDF syntax was invalid wrt to theformatIllegalArgumentException- if there is no known parser for the `RDFFormat`
-
read
@Nonnull public static Set<Statement> read(@Nonnull String theInput, @Nonnull RDFFormat theFormat) throws IOException Parse the RDF from the given `String` input and return the resulting statements using the default parsing options- Parameters:
theInput- the RDF inputtheFormat- the format for the RDF- Returns:
- the parsed statements
- Throws:
IOException- if there was an error while reading from the streamInvalidRDF- if the RDF syntax was invalid wrt to theformatIllegalArgumentException- if there is no known parser for the `RDFFormat`
-
read
@Nonnull public static Set<Statement> read(@Nonnull String theInput, @Nonnull RDFFormat theFormat, @Nonnull Options theOptions) throws IOException Parser the RDF from the given `String` input and return the resulting statements.- Parameters:
theInput- the RDF inputtheFormat- the format for the RDFtheOptions- the parser options- Returns:
- the parsed statements
- Throws:
IOException- if there was an error while reading from the streamInvalidRDF- if the RDF syntax was invalid wrt to theformatIllegalArgumentException- if there is no known parser for the `RDFFormat`
-
read
@Nonnull public static Set<Statement> read(@Nonnull InputStream theStream, @Nonnull RDFFormat theFormat, @Nonnull Options theOptions) throws IOException Parse the RDF from theinputand return the resulting statements- Parameters:
theStream- the `InputStream` to read fromtheFormat- the format of the RDFtheOptions- the parser options- Returns:
- the parsed RDF
- Throws:
IOException- if there was an error while reading from the streamInvalidRDF- if the RDF syntax was invalid wrt to theformatIllegalArgumentException- if there is no known parser for the `RDFFormat`
-
read
Parse the RDF in the specified file and return the resulting statements.- Parameters:
thePath- the file to read from- Returns:
- the parsed statements
- Throws:
IOException- if there is an error opening or reading from the fileInvalidRDF- if the RDF syntax was invalid wrt to theformatIllegalArgumentException- if there is no known parser for the `RDFFormat` or the file uses an unknown RDF format
-
read
@Nonnull public static Set<Statement> read(@Nonnull Path thePath, @Nonnull RDFFormat theFormat) throws IOException Parse the RDF in the specified file and return the resulting statements.- Parameters:
thePath- the file to read fromtheFormat- the RDF format- Returns:
- the parsed statements
- Throws:
IOException- if there is an error opening or reading from the fileInvalidRDF- if the RDF syntax was invalid wrt to theformatIllegalArgumentException- if there is no known parser for the `RDFFormat` or the file uses an unknown RDF format
-
read
@Nonnull public static Set<Statement> read(@Nonnull Path thePath, @Nonnull RDFFormat theFormat, @Nonnull Options theOptions) throws IOException Parse the RDF in the specified file and return the resulting statements- Parameters:
thePath- the file to read fromtheFormat- the RDF formattheOptions- the parser options- Returns:
- the parsed statements
- Throws:
IOException- if there is an error opening or reading from the fileInvalidRDF- if the RDF syntax was invalid wrt to theformatIllegalArgumentException- if there is no known parser for the `RDFFormat`
-
read
public static <T> T read(@Nonnull Path thePath, @Nonnull RDFFormat theFormat, @Nonnull Options theOptions, @Nonnull CollectingRDFHandler<T> theHandler) throws IOException Parse the RDF in the specified file- Parameters:
thePath- the file whose contents should be parsetheFormat- the RDF format of the filetheOptions- the parser optionstheHandler- the handler of the parsed results- Returns:
- the result
- Throws:
IOException- if there is an error opening or reading from the fileInvalidRDF- if the RDF syntax was invalid wrt to theformatIllegalArgumentException- if there is no known parser for the `RDFFormat`
-
read
public static <T> T read(@Nonnull InputStream theStream, @Nonnull RDFFormat theFormat, @Nonnull Options theOptions, @Nonnull CollectingRDFHandler<T> theHandler) throws IOException Parse the RDF from the specified stream- Parameters:
theStream- the stream whose contents should be parsedtheFormat- the RDF format of the filetheOptions- the parser optionstheHandler- the handler of the parsed results- Returns:
- the result
- Throws:
IOException- if there is an error opening or reading from the fileInvalidRDF- if the RDF syntax was invalid wrt to theformatIllegalArgumentException- if there is no known parser for the `RDFFormat`
-
read
public static void read(@Nonnull InputStream theStream, @Nonnull RDFFormat theFormat, @Nonnull Options theOptions, @Nonnull RDFHandler theHandler) throws IOException Parse the RDF from the specified stream- Parameters:
theStream- the stream whose contents should be parsedtheFormat- the RDF format of the filetheOptions- the parser optionstheHandler- the handler of the parsed results- Throws:
IOException- if there is an error opening or reading from the fileInvalidRDF- if the RDF syntax was invalid wrt to theformatIllegalArgumentException- if there is no known parser for the `RDFFormat`
-