/** Read RDF data. * @param sink Destination for the RDF read. * @param in Reader * @param base Base URI (defaults to uri). * @param hintLang Hint for the syntax * @param context Content object to control reading process. */ public static void parse(StreamRDF sink, Reader in, String base, Lang hintLang, Context context) { process(sink, in, base, hintLang, context) ; }
/** Read quads into a dataset with chars from a StringReader. * Use java.io.Readers is not encouraged - use with a StringReader is the primary use case. * For files, open a {@link java.io.FileInputStream} to ensure correct character set handling. * @param dataset Destination * @param in InputStream * @param base Base URI * @param lang Language syntax */ public static void read(DatasetGraph dataset, StringReader in, String base, Lang lang) { StreamRDF dest = StreamRDFLib.dataset(dataset) ; process(dest, in, base, lang, null) ; }
/** Read triples into a model with chars from a StringReader. * @param graph Destination for the RDF read. * @param in InputStream * @param base Base URI * @param lang Language syntax */ public static void read(Graph graph, StringReader in, String base, Lang lang) { StreamRDF dest = StreamRDFLib.graph(graph) ; process(dest, in, base, lang, null) ; }
/** Read RDF data. * @param sink Destination for the RDF read. * @param in Bytes to read. * @param base Base URI (defaults to uri). * @param hintLang Hint for the syntax * @param context Content object to control reading process. */ public static void parse(StreamRDF sink, InputStream in, String base, Lang hintLang, Context context) { process(sink, new TypedInputStream(in), base, hintLang, context) ; }
/** Read triples into a model with chars from an Reader. * Use of java.io.Readers is not encouraged - use with a StringReader is the primary use case. * For files, open a {@link java.io.FileInputStream} to ensure correct character set handling. * @deprecated Use an InputStream or StringReader. * @param graph Destination for the RDF read. * @param in Reader * @param base Base URI * @param lang Language syntax */ @Deprecated public static void read(Graph graph, Reader in, String base, Lang lang) { StreamRDF dest = StreamRDFLib.graph(graph) ; process(dest, in, base, lang, null) ; }
/** Read quads into a dataset with chars from an Reader. * Use java.io.Readers is not encouraged - use with a StringReader is the primary use case. * For files, open a {@link java.io.FileInputStream} to ensure correct character set handling. * @param dataset Destination * @param in InputStream * @param base Base URI * @param lang Language syntax * @deprecated use an InputStream or a StringReader. */ @Deprecated public static void read(DatasetGraph dataset, Reader in, String base, Lang lang) { StreamRDF dest = StreamRDFLib.dataset(dataset) ; process(dest, in, base, lang, null) ; }
/** Read triples into a model with chars from a StringReader. * @param model Destination for the RDF read. * @param in InputStream * @param base Base URI * @param lang Language syntax */ public static void read(Model model, StringReader in, String base, Lang lang) { Graph g = model.getGraph() ; StreamRDF dest = StreamRDFLib.graph(g) ; process(dest, in, base, lang, null) ; }
/** Read quads or triples into a dataset with bytes from an input stream. * @param dataset Destination * @param in InputStream * @param base Base URI * @param lang Language syntax */ public static void read(DatasetGraph dataset, InputStream in, String base, Lang lang) { StreamRDF dest = StreamRDFLib.dataset(dataset) ; process(dest, new TypedInputStream(in), base, lang, null) ; }
/** Read triples into a Model with bytes from an InputStream. * A base URI and a syntax can be provided. * The base URI defualts to "no base" in which case the data should have no relative URIs. * The lang gives the syntax of the stream. * @param graph Destination for the RDF read. * @param in InputStream * @param base Base URI * @param lang Language syntax */ public static void read(Graph graph, InputStream in, String base, Lang lang) { StreamRDF dest = StreamRDFLib.graph(graph) ; process(dest, new TypedInputStream(in), base, lang, null) ; }
/** Read RDF data. * @param sink Destination for the RDF read. * @param in Bytes to read. * @param base Base URI * @param context Content object to control reading process. */ public static void parse(StreamRDF sink, TypedInputStream in, String base, Context context) { Lang hintLang = RDFLanguages.contentTypeToLang(in.getMediaType()) ; process(sink, new TypedInputStream(in), base, hintLang, context) ; }
/** Read RDF data. * @param sink Destination for the RDF read. * @param uri URI to read from (includes file: and a plain file name). * @param base Base URI (defaults to uri). * @param hintLang Hint for the syntax * @param context Content object to control reading process. */ public static void parse(StreamRDF sink, String uri, String base, Lang hintLang, Context context) { if ( uri == null ) throw new IllegalArgumentException("URI to read from is null") ; if ( base == null ) base = SysRIOT.chooseBaseIRI(uri) ; if ( hintLang == null ) hintLang = RDFLanguages.filenameToLang(uri) ; TypedInputStream in = open(uri, context) ; if ( in == null ) throw new RiotException("Not found: "+uri) ; process(sink, in, base, hintLang, context) ; IO.close(in) ; }