Refine search
private void reportStatement(Resource subject, IRI predicate, Value object) throws RDFHandlerException { rdfHandler.handleStatement(vf.createStatement(subject, predicate, object)); }
/** * Writes the given single statement to the given {@link RDFHandler}. * <p> * * @param statement * A statement, to be written. * @throws RDFHandlerException * Thrown if there is an error writing the statement. */ public static void write(Statement statement, RDFHandler writer) throws RDFHandlerException { writer.startRDF(); writer.handleStatement(statement); writer.endRDF(); }
public void handleNamespace(String prefix, String uri) throws RDFHandlerException { for (RDFHandler rdfHandler : rdfHandlers) { rdfHandler.handleNamespace(prefix, uri); } }
public void render(ParsedGraphQuery query, RDFHandler handler) throws RDFHandlerException { handler.startRDF(); Resource querySubj = valueFactory.createBNode(); handler.handleStatement(valueFactory.createStatement(querySubj, RDF.TYPE, SP.CONSTRUCT_CLASS)); if (output.text) { handler.handleStatement(valueFactory.createStatement(querySubj, SP.TEXT_PROPERTY, valueFactory.createLiteral(query.getSourceString()))); } if (output.rdf) { TupleExpr expr = query.getTupleExpr(); SpinVisitor visitor = new ConstructVisitor(handler, querySubj, query.getDataset()); expr.visit(visitor); visitor.end(); } handler.endRDF(); }
private void flushPendingStatement() throws RDFHandlerException { if (predicate != null) { Resource res = valueFactory.createBNode(); handler.handleStatement(valueFactory.createStatement(subject, predicate, res)); subject = res; } }
/** * Writes the given statements to the given {@link RDFHandler}. * <p> * If the collection is a {@link Model}, its namespaces will also be written. * * @param model * A collection of statements, such as a {@link Model}, to be written. * @throws RDFHandlerException * Thrown if there is an error writing the statements. */ public static void write(Iterable<Statement> model, RDFHandler writer) throws RDFHandlerException { writer.startRDF(); if (model instanceof NamespaceAware) { for (Namespace nextNamespace : ((NamespaceAware)model).getNamespaces()) { writer.handleNamespace(nextNamespace.getPrefix(), nextNamespace.getName()); } } for (final Statement st : model) { writer.handleStatement(st); } writer.endRDF(); }
public void endRDF() throws RDFHandlerException { for (RDFHandler rdfHandler : rdfHandlers) { rdfHandler.endRDF(); } }
void startDocument() throws RDFParseException, RDFHandlerException { if (rdfHandler != null) { rdfHandler.startRDF(); } }
public void handleStatement(Statement st) throws RDFHandlerException { for (RDFHandler rdfHandler : rdfHandlers) { rdfHandler.handleStatement(st); } }
public void handleComment(String comment) throws RDFHandlerException { for (RDFHandler rdfHandler : rdfHandlers) { rdfHandler.handleComment(comment); } } }
private void visitWhere(TupleExpr where) throws RDFHandlerException { Resource whereBNode = valueFactory.createBNode(); handler.handleStatement(valueFactory.createStatement(subject, SP.WHERE_PROPERTY, whereBNode)); isSubQuery = true; // further projection elements are for // sub-queries ListContext ctx = newList(whereBNode); where.visit(this); endList(ctx); }
/** * Writes the given statements to the given {@link RDFHandler}. * <p> * If the collection is a {@link Model}, its namespaces will also be written. * * @param model * A collection of statements, such as a {@link Model}, to be written. * @throws RDFHandlerException * Thrown if there is an error writing the statements. */ public static void write(Iterable<Statement> model, RDFHandler writer) throws RDFHandlerException { writer.startRDF(); if (model instanceof NamespaceAware) { for (Namespace nextNamespace : ((NamespaceAware)model).getNamespaces()) { writer.handleNamespace(nextNamespace.getPrefix(), nextNamespace.getName()); } } for (final Statement st : model) { writer.handleStatement(st); } writer.endRDF(); }
public void endRDF() throws RDFHandlerException { for (RDFHandler rdfHandler : rdfHandlers) { rdfHandler.endRDF(); } }
@Override public void startRDF() throws RDFHandlerException { for (RDFHandler rdfHandler : rdfHandlers) { rdfHandler.startRDF(); } }
protected void reportStatement(Resource subj, IRI pred, Value obj) throws RDFParseException, RDFHandlerException { if (subj != null && pred != null && obj != null) { Statement st = createStatement(subj, pred, obj); if (rdfHandler != null) { rdfHandler.handleStatement(st); } } }
public void handleComment(String comment) throws RDFHandlerException { for (RDFHandler rdfHandler : rdfHandlers) { rdfHandler.handleComment(comment); } } }
private void reportStatement(Resource subject, IRI predicate, Value object) throws RDFHandlerException { rdfHandler.handleStatement(vf.createStatement(subject, predicate, object)); }
@Override public void meet(ProjectionElemList node) throws RDFHandlerException { Resource elemListBNode = valueFactory.createBNode(); handler.handleStatement( valueFactory.createStatement(subject, SP.RESULT_VARIABLES_PROPERTY, elemListBNode)); ListContext ctx = newList(elemListBNode); super.meet(node); endList(ctx); }
/** * Writes the given statements to the given {@link RDFHandler}. * <p> * If the collection is a {@link Model}, its namespaces will also be written. * * @param model * A collection of statements, such as a {@link Model}, to be written. * @throws RDFHandlerException * Thrown if there is an error writing the statements. */ public static void write(Iterable<Statement> model, RDFHandler writer) throws RDFHandlerException { writer.startRDF(); if (model instanceof NamespaceAware) { for (Namespace nextNamespace : ((NamespaceAware)model).getNamespaces()) { writer.handleNamespace(nextNamespace.getPrefix(), nextNamespace.getName()); } } for (final Statement st : model) { writer.handleStatement(st); } writer.endRDF(); }
/** * Writes the given single statement to the given {@link RDFHandler}. * <p> * * @param statement * A statement, to be written. * @throws RDFHandlerException * Thrown if there is an error writing the statement. */ public static void write(Statement statement, RDFHandler writer) throws RDFHandlerException { writer.startRDF(); writer.handleStatement(statement); writer.endRDF(); }