final Multimap<String, String> frameEntries = HashMultimap.create(); final RDFSource source = RDFSources.read(false, true, null, null, inputFile.getAbsolutePath()); source.emit(new AbstractRDFHandler() {
@Override public void map(final QuadModel model) throws Exception { final List<Statement> statements = new ArrayList<>(); final RDFSource source = RDFSources.wrap(model); final RDFHandler handler = RDFHandlers.wrap(statements); processor.wrap(source).emit(handler, 1); model.addAll(statements); }
public RuleProcessor(final Ruleset ruleset, @Nullable final Mapper mapper, final boolean dropBNodeTypes, @Nullable final RDFSource staticData, final boolean emitStatic, @Nullable final URI staticContext) { // Setup the handler receiving closure of static data, if any. final List<Statement> staticClosure = new ArrayList<>(); RDFHandler staticSink = RDFHandlers.NIL; if (staticData != null && emitStatic) { staticSink = RDFHandlers.wrap(staticClosure); if (staticContext != null) { final URI uri = staticContext.equals(SESAME.NIL) ? null : staticContext; staticSink = new AbstractRDFHandlerWrapper(staticSink) { @Override public void handleStatement(final Statement stmt) throws RDFHandlerException { super.handleStatement(Statements.VALUE_FACTORY.createStatement( stmt.getSubject(), stmt.getPredicate(), stmt.getObject(), uri)); } }; } } // Build the dynamic rule engine by closing static data and proprocessing rules final RuleEngine engine = preprocess(ruleset, staticData, staticSink); // Setup object this.engine = engine; this.mapper = mapper; this.staticClosure = RDFSources.wrap(staticClosure); this.dropBNodeTypes = dropBNodeTypes; }
RDFSources.read(false, true, null, null, resourceFile).emit(new AbstractRDFHandler() {
MDC.put("context", docName); filter.filter(document); final RDFSource source = RDFSources.wrap(Runner.this.generator .generate(document, null));
final RDFSource source = RDFSources.read(false, true, null, null, input.getAbsolutePath()); source.emit(new AbstractRDFHandler() {
RDFProcessors.smush("http://dbpedia.org/resource/").wrap(RDFSources.wrap(stmts)) .emit(RDFHandlers.wrap(smushedStmts), 1);
rulesetURLs.add(IO.extractURL(location).toString()); final RDFSource rulesetSource = RDFSources.read(true, preserveBNodes, base, null, rulesetURLs.toArray(new String[0])); Ruleset ruleset = Ruleset.fromRDF(rulesetSource); new Tracker(LOGGER, null, "%d static triples read (%d tr/s avg)", // "%d static triples read (%d tr/s, %d tr/s avg)")).wrap( RDFSources.read(true, preserveBNodes, base, null, staticSpecs));
: this.statements; if (RDFGenerator.this.normalization) { statements = new ProcessorASNorm("fact:").wrap(RDFSources.wrap(statements));