/** Test whether a dataset is backed by TDB. */ public static boolean isTDB1(Dataset dataset) { DatasetGraph dsg = dataset.asDatasetGraph() ; return isTDB1(dsg) ; }
protected static boolean isAccessControlledTDB(DatasetGraph dsg) { DatasetGraph dsgBase = DatasetGraphAccessControl.unwrapOrNull(dsg); if ( dsgBase == null ) return false; if ( TDBFactory.isTDB1(dsgBase) ) return true; if ( DatabaseMgr.isTDB2(dsgBase) ) return true; return false; }
/** * Create a GraphFilter for a TDB backed dataset. * * @return GraphFilter * @throws IllegalArgumentException * if not a TDB database, or a {@link DatasetGraphAccessControl} wrapped * TDB database. */ protected GraphFilter<?> predicate(DatasetGraph dsg) { dsg = DatasetGraphAccessControl.removeWrapper(dsg); // dsg has to be the database dataset, not wrapped. // DatasetGraphSwitchable is wrapped but should not be unwrapped. if ( TDBFactory.isTDB1(dsg) ) return GraphFilterTDB1.graphFilter(dsg, graphNames, matchDefaultGraph); if ( DatabaseMgr.isTDB2(dsg) ) return GraphFilterTDB2.graphFilter(dsg, graphNames, matchDefaultGraph); throw new IllegalArgumentException("Not a TDB1 or TDB2 database: "+dsg.getClass().getSimpleName()); }