@Override public TupleIndex open(Assembler a, Resource root, Mode mode) exactlyOneProperty(root, pDescription) ; String desc = getAsStringValue(root, pDescription).toUpperCase(Locale.ENGLISH) ; exactlyOneProperty(root, pFile) ; String filename = getAsStringValue(root, pFile) ;
/** Format:: access:entry [ :user "user2" ; :graphs (<http://host/graphname3> ) ] */ private void parseStruct(Multimap<String, Node> map, Resource root, Resource r) { if ( ! GraphUtils.exactlyOneProperty(r, VocabSecurity.pUser) ) throw new AssemblerException(root, "Expected exactly one access:user property for "+r); if ( ! GraphUtils.exactlyOneProperty(r, VocabSecurity.pGraphs) ) throw new AssemblerException(root, "Expected exactly one access:graphs property for "+r); String user = GraphUtils.getStringValue(r, VocabSecurity.pUser); r.listProperties(VocabSecurity.pGraphs).mapWith(s->s.getObject()).forEachRemaining(x->{ List<Node> graphs = new ArrayList<>(); if ( x.isURIResource() ) { //System.out.printf("S: user %s : access : %s\n", user, x.asNode()); graphs.add(x.asNode()); } else { // List? RDFList list = x.as(RDFList.class); list.iterator().forEachRemaining(rn->{ graphs.add(rn.asNode()); }); } accessEntries(root, map, user, graphs); }); }
@Override public Dataset open(Assembler a, Resource root, Mode mode) { if ( ! GraphUtils.exactlyOneProperty(root, VocabSecurity.pSecurityRegistry) ) throw new AssemblerException(root, "Expected exactly one access:registry property"); if ( ! GraphUtils.exactlyOneProperty(root, VocabSecurity.pDataset) ) throw new AssemblerException(root, "Expected exactly one access:dataset property"); RDFNode rnRegistry = root.getProperty(VocabSecurity.pSecurityRegistry).getObject(); RDFNode rnDataset = root.getProperty(VocabSecurity.pDataset).getObject(); AuthorizationService sr = (AuthorizationService)a.open(rnRegistry.asResource()) ; DatasetGraph dsgBase = ((Dataset)a.open(rnDataset.asResource())).asDatasetGraph(); DatasetGraph dsg = new DatasetGraphAccessControl(dsgBase, sr); // Add marker // ds.getContext().set(DataAccessCtl.symControlledAccess, true); // Add security registry : if this dataset is wrapped then this means the AuthorizationService is still accessible. // But adding to DatasetGraphAccessControl (currently) pushes it down to the wrapped base DSG. //dsg.getContext().set(DataAccessCtl.symAuthorizationService, sr); return DatasetFactory.wrap(dsg); }
if ( ! GraphUtils.exactlyOneProperty(root, pDirectory) ) throw new SpatialIndexException("No 'spatial:directory' property on "+root) ;
if ( ! GraphUtils.exactlyOneProperty(root, pDirectory) ) throw new SpatialIndexException("No 'spatial:directory' property on "+root) ;
if ( ! exactlyOneProperty(root, pDeltaPatchLog) ) throw new AssemblerException(root, "No patch log name") ; String dsName = getAsStringValue(root, pDeltaPatchLog); if ( ! exactlyOneProperty(root, pDeltaStorage) ) throw new AssemblerException(root, "No storge type given.") ; String storageTypeStr = getAsStringValue(root, pDeltaStorage); zoneLocation = Location.mem(); else { if ( !exactlyOneProperty(root, pDeltaZone) ) throw new AssemblerException(root, "No location for state manangement (zone)"); String zoneLocationStr = getAsStringValue(root, pDeltaZone);
static Dataset make(Resource root) { if ( !exactlyOneProperty(root, pLocation) ) throw new AssemblerException(root, "No location given") ; String dir = getStringValue(root, pLocation) ; Location loc = Location.create(dir) ; DatasetGraph dsg = TDBFactory.createDatasetGraph(loc) ; if ( root.hasProperty(pUnionDefaultGraph) ) { Node b = root.getProperty(pUnionDefaultGraph).getObject().asNode() ; NodeValue nv = NodeValue.makeNode(b) ; if ( nv.isBoolean() ) dsg.getContext().set(TDB.symUnionDefaultGraph, nv.getBoolean()) ; else Log.warn(DatasetAssemblerTDB.class, "Failed to recognize value for union graph setting (ignored): " + b) ; } /* <r> rdf:type tdb:DatasetTDB ; tdb:location "dir" ; //ja:context [ ja:cxtName "arq:queryTimeout" ; ja:cxtValue "10000" ] ; tdb:unionGraph true ; # or "true" */ AssemblerUtils.setContext(root, dsg.getContext()); return DatasetFactory.wrap(dsg) ; }
static Dataset make(Resource root) { if ( !exactlyOneProperty(root, pLocation) ) throw new AssemblerException(root, "No location given") ; String dir = getStringValue(root, pLocation) ; Location loc = Location.create(dir) ; DatasetGraph dsg = DatabaseMgr.connectDatasetGraph(loc) ; if ( root.hasProperty(pUnionDefaultGraph) ) { Node b = root.getProperty(pUnionDefaultGraph).getObject().asNode() ; NodeValue nv = NodeValue.makeNode(b) ; if ( nv.isBoolean() ) dsg.getContext().set(TDB2.symUnionDefaultGraph, nv.getBoolean()) ; else Log.warn(DatasetAssemblerTDB.class, "Failed to recognize value for union graph setting (ignored): " + b) ; } /* <r> rdf:type tdb:DatasetTDB2 ; tdb:location "dir" ; //ja:context [ ja:cxtName "arq:queryTimeout" ; ja:cxtValue "10000" ] ; tdb:unionGraph true ; # or "true" */ AssemblerUtils.setContext(root, dsg.getContext()); return DatasetFactory.wrap(dsg) ; }
public TextIndex open(Assembler a, Resource root, Mode mode) { try { if ( !GraphUtils.exactlyOneProperty(root, pDirectory) ) throw new TextIndexException("No 'text:directory' property on " + root) ;
public TextIndex open(Assembler a, Resource root, Mode mode) { try { if ( !GraphUtils.exactlyOneProperty(root, pDirectory) ) throw new TextIndexException("No 'text:directory' property on " + root) ;