/** * Create a context and initialize it with a copy of the named values of * another one. Shallow copy: the values themselves are not copied */ public Context(Context cxt) { putAll(cxt) ; }
public static void processGlobalSystemProperties() { Context context = processProperties(System.getProperties()) ; TDB.getContext().putAll(context) ; }
public static void processGlobalSystemProperties() { Context context = processProperties(System.getProperties()) ; TDB2.getContext().putAll(context) ; }
/** Merge an outer (global) and local context to produce a new context * The new context is always a separate copy. */ public static Context mergeCopy(Context contextGlobal, Context contextLocal) { if ( contextGlobal == null ) contextGlobal = ARQ.getContext(); Context context = contextGlobal.copy(); if ( contextLocal != null ) // Copy per-dataset settings. context.putAll(contextLocal); return context ; }
@Override public void processArgs(CmdArgModule cmdLine) { if ( cmdLine.getValues(setDecl) == null || cmdLine.getValues(setDecl).size() == 0 ) return; for ( String arg : cmdLine.getValues(setDecl) ) { String[] frags = arg.split("=", 2); if ( frags.length != 2 ) { throw new RuntimeException("Can't split '" + arg + "' -- looking for '=' to separate name and value"); } String symbolName = frags[0]; String value = frags[1]; // Make it a long name. symbolName = MappingRegistry.mapPrefixName(symbolName); Symbol symbol = Symbol.create(symbolName); context.set(symbol, value); } ARQ.getContext().putAll(context); }
@Override public void processArgs(CmdArgModule cmdLine) { if ( cmdLine.getValues(setDecl) == null || cmdLine.getValues(setDecl).size() == 0 ) return; for ( String arg : cmdLine.getValues(setDecl) ) { String[] frags = arg.split("=", 2); if ( frags.length != 2 ) { throw new RuntimeException("Can't split '" + arg + "' -- looking for '=' to separate name and value"); } String symbolName = frags[0]; String value = frags[1]; // Make it a long name. symbolName = MappingRegistry.mapPrefixName(symbolName); Symbol symbol = Symbol.create(symbolName); context.set(symbol, value); } ARQ.getContext().putAll(context); }
DatasetGraphTxn build(Transaction txn, ReadWrite mode) { this.txn = txn; DatasetGraphTDB dsgTDB ; switch(mode) { case READ : dsgTDB = buildReadonly() ; break ; case WRITE : dsgTDB = buildWritable() ; break ; default: dsgTDB = null ; } DatasetGraphTxn dsgTxn = new DatasetGraphTxn(dsgTDB, txn) ; // Copy context. Changes not propagated back to the base dataset. dsgTxn.getContext().putAll(dsg.getContext()) ; return dsgTxn ; }
private static Context setupContext(Context context, DatasetGraph dataset) { // To many copies? if ( context == null ) // Copy of global context to protect against change. context = ARQ.getContext() ; context = context.copy() ; if ( dataset.getContext() != null ) context.putAll(dataset.getContext()) ; context.set(ARQConstants.sysCurrentTime, NodeFactoryExtra.nowAsDateTime()) ; return context ; } }
private static UpdateProcessorStreaming makeStreaming(DatasetGraph datasetGraph, Binding inputBinding, Context context) { if ( context == null ) { context = ARQ.getContext().copy(); context.putAll(datasetGraph.getContext()) ; } UpdateEngineFactory f = UpdateEngineRegistry.get().find(datasetGraph, context) ; if ( f == null ) return null ; UpdateProcessorStreamingBase uProc = new UpdateProcessorStreamingBase(datasetGraph, inputBinding, context, f) ; return uProc; }
private static UpdateProcessor make(UpdateRequest updateRequest, DatasetGraph datasetGraph, Binding inputBinding, Context context) { if ( context == null ) { context = ARQ.getContext().copy(); context.putAll(datasetGraph.getContext()) ; } UpdateEngineFactory f = UpdateEngineRegistry.get().find(datasetGraph, context) ; if ( f == null ) return null ; UpdateProcessorBase uProc = new UpdateProcessorBase(updateRequest, datasetGraph, inputBinding, context, f) ; return uProc ; }
protected static QueryExecution make(Query query, Model model) { Dataset dataset = DatasetFactory.wrap(model); Graph g = unwrap(model.getGraph()); if ( g instanceof GraphView ) { GraphView gv = (GraphView)g; // Copy context of the storage dataset to the wrapper dataset. dataset.getContext().putAll(gv.getDataset().getContext()); } return make(query, dataset); }
private DatasetGraphTDB buildWritable() { BlockMgrBuilder blockMgrBuilder = new BlockMgrBuilderTx() ; ObjectFileBuilder objectFileBuilder = new ObjectFileBuilderTx(); DatasetBuilderStd x = new DatasetBuilderStd(blockMgrBuilder, objectFileBuilder); DatasetGraphTDB dsg2 = x._build(dsg.getLocation(), dsg.getConfig().params, true, dsg.getReorderTransform()) ; dsg2.getContext().putAll(dsg.getContext()) ; return dsg2 ; }
Context serviceContext = serviceContextMap.get(uri); if (serviceContext != null) context.putAll(serviceContext);
dsg2.getContext().putAll(dsg.getContext()) ;