As far as I am aware blank nodes are called blank for a reason. If you want a 
named resource, why not just create one? 

Sent from my iPhone

> On 25 Apr 2015, at 5:00 am, souri datta <[email protected]> wrote:
> 
> Hi,
> When  I am parsing an N-quad using Jena, is it possible to keep the blank
> node id same after parsing?
> 
> For e.g., if I have a blank n-quad like
> 
> _:bsomerandomid   <ns:pred>    <http://foo.com>  <foo> .
> 
> After parsing, when I do
> 
> subject.getBlankNodeId() it runs a randomly generated string which is
> different from "_:bsomerandomid" .
> 
> Is it possible to set some flags so that I get blank the same id as present
> in the input quad?
> 
> 
> Thanks,
> Souri
> 
> 
> 
> *Code used:*
> *private ParserProfileBase profile = new ParserProfileBase(new
> Prologue(null,*
> *            IRIResolver.createNoResolve()),*
> *            ErrorHandlerFactory.errorHandlerStrictSilent(),*
> *            LabelToNode.createUseLabelEncoded());*
> *    profile.setStrictMode(true);*
> *}*
> *List<Quad> output = new ArrayList<>();*
> *Tokenizer tokenizer = TokenizerFactory.makeTokenizerString(line);*
> *LangNQuads parser = new LangNQuads(tokenizer, profile, null);*
> * while (parser.hasNext()) {*
> *        output.add(parser.next());*
> * }*
> * output.get(0).getSubject().getBlankNodeId();*

Reply via email to