The StreamRDF just passed the base() argument on to the sink so that the sink would have the base in order to set create the FQ URI from local URIs.
StreamRDFLib simply ignores the base() call. I assume this is because it is intended to process fully qualified RDF. I think the assumption is that if you are streaming into the graph you would need the base() to resolve any inbound local URIs while if you are streaming out from the graph the URIs are already fully resolved. I didn't write this code so I am not certain but if that is the case perhaps we should note it in the javadocs. I do note that StreamRDF says it is for output, in which case I am not certain why the base() is needed at all. Claude On Tue, Aug 13, 2019 at 11:46 PM Martynas Jusevičius <[email protected]> wrote: > Hi, > > I'm trying to understand what the purpose/usage of StreamRDF.base() is. > > Isn't it supposed to set the base URI that relative URIs in the stream > resolve against? > > I've made a simple test: > > StreamRDF rdfStream = StreamRDFLib.writer(new BufferedWriter(new > OutputStreamWriter(System.out))); > rdfStream.start(); > rdfStream.base("http://localhost/"); > rdfStream.triple(new Triple(NodeFactory.createBlankNode(), > NodeFactory.createURI("relative"), NodeFactory.createBlankNode())); > rdfStream.finish(); > > The output I get: > > _:Bf410fc50X2De0baX2D464eX2D996eX2Dbb3207090baa <relative> > _:B4b65b796X2D3561X2D4bf3X2Dbf31X2D1154aac0c816 . > > Why is the property URI <relative> and not <http://localhost/relative>? > Doesn't that make the output invalid N-Triples? Or am I writing it wrong? > > Martynas > atomgraph.com > -- I like: Like Like - The likeliest place on the web <http://like-like.xenei.com> LinkedIn: http://www.linkedin.com/in/claudewarren
