@Override public PrefixMapping getPrefixMapping() { PrefixMapping x = other.getPrefixMapping() ; info("getPrefixMapping() -> "+x) ; return x ; }
@Override public PrefixMapping getPrefixMapping(String graphName) { PrefixMapping x = other.getPrefixMapping(graphName) ; info("getPrefixMapping("+graphName+") -> "+x) ; return x ; }
private PrefixMapping prefixMapping() { if ( gn == null ) return dps().getPrefixMapping(); else return dps().getPrefixMapping(gn); }
@Override protected PrefixMapping view() { return last.getPrefixMapping() ; }
@Override protected PrefixMapping view() { return last.getPrefixMapping() ; }
private PrefixMapping createPrefixMapping$() { DatasetPrefixStorage dsgPrefixes = getDatasetGraphTDB().getPrefixes() ; if ( isDefaultGraph() ) return dsgPrefixes.getPrefixMapping() ; if ( isUnionGraph() ) return dsgPrefixes.getPrefixMapping() ; return dsgPrefixes.getPrefixMapping(getGraphName().getURI()) ; }
@Override protected void exec() { Location location = getLocation() ; DatasetPrefixStorage prefixes = Build.makePrefixes(location, new DatasetControlNone()) ; for ( String gn : prefixes.graphNames() ) { System.out.println("Graph: "+gn) ; PrefixMapping pmap = prefixes.getPrefixMapping(gn) ; Map<String, String> x = pmap.getNsPrefixMap() ; for ( String k : x.keySet() ) System.out.printf(" %-10s %s\n", k+":", x.get(k)) ; } } }
@Override protected void exec() { Location location = getLocation() ; DatasetPrefixStorage prefixes = Build.makePrefixes(location, new DatasetControlNone()) ; for ( String gn : prefixes.graphNames() ) { System.out.println("Graph: "+gn) ; PrefixMapping pmap = prefixes.getPrefixMapping(gn) ; Map<String, String> x = pmap.getNsPrefixMap() ; for ( String k : x.keySet() ) System.out.printf(" %-10s %s\n", k+":", x.get(k)) ; } } }
@Override protected PrefixMapping createPrefixMapping() { final DatasetPrefixStorage prefixes = datasetGraph().prefixes(); return isDefaultGraph() || isUnionGraph() ? prefixes.getPrefixMapping() : prefixes .getPrefixMapping(getGraphName().getURI()); }
@Override protected void remove(String prefix) { dps().getPrefixMapping().removeNsPrefix(prefix); super.remove(prefix); }
@Override protected PrefixMapping createPrefixMapping() { if ( isDefaultGraph() ) return getDSG().getPrefixes().getPrefixMapping() ; if ( isUnionGraph() ) return getDSG().getPrefixes().getPrefixMapping() ; return getDSG().getPrefixes().getPrefixMapping(getGraphName().getURI()) ; }
@Test public void multiple2() { DatasetPrefixStorage prefixes = createTestingMem() ; PrefixMapping pmap1 = prefixes.getPrefixMapping("http://graph/") ; // Same PrefixMapping pmap2 = prefixes.getPrefixMapping("http://graph/") ; pmap1.setNsPrefix("x", "http://foo/") ; assertNotNull(pmap2.getNsPrefixURI("x")) ; assertNotNull(pmap1.getNsPrefixURI("x")) ; }
@Test public void multiple1() { DatasetPrefixStorage prefixes = createTestingMem() ; PrefixMapping pmap1 = prefixes.getPrefixMapping() ; PrefixMapping pmap2 = prefixes.getPrefixMapping("http://graph/") ; pmap1.setNsPrefix("x", "http://foo/") ; assertNull(pmap2.getNsPrefixURI("x")) ; assertNotNull(pmap1.getNsPrefixURI("x")) ; }
@Test public void multiple1() { DatasetPrefixStorage prefixes = createTestingMem() ; PrefixMapping pmap1 = prefixes.getPrefixMapping() ; PrefixMapping pmap2 = prefixes.getPrefixMapping("http://graph/") ; pmap1.setNsPrefix("x", "http://foo/") ; assertNull(pmap2.getNsPrefixURI("x")) ; assertNotNull(pmap1.getNsPrefixURI("x")) ; }
@Test public void multiple2() { DatasetPrefixStorage prefixes = createTestingMem() ; PrefixMapping pmap1 = prefixes.getPrefixMapping("http://graph/") ; // Same PrefixMapping pmap2 = prefixes.getPrefixMapping("http://graph/") ; pmap1.setNsPrefix("x", "http://foo/") ; assertNotNull(pmap2.getNsPrefixURI("x")) ; assertNotNull(pmap1.getNsPrefixURI("x")) ; }
@Test public void persistent1() { String dir = ConfigTest.getTestingDir() ; FileOps.clearDirectory(dir) ; DatasetPrefixStorage prefixes = createTesting(Location.create(dir)) ; PrefixMapping pmap1 = prefixes.getPrefixMapping() ; String x = pmap1.getNsPrefixURI("x") ; assertNull(x) ; prefixes.close() ; }
@Test public void persistent1() { String dir = ConfigTest.getTestingDir() ; FileOps.clearDirectory(dir) ; DatasetPrefixStorage prefixes = createTesting(Location.create(dir)) ; PrefixMapping pmap1 = prefixes.getPrefixMapping() ; String x = pmap1.getNsPrefixURI("x") ; assertNull(x) ; prefixes.close() ; }
@Test public void persistent2() { String dir = ConfigTest.getTestingDir() ; FileOps.clearDirectory(dir) ; DatasetPrefixStorage prefixes = createTesting(Location.create(dir)) ; PrefixMapping pmap1 = prefixes.getPrefixMapping() ; pmap1.setNsPrefix("x", "http://foo/") ; assertEquals("http://foo/", pmap1.getNsPrefixURI("x")) ; prefixes.close() ; }
@Test public void persistent2() { String dir = ConfigTest.getTestingDir() ; FileOps.clearDirectory(dir) ; DatasetPrefixStorage prefixes = createTesting(Location.create(dir)) ; PrefixMapping pmap1 = prefixes.getPrefixMapping() ; pmap1.setNsPrefix("x", "http://foo/") ; assertEquals("http://foo/", pmap1.getNsPrefixURI("x")) ; prefixes.close() ; }