public String getBaseIRI() { return prologue.getBaseURI() ; }
private void dump() { Iterator<Prologue> iter = state.iterator() ; for ( ; iter.hasNext() ; ) { Prologue p = iter.next() ; System.out.println(" Prologue: "+p.getBaseURI()) ; } }
public static int hash(Prologue prologue) { final int prime = 31 ; int x = 1 ; if ( prologue.seenBaseURI ) x = prime * x + prologue.getBaseURI().hashCode() ; else x = 1237 ; if ( prologue.prefixMap != null ) x = prime * x + prologue.prefixMap.getNsPrefixMap().hashCode() ; return x ; } }
private static void printBase(Prologue prologue, IndentedWriter out) { if ( prologue.getBaseURI() != null && prologue.explicitlySetBaseURI() ) { out.print("BASE ") ; out.print("<"+prologue.getBaseURI()+">") ; out.newline() ; } }
public void usePrologueFrom(Prologue other) { prefixMap = new PrefixMapping2(other.prefixMap) ; seenBaseURI = false ; if ( other.resolver != null ) resolver = IRIResolver.create(getBaseURI()) ; }
static public String stringForURI(String uri, Prologue prologue) { return stringForURI(uri, prologue.getBaseURI(), prologue.getPrefixMapping()) ; }
/** Test whether a Prologue will perform the same as this one. */ public boolean samePrologue(Prologue other) { // Prologue are mutable and superclasses so .equals is left as the default. String base1 = explicitlySetBaseURI() ? getBaseURI() : null ; String base2 = other.explicitlySetBaseURI() ? other.getBaseURI() : null ; if (! Objects.equals(base1, base2) ) return false ; if ( getPrefixMapping() == null && other.getPrefixMapping() == null ) return true ; if ( getPrefixMapping() == null ) return false ; return getPrefixMapping().samePrefixMappingAs(other.getPrefixMapping()) ; }
private static boolean printBase(IndentedWriter iWriter, Prologue prologue) { String baseURI = prologue.getBaseURI() ; if ( baseURI != null ) { WriterLib.start(iWriter, Tags.tagBase, NoNL) ; iWriter.print(FmtUtils.stringForURI(baseURI)) ; iWriter.println(); return true ; } return false ; }
@Override public Query get() { Query result = new Query(); if(prologue != null) { result.setBaseURI(prologue.getBaseURI()); // PrefixMappingImpl tmp = new PrefixMappingImpl(); // // Note: Query parsing may modify the prefixes, hence create a copy of the prefix mappings // tmp.setNsPrefixes(prologue.getPrefixMapping()); result.getPrefixMapping().setNsPrefixes(prologue.getPrefixMapping()); } return result; }
String uri = prefixMapping.getNsPrefixURI(prefix) ; uri = FmtUtils.stringForURI(uri, prologue.getBaseURI()) ; WriterLib.start(iWriter) ; iWriter.print(prefix) ;
} else { writer.writeTurtle( q.getPrologue().getBaseURI(), q.getPrologue().getPrefixMapping(), writeBase);