if ( datasetDesc == null ) return null ; if ( datasetDesc.isEmpty() ) return null ;
/** * Given a DatasetDescription, form a Dataset that is the dynamic dataset over the * base dataset. Returns the original DatasetGraph if the dataset description is null * or empty. */ public static DatasetGraph dynamicDataset(DatasetDescription description, DatasetGraph dsg, boolean defaultUnionGraph) { if ( description == null ) return dsg ; //An empty description means leave the dataset as-is if (description.isEmpty() ) return dsg; Set<Node> defaultGraphs = convertToSetNodes(description.getDefaultGraphURIs()) ; Set<Node> namedGraphs = convertToSetNodes(description.getNamedGraphURIs()) ; return dynamicDataset(defaultGraphs, namedGraphs, dsg, defaultUnionGraph) ; }
if ( datasetDesc == null ) return null ; if ( datasetDesc.isEmpty() ) return null ;
private DatasetGraph dynamicDataset(HttpAction action, Query query, DatasetGraph dsg0, DatasetDescription dsDesc0, SecurityContext sCxt) { if ( dsDesc0 == null ) return dsg0; if ( ! ALLOW_FROM ) ServletOps.errorBadRequest("Use GRAPH. (FROM/FROM NAMED is not compatible with data access control.)"); DatasetDescription dsDesc1 = DatasetDescription.create( mask(dsDesc0.getDefaultGraphURIs(), sCxt), mask(dsDesc0.getNamedGraphURIs(), sCxt)); if ( dsDesc1.isEmpty() ) return DatasetGraphZero.create(); // Fix up the union graph in the graphs if in FROM. // (FROM NAMED <union graph> is done by DynamicDatasets). if ( dsDesc1.getDefaultGraphURIs().contains(Quad.unionGraph.getURI())) { dsDesc1.getDefaultGraphURIs().remove(Quad.unionGraph.getURI()); dsDesc1.getDefaultGraphURIs().addAll(sCxt.visibleGraphNames()); } DatasetGraph dsg1 = DynamicDatasets.dynamicDataset(dsDesc1, dsg0, false) ; if ( query.hasDatasetDescription() ) { query.getGraphURIs().clear() ; query.getNamedGraphURIs().clear() ; } return dsg1 ; }