8687888990919293949596
static ParserProfile profile() { // TODO // Don't do anything with IRIs. Prologue prologue = new Prologue(new PrefixMap(), IRIResolver.createNoResolve()) ; ErrorHandler handler = ErrorHandlerFactory.getDefaultErrorHandler() ; ParserProfile profile = new ParserProfileBase(prologue, handler) ; profile.setLabelToNode(LabelToNode.createUseLabelAsGiven()) ; // Include safe bNode labels. return profile ;
28293031323334353637
{ static IRIFactory factory = IRIFactory.iriImplementation() ; @Test public void prefixMap1() { PrefixMap pmap = new PrefixMap() ; add(pmap, "", "http://example/") ; String x = pmap.expand("", "x") ; assertEquals("http://example/x", x) ; }
36373839404142434445
assertEquals("http://example/x", x) ; } @Test public void prefixMap2() { PrefixMap pmap = new PrefixMap() ; add(pmap, "ex", "http://example/") ; String x = pmap.expand("", "x") ; assertNull(x) ; }
4445464748495051525354
assertNull(x) ; } @Test public void prefixMap3() { PrefixMap pmap = new PrefixMap() ; add(pmap, "ex", "http://example/") ; add(pmap, "ex", "http://elsewhere/ns#") ; String x = pmap.expand("ex", "x") ; assertEquals("http://elsewhere/ns#x", x) ; }
175176177178179180181182183184185
private static void printIRI(Writer out, String iriStr, Prologue prologue) { if ( prologue != null ) { PrefixMap pmap = prologue.getPrefixMap() ; if ( pmap != null ) { String pname = prefixFor(iriStr, pmap) ; if ( pname != null ) {
404142434445464748
public NodeFormatterTTL(String baseIRI , PrefixMap prefixMap) //OutputPolicy outputPolicy) { super(false) ; if ( prefixMap == null ) prefixMap = new PrefixMap() ; this.prefixMap = prefixMap ; this.baseIRI = baseIRI ; }
static ParserProfile profile() { // TODO // Don't do anything with IRIs. Prologue prologue = new Prologue(new PrefixMap(), IRIResolver.createNoResolve()) ; ErrorHandler handler = ErrorHandlerFactory.errorHandlerStd ; ParserProfile profile = new ParserProfileBase(prologue, handler) ; profile.setLabelToNode(LabelToNode.createUseLabelAsGiven()) ; // Include safe bNode labels. return profile ;