@Override public Map<String, String> getNsPrefixMap() { Map<String, String> m = prefixes.readPrefixMap(graphName) ; // Force into the cache for ( Entry<String, String> e : m.entrySet() ) super.set(e.getKey(), e.getValue()) ; return m ; }
@Override public Map<String, String> getNsPrefixMap() { Map<String, String> m = prefixes.readPrefixMap(graphName) ; // Force into the cache for ( Entry<String, String> e : m.entrySet() ) super.set(e.getKey(), e.getValue()) ; return m ; }
@Override public String getNsURIPrefix( String uri ) { String x = super.getNsURIPrefix(uri) ; if ( x != null ) return x ; // Do a reverse read. x = prefixes.readByURI(graphName, uri) ; if ( x != null ) super.set(x, uri) ; return x ; }
@Override protected String get(String prefix) { String x = super.get(prefix) ; if ( x != null ) return x ; // In case it has been updated. x = prefixes.readPrefix(graphName, prefix) ; if ( x != null ) super.set(prefix, x) ; return x ; }
@Override public String getNsURIPrefix( String uri ) { String x = super.getNsURIPrefix(uri) ; if ( x != null ) return x ; // Do a reverse read. x = prefixes.readByURI(graphName, uri) ; if ( x != null ) super.set(x, uri) ; return x ; }
@Override public PrefixMapping setNsPrefix( String prefix, String uri ) { checkUnlocked(); checkLegal( prefix ); if (!prefix.equals( "" )) checkProper( uri ); if (uri == null) throw new NullPointerException( "null URIs are prohibited as arguments to setNsPrefix" ); set( prefix, uri ); return this; }
@Override protected String get(String prefix) { String x = super.get(prefix) ; if ( x != null ) return x ; // In case it has been updated. x = prefixes.readPrefix(graphName, prefix) ; if ( x != null ) super.set(prefix, x) ; return x ; }
@Override protected void set(String prefix, String uri) { // Delete old one if present and different. String x = get(prefix) ; if ( x != null ) { if(x.equals(uri)) // Already there - no-op (thanks to Eric Diaz for pointing this out) return; // Remove from cache. prefixes.removeFromPrefixMap(graphName, prefix, x) ; } // Persist prefixes.insertPrefix(graphName, prefix, uri) ; // Add to caches. super.set(prefix, uri) ; }
@Override protected void set(String prefix, String uri) { // Delete old one if present and different. String x = get(prefix) ; if ( x != null ) { if(x.equals(uri)) // Already there - no-op (thanks to Eric Diaz for pointing this out) return; // Remove from cache. prefixes.removeFromPrefixMap(graphName, prefix) ; } // Persist prefixes.insertPrefix(graphName, prefix, uri) ; // Add to caches. super.set(prefix, uri) ; }