private void reportStatement(Resource subject, IRI predicate, Value object) throws RDFHandlerException { rdfHandler.handleStatement(vf.createStatement(subject, predicate, object)); }
private void reportStatement(Resource subject, URI predicate, Value object) throws RDFHandlerException { rdfHandler.handleStatement(vf.createStatement(subject, predicate, object)); } }
protected void addTriple(Resource subject, URI predicate, Value object) { try { handler.handleStatement(valueFactory.createStatement(subject, predicate, object)); } catch(RDFHandlerException e) { // TODO: provide standard way to handle exceptions inside of triple sinks throw new RuntimeException(e); } }
private void handleValue(URI predicate, Value object) { if (object == null) return; try { Statement st; st = vf.createStatement(subject, predicate, object); rdf.handleStatement(st); } catch (RDFHandlerException e) { throw new UndeclaredThrowableException(e); } }
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); } } }
private void flushPendingStatement() throws RDFHandlerException { if (predicate != null) { Resource res = valueFactory.createBNode(); handler.handleStatement(valueFactory.createStatement(subject, predicate, res)); subject = res; } }
private void mapCounts(RDFHandler handler, ConcurrentMap<URI, ResourceCount> counts, URI predicateUri, ValueFactory vf) throws RDFHandlerException { for(URI nextURI : counts.keySet()) { handler.handleStatement(vf.createStatement(nextURI, predicateUri, vf.createLiteral(counts.get(nextURI).getCount()))); } }
public URI translateToRDF(final Atom a, final ValueFactory vf, final RDFHandler handler) throws RDFHandlerException { URI self = translateTypeAndAlias(a, vf, handler, FOAF.DOCUMENT); // note: assumes that the value ends with "(web page)" int i = a.getValue().lastIndexOf("("); String d = a.getValue().substring(0, i).trim(); handler.handleStatement(vf.createStatement(self, DCTerms.TITLE, vf.createLiteral(d))); return self; } }
ListContext startTemplateList() throws RDFHandlerException { Resource elemListBNode = valueFactory.createBNode(); handler.handleStatement( valueFactory.createStatement(subject, SP.TEMPLATES_PROPERTY, elemListBNode)); return newList(elemListBNode); }
protected void createUrlProperty(Resource resource, String rdfProperty, String value) throws RDFParseException, RDFHandlerException { if(value != null) { URI p_description = createURI(rdfProperty); URI v_description = createURI(value); rdfHandler.handleStatement(createStatement(resource,p_description,v_description)); } }
public URI translateToRDF(final Atom a, final ValueFactory vf, final RDFHandler handler) throws RDFHandlerException { URI self = translateTypeAndAlias(a, vf, handler, FOAF.PERSON); if (a.getSharability() > 0.5) { handler.handleStatement(vf.createStatement(self, FOAF.NAME, vf.createLiteral(a.getValue()))); } else { handler.handleStatement(vf.createStatement(self, RDFS.LABEL, vf.createLiteral(a.getValue()))); } return self; }
@Override public void meet(Bound node) throws RDFHandlerException { Resource currentSubj = subject; flushPendingStatement(); handler.handleStatement(valueFactory.createStatement(subject, RDF.TYPE, SP.BOUND)); predicate = SP.ARG1_PROPERTY; node.getArg().visit(this); subject = currentSubj; predicate = null; }
@Override public void meet(Str node) throws RDFHandlerException { Resource currentSubj = subject; flushPendingStatement(); handler.handleStatement(valueFactory.createStatement(subject, RDF.TYPE, SP.STR)); predicate = SP.ARG1_PROPERTY; node.getArg().visit(this); subject = currentSubj; predicate = null; }
@Override public void meet(LocalName node) throws RDFHandlerException { Resource currentSubj = subject; flushPendingStatement(); handler.handleStatement(valueFactory.createStatement(subject, RDF.TYPE, AFN.LOCALNAME)); predicate = SP.ARG1_PROPERTY; node.getArg().visit(this); subject = currentSubj; predicate = null; }
@Override public void meet(Datatype node) throws RDFHandlerException { Resource currentSubj = subject; flushPendingStatement(); handler.handleStatement(valueFactory.createStatement(subject, RDF.TYPE, SP.DATATYPE)); predicate = SP.ARG1_PROPERTY; node.getArg().visit(this); subject = currentSubj; predicate = null; }
@Override public void meet(IRIFunction node) throws RDFHandlerException { Resource currentSubj = subject; flushPendingStatement(); handler.handleStatement(valueFactory.createStatement(subject, RDF.TYPE, SP.IRI)); predicate = SP.ARG1_PROPERTY; node.getArg().visit(this); subject = currentSubj; predicate = null; }
@Override public void evaluate(RDFHandler handler) throws QueryEvaluationException, RDFHandlerException { GraphQueryResult result = evaluate(); handler.startRDF(); while (result.hasNext()) handler.handleStatement(result.next()); handler.endRDF(); } }
public void mapToRDF(Atom page, MappingContext context) throws RDFHandlerException { context.getHandler().handleStatement( context.getValueFactory().createStatement( context.getReferenceUri(), FOAF.HOMEPAGE, context.uriOf(page))); } }
@Override public void meet(DeleteData node) throws RDFHandlerException { Resource dataList = valueFactory.createBNode(); handler.handleStatement(valueFactory.createStatement(subject, SP.DATA_PROPERTY, dataList)); ListContext dataCtx = newList(dataList); renderDataBlock(node.getDataBlock()); endList(dataCtx); }
@Override public void meet(Filter node) throws RDFHandlerException { hasGroup = false; node.getArg().visit(this); if (!hasGroup) { listEntry(); handler.handleStatement(valueFactory.createStatement(subject, RDF.TYPE, SP.FILTER_CLASS)); meet(node.getCondition()); } }