Package com.semedy.reasoner.api.edb
Class LoaderProvider
java.lang.Object
com.semedy.reasoner.api.edb.LoaderProvider
Handles loading facts from different sources like json, csv, nquads.
Handles also zipped versions of files
Handles also zipped versions of files
- Author:
- angele
-
Constructor Summary
ConstructorsConstructorDescriptionLoaderProvider(ExtensionalDB edb, InvertedIndices invertedIndices, String tempDir, Configuration config) -
Method Summary
Modifier and TypeMethodDescriptioniterator()returns an iterator for all loadersvoidload(Collection<String> paths, SymbolTable symbols, ExternalDataTypeProvider dataTypes) load facts from filesvoidloadByStream(InputStream stream, InputStream companionstream, String format, SymbolTable symbols, ExternalDataTypeProvider dataTypes) load facts by stream. format is either the file format like json,nq etc.voidregisterLoader(Loader loader) register a new loadervoidremoveLoader(String format) Remove importer by its formatMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
LoaderProvider
public LoaderProvider(ExtensionalDB edb, InvertedIndices invertedIndices, String tempDir, Configuration config)
-
-
Method Details
-
registerLoader
register a new loader- Parameters:
loader-
-
load
public void load(Collection<String> paths, SymbolTable symbols, ExternalDataTypeProvider dataTypes) throws IOException, InterruptedException, SemReasonerException load facts from files -
loadByStream
public void loadByStream(InputStream stream, InputStream companionstream, String format, SymbolTable symbols, ExternalDataTypeProvider dataTypes) throws UnsupportedEncodingException, IOException, SemReasonerException, InterruptedException load facts by stream. format is either the file format like json,nq etc. In case of raw it is the predicate like value|3- Parameters:
stream-companionstream-format-- Throws:
UnsupportedEncodingExceptionIOExceptionSemReasonerExceptionInterruptedException
-
removeLoader
Remove importer by its format- Parameters:
format-
-
iterator
returns an iterator for all loaders
-