Class RDFDataMgrRx

java.lang.Object
org.aksw.jenax.sparql.query.rx.RDFDataMgrRx

public class RDFDataMgrRx extends Object
Reactive extensions of RDFDataMgr
Author:
Claus Stadler, Nov 12, 2018
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.jena.riot.RDFParserBuilder
    applyParserDefaults(org.apache.jena.riot.RDFParserBuilder builder)
     
    static <C extends Collection<? extends org.apache.jena.query.Dataset>>
    io.reactivex.rxjava3.core.FlowableTransformer<C,Throwable>
    createBatchWriterDataset(OutputStream out, org.apache.jena.riot.RDFFormat format)
     
    static <C extends Collection<org.apache.jena.sparql.core.Quad>>
    io.reactivex.rxjava3.core.FlowableTransformer<C,Throwable>
    createBatchWriterQuads(OutputStream out, org.apache.jena.riot.RDFFormat format)
     
    static <C extends Collection<org.apache.jena.sparql.core.Quad>>
    io.reactivex.rxjava3.core.FlowableTransformer<C,Throwable>
    createBatchWriterQuads2(OutputStream out, org.apache.jena.riot.RDFFormat format)
     
    static io.reactivex.rxjava3.core.Flowable<org.apache.jena.sparql.engine.binding.Binding>
    createFlowableBindings(String filenameOrURI, org.apache.jena.riot.Lang lang)
    Create a Flowable for a SPARQL result set backed by a file
    static io.reactivex.rxjava3.core.Flowable<org.apache.jena.sparql.engine.binding.Binding>
    createFlowableBindings(Callable<InputStream> inSupp, org.apache.jena.riot.Lang lang)
    Create a Flowable for a SPARQL result set backed by an supplier of input streams
    static io.reactivex.rxjava3.core.Flowable<org.apache.jena.sparql.engine.binding.Binding>
    createFlowableBindings(Callable<org.apache.jena.atlas.web.TypedInputStream> inSupp)
    Create a Flowable for a SPARQL result set backed by a supplier of TypedInputStream
    static io.reactivex.rxjava3.core.Flowable<org.apache.jena.query.Dataset>
    createFlowableDatasets(String filenameOrURI, org.apache.jena.riot.Lang lang, String baseIRI)
     
    static io.reactivex.rxjava3.core.Flowable<org.apache.jena.query.Dataset>
    createFlowableDatasets(Callable<InputStream> inSupplier, org.apache.jena.riot.Lang lang, String baseIRI)
    Groups consecutive quads with the same graph yeld by createFlowableQuads into datasets
    static io.reactivex.rxjava3.core.Flowable<org.apache.jena.query.Dataset>
    createFlowableDatasets(Callable<org.apache.jena.atlas.web.TypedInputStream> inSupplier)
     
    static io.reactivex.rxjava3.core.Flowable<org.apache.jena.sparql.core.Quad>
    createFlowableQuads(String filenameOrURI, org.apache.jena.riot.Lang lang, String baseIRI)
     
    static io.reactivex.rxjava3.core.Flowable<org.apache.jena.sparql.core.Quad>
    createFlowableQuads(Path path, Iterable<org.apache.jena.riot.Lang> probeLangs)
     
    static io.reactivex.rxjava3.core.Flowable<org.apache.jena.sparql.core.Quad>
    createFlowableQuads(Callable<InputStream> inSupplier, org.apache.jena.riot.Lang lang, String baseIRI)
     
    static io.reactivex.rxjava3.core.Flowable<org.apache.jena.sparql.core.Quad>
    createFlowableQuads(Callable<org.apache.jena.atlas.web.TypedInputStream> inSupplier)
     
    static io.reactivex.rxjava3.core.Flowable<org.apache.jena.rdf.model.Resource>
    createFlowableResources(String filenameOrURI, org.apache.jena.riot.Lang lang, String baseIRI)
     
    static io.reactivex.rxjava3.core.Flowable<org.apache.jena.rdf.model.Resource>
    createFlowableResources(Callable<InputStream> inSupplier, org.apache.jena.riot.Lang lang, String baseIRI)
    Creates resources by grouping consecutive quads with the same graph into a Model, and then returning a resource for that graph IRI.
    static io.reactivex.rxjava3.core.Flowable<org.apache.jena.graph.Triple>
    createFlowableTriples(String filenameOrURI, org.apache.jena.riot.Lang lang, String baseIRI)
     
    static io.reactivex.rxjava3.core.Flowable<org.apache.jena.sparql.core.Quad>
    createFlowableTriples(Path path, Iterable<org.apache.jena.riot.Lang> probeLangs)
     
    static io.reactivex.rxjava3.core.Flowable<org.apache.jena.graph.Triple>
    createFlowableTriples(Callable<InputStream> inSupplier, org.apache.jena.riot.Lang lang, String baseIRI)
     
    static io.reactivex.rxjava3.core.Flowable<org.apache.jena.graph.Triple>
    createFlowableTriples(Callable<org.apache.jena.atlas.web.TypedInputStream> inSupplier)
     
    static org.apache.jena.riot.lang.LabelToNode
    Label to node strategy that passes existing labels on as given but allocation of fresh nodes uses a pair comprising a jvm-global random value and an increment.
    static org.apache.jena.riot.system.ParserProfile
    createParserProfile(org.apache.jena.riot.system.FactoryRDF factory, org.apache.jena.riot.system.ErrorHandler errorHandler, boolean checking)
     
    static io.reactivex.rxjava3.core.FlowableTransformer<? super org.apache.jena.query.Dataset,Throwable>
    createWriterDataset(OutputStream out, org.apache.jena.riot.RDFFormat format)
     
    static org.apache.jena.riot.system.ErrorHandler
     
    static org.apache.jena.riot.system.ParserProfile
     
    static void
    parseFromInputStream(org.apache.jena.riot.system.StreamRDF destination, InputStream in, String baseUri, org.apache.jena.riot.Lang lang, org.apache.jena.sparql.util.Context context)
    Adaption from RDFDataMgr.createIteratorQuads that waits for data on the input stream indefinitely and allows for thread handling Creates an iterator over parsing of quads
    static org.apache.jena.riot.system.ParserProfile
     
    static org.apache.jena.riot.system.ParserProfile
     
    static void
    writeDatasets(io.reactivex.rxjava3.core.Flowable<org.apache.jena.query.Dataset> flowable, OutputStream out, org.apache.jena.riot.RDFFormat format)
    Does not close the output stream Note that you can use .createDatasetBatchWriter() ....blockingForEach(createDatasetBatchWriter()) This does not break the chain and gives freedom over the choice of forEach type (non-/blocking)
    static void
    writeDatasets(io.reactivex.rxjava3.core.Flowable<org.apache.jena.query.Dataset> flowable, Path file, org.apache.jena.riot.RDFFormat format)
     
    static void
    writeQuads(io.reactivex.rxjava3.core.Flowable<org.apache.jena.sparql.core.Quad> flowable, OutputStream out, org.apache.jena.riot.RDFFormat format)
     
    static void
    writeResources(io.reactivex.rxjava3.core.Flowable<? extends org.apache.jena.rdf.model.Resource> flowable, OutputStream out, org.apache.jena.riot.RDFFormat format)
     
    static void
    writeResources(io.reactivex.rxjava3.core.Flowable<? extends org.apache.jena.rdf.model.Resource> flowable, Path file, org.apache.jena.riot.RDFFormat format)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RDFDataMgrRx

      public RDFDataMgrRx()
  • Method Details

    • createFlowableTriples

      public static io.reactivex.rxjava3.core.Flowable<org.apache.jena.graph.Triple> createFlowableTriples(String filenameOrURI, org.apache.jena.riot.Lang lang, String baseIRI)
    • createFlowableBindings

      public static io.reactivex.rxjava3.core.Flowable<org.apache.jena.sparql.engine.binding.Binding> createFlowableBindings(String filenameOrURI, org.apache.jena.riot.Lang lang)
      Create a Flowable for a SPARQL result set backed by a file
      Parameters:
      filenameOrURI -
      lang -
      Returns:
    • createFlowableBindings

      public static io.reactivex.rxjava3.core.Flowable<org.apache.jena.sparql.engine.binding.Binding> createFlowableBindings(Callable<InputStream> inSupp, org.apache.jena.riot.Lang lang)
      Create a Flowable for a SPARQL result set backed by an supplier of input streams
      Parameters:
      filenameOrURI -
      lang -
      Returns:
    • createFlowableBindings

      public static io.reactivex.rxjava3.core.Flowable<org.apache.jena.sparql.engine.binding.Binding> createFlowableBindings(Callable<org.apache.jena.atlas.web.TypedInputStream> inSupp)
      Create a Flowable for a SPARQL result set backed by a supplier of TypedInputStream
      Parameters:
      filenameOrURI -
      lang -
      Returns:
    • createFlowableTriples

      public static io.reactivex.rxjava3.core.Flowable<org.apache.jena.graph.Triple> createFlowableTriples(Callable<InputStream> inSupplier, org.apache.jena.riot.Lang lang, String baseIRI)
    • createFlowableResources

      public static io.reactivex.rxjava3.core.Flowable<org.apache.jena.rdf.model.Resource> createFlowableResources(String filenameOrURI, org.apache.jena.riot.Lang lang, String baseIRI)
    • createFlowableDatasets

      public static io.reactivex.rxjava3.core.Flowable<org.apache.jena.query.Dataset> createFlowableDatasets(String filenameOrURI, org.apache.jena.riot.Lang lang, String baseIRI)
    • createLabelToNodeAsGivenOrRandom

      public static org.apache.jena.riot.lang.LabelToNode createLabelToNodeAsGivenOrRandom()
      Label to node strategy that passes existing labels on as given but allocation of fresh nodes uses a pair comprising a jvm-global random value and an increment. (i.e. incremental numbers scoped within some random value) This strategy is needed when processing RDF files in splits such as with Apache Spark: Any mentioned labels should be retaine globally, but fresh nodes allocated for the splits must not clash.
      Returns:
    • dftErrorHandler

      public static org.apache.jena.riot.system.ErrorHandler dftErrorHandler()
    • dftProfile

      public static org.apache.jena.riot.system.ParserProfile dftProfile()
    • applyParserDefaults

      public static org.apache.jena.riot.RDFParserBuilder applyParserDefaults(org.apache.jena.riot.RDFParserBuilder builder)
    • createParserProfile

      public static org.apache.jena.riot.system.ParserProfile createParserProfile(org.apache.jena.riot.system.FactoryRDF factory, org.apache.jena.riot.system.ErrorHandler errorHandler, boolean checking)
    • strictProfile

      public static org.apache.jena.riot.system.ParserProfile strictProfile()
    • permissiveProfile

      public static org.apache.jena.riot.system.ParserProfile permissiveProfile()
    • parseFromInputStream

      public static void parseFromInputStream(org.apache.jena.riot.system.StreamRDF destination, InputStream in, String baseUri, org.apache.jena.riot.Lang lang, org.apache.jena.sparql.util.Context context)
      Adaption from RDFDataMgr.createIteratorQuads that waits for data on the input stream indefinitely and allows for thread handling Creates an iterator over parsing of quads
      Parameters:
      input - Input Stream
      lang - Language
      baseIRI - Base IRI
    • createFlowableQuads

      public static io.reactivex.rxjava3.core.Flowable<org.apache.jena.sparql.core.Quad> createFlowableQuads(String filenameOrURI, org.apache.jena.riot.Lang lang, String baseIRI)
    • createFlowableQuads

      public static io.reactivex.rxjava3.core.Flowable<org.apache.jena.sparql.core.Quad> createFlowableQuads(Callable<InputStream> inSupplier, org.apache.jena.riot.Lang lang, String baseIRI)
    • createFlowableResources

      public static io.reactivex.rxjava3.core.Flowable<org.apache.jena.rdf.model.Resource> createFlowableResources(Callable<InputStream> inSupplier, org.apache.jena.riot.Lang lang, String baseIRI)
      Creates resources by grouping consecutive quads with the same graph into a Model, and then returning a resource for that graph IRI. GRAPH :s { :s :p :o . :o :x :y }
      Parameters:
      inSupplier -
      lang -
      baseIRI -
      Returns:
    • createFlowableDatasets

      public static io.reactivex.rxjava3.core.Flowable<org.apache.jena.query.Dataset> createFlowableDatasets(Callable<InputStream> inSupplier, org.apache.jena.riot.Lang lang, String baseIRI)
      Groups consecutive quads with the same graph yeld by createFlowableQuads into datasets
      Parameters:
      inSupplier -
      lang -
      baseIRI -
      Returns:
    • createFlowableDatasets

      public static io.reactivex.rxjava3.core.Flowable<org.apache.jena.query.Dataset> createFlowableDatasets(Callable<org.apache.jena.atlas.web.TypedInputStream> inSupplier)
    • createFlowableQuads

      public static io.reactivex.rxjava3.core.Flowable<org.apache.jena.sparql.core.Quad> createFlowableQuads(Path path, Iterable<org.apache.jena.riot.Lang> probeLangs)
    • createFlowableQuads

      public static io.reactivex.rxjava3.core.Flowable<org.apache.jena.sparql.core.Quad> createFlowableQuads(Callable<org.apache.jena.atlas.web.TypedInputStream> inSupplier)
    • createFlowableTriples

      public static io.reactivex.rxjava3.core.Flowable<org.apache.jena.sparql.core.Quad> createFlowableTriples(Path path, Iterable<org.apache.jena.riot.Lang> probeLangs)
    • createFlowableTriples

      public static io.reactivex.rxjava3.core.Flowable<org.apache.jena.graph.Triple> createFlowableTriples(Callable<org.apache.jena.atlas.web.TypedInputStream> inSupplier)
    • writeResources

      public static void writeResources(io.reactivex.rxjava3.core.Flowable<? extends org.apache.jena.rdf.model.Resource> flowable, Path file, org.apache.jena.riot.RDFFormat format) throws Exception
      Throws:
      Exception
    • writeResources

      public static void writeResources(io.reactivex.rxjava3.core.Flowable<? extends org.apache.jena.rdf.model.Resource> flowable, OutputStream out, org.apache.jena.riot.RDFFormat format) throws Exception
      Throws:
      Exception
    • writeDatasets

      public static void writeDatasets(io.reactivex.rxjava3.core.Flowable<org.apache.jena.query.Dataset> flowable, Path file, org.apache.jena.riot.RDFFormat format) throws Exception
      Throws:
      Exception
    • createWriterDataset

      public static io.reactivex.rxjava3.core.FlowableTransformer<? super org.apache.jena.query.Dataset,Throwable> createWriterDataset(OutputStream out, org.apache.jena.riot.RDFFormat format)
    • createBatchWriterDataset

      public static <C extends Collection<? extends org.apache.jena.query.Dataset>> io.reactivex.rxjava3.core.FlowableTransformer<C,Throwable> createBatchWriterDataset(OutputStream out, org.apache.jena.riot.RDFFormat format)
    • createBatchWriterQuads

      public static <C extends Collection<org.apache.jena.sparql.core.Quad>> io.reactivex.rxjava3.core.FlowableTransformer<C,Throwable> createBatchWriterQuads(OutputStream out, org.apache.jena.riot.RDFFormat format)
      Type Parameters:
      C -
      Parameters:
      out -
      format - Only NQuads is currently supported
      Returns:
    • createBatchWriterQuads2

      public static <C extends Collection<org.apache.jena.sparql.core.Quad>> io.reactivex.rxjava3.core.FlowableTransformer<C,Throwable> createBatchWriterQuads2(OutputStream out, org.apache.jena.riot.RDFFormat format)
    • writeQuads

      public static void writeQuads(io.reactivex.rxjava3.core.Flowable<org.apache.jena.sparql.core.Quad> flowable, OutputStream out, org.apache.jena.riot.RDFFormat format) throws IOException
      Throws:
      IOException
    • writeDatasets

      public static void writeDatasets(io.reactivex.rxjava3.core.Flowable<org.apache.jena.query.Dataset> flowable, OutputStream out, org.apache.jena.riot.RDFFormat format) throws IOException
      Does not close the output stream Note that you can use .createDatasetBatchWriter() ....blockingForEach(createDatasetBatchWriter()) This does not break the chain and gives freedom over the choice of forEach type (non-/blocking)
      Throws:
      IOException