/** * Creates new authenticator using the standard ARQ context */ public ServiceAuthenticator() { this(ARQ.getContext(), null, null); }
/** Turn on processing of blank node labels in queries */ public static void enableBlankNodeResultLabels() { enableBlankNodeResultLabels(true) ; }
/** * Globally switch the default optimizer on and off : * Note that storage subsystems may also be applying * separately controlled optimizations. */ public static void enableOptimizer(boolean state) { enableOptimizer(ARQ.getContext(), state) ; }
/** Set global strict mode */ public static void setStrictMode() { setStrictMode(ARQ.getContext()) ; }
public static void setNormalMode() { setNormalMode(ARQ.getContext()) ; }
/** Set execution logging - logging is to logger "com.hp.hpl.jena.arq.exec" at level INFO. * An appropriate logging configuration is also required. */ public static void setExecutionLogging(Explain.InfoLevel infoLevel) { if ( InfoLevel.NONE.equals(infoLevel) ) { ARQ.getContext().unset(ARQ.symLogExec) ; return ; } ARQ.getContext().set(ARQ.symLogExec, infoLevel) ; if ( ! getExecLogger().isInfoEnabled() ) getExecLogger().warn("Attempt to enable execution logging but the logger '"+logExecName+"' is not logging at level INFO") ; }
@Override public NodeValue eval(NodeValue x, NodeValue y) { if ( ARQ.isStrictMode() ) return XSDFuncOp.numDivide(x, y) ; return NodeValueOps.divisionNV(x, y) ; }
public static Object build(String assemblerFile, Resource type) { if ( assemblerFile == null ) throw new ARQException("No assembler file") ; Model spec = null ; try { spec = RDFDataMgr.loadModel(assemblerFile) ; } catch (Exception ex) { throw new ARQException("Failed reading assembler description: "+ex.getMessage()) ; } Resource root = null ; InfoLevel level = ARQ.getExecutionLogging() ; ARQ.setExecutionLogging(InfoLevel.NONE) ; try { root = GraphUtils.findRootByType(spec, type) ; if ( root == null ) return null ; } catch (TypeNotUniqueException ex) { throw new ARQException("Multiple types for: "+DatasetAssemblerVocab.tDataset) ; } finally { ARQ.setExecutionLogging(level) ; } return Assembler.general.open(root) ; }
public void buildFunction(Context cxt) { try { bindFunction(cxt) ; } catch (ExprException ex) { if ( WarnOnUnknownFunction ) ARQ.getExecLogger().warn("URI <"+functionIRI+"> has no registered function factory") ; } }
log.trace("POST "+target.toExternalForm()) ; ARQ.getHttpRequestLogger().trace(target.toExternalForm()) ; x = Convert.encWWWForm(x) ; out.write(x.getBytes()) ; ARQ.getHttpRequestLogger().trace("Param: "+x) ;
JSONOutputResultSet(IndentedWriter indentedOut) { out = indentedOut ; outputGraphBNodeLabels = ARQ.isTrue(ARQ.outputGraphBNodeLabels) ; }
/** Ensure things have started - applications do not need call this. * The method is public so any part of ARQ can call it. * Note the final static initializer call */ public static void init() { if ( initialized ) return ; synchronized(initLock) { if ( initialized ) return ; initialized = true ; globalContext = defaultSettings() ; RIOT.init() ; StageBuilder.init() ; ARQMgt.init() ; // After context and after PATH/NAME/VERSION/BUILD_DATE are set MappingRegistry.addPrefixMapping(ARQ.arqSymbolPrefix, ARQ.arqParamNS) ; // This is the pattern for any subsystem to register. SystemInfo sysInfo = new SystemInfo(ARQ.arqIRI, ARQ.PATH, ARQ.VERSION, ARQ.BUILD_DATE) ; SystemARQ.registerSubSystem(sysInfo) ; // Register RIOT details here, not earlier, to avoid // initialization loops with RIOT.init() called directly. RIOT.register() ; } }
/** Set global strict mode */ public static void setStrictMode() { setStrictMode(ARQ.getContext()) ; }
public static void setNormalMode() { setNormalMode(ARQ.getContext()) ; }
@Override public NodeValue eval(NodeValue x, NodeValue y) { if ( ARQ.isStrictMode() ) return XSDFuncOp.numAdd(x, y) ; return NodeValueOps.additionNV(x, y) ; }
public static Object build(String assemblerFile, Resource type) { if ( assemblerFile == null ) throw new ARQException("No assembler file") ; Model spec = null ; try { spec = FileManager.get().loadModel(assemblerFile) ; } catch (Exception ex) { throw new ARQException("Failed reading assembler description: "+ex.getMessage()) ; } Resource root = null ; InfoLevel level = ARQ.getExecutionLogging() ; ARQ.setExecutionLogging(InfoLevel.NONE) ; try { root = GraphUtils.findRootByType(spec, type) ; if ( root == null ) return null ; } catch (TypeNotUniqueException ex) { throw new ARQException("Multiple types for: "+DatasetAssemblerVocab.tDataset) ; } finally { ARQ.setExecutionLogging(level) ; } return Assembler.general.open(root) ; } }
public void buildFunction(Context cxt) { try { bindFunction(cxt) ; } catch (ExprException ex) { if ( WarnOnUnknownFunction ) ARQ.getExecLogger().warn("URI <"+functionIRI+"> has no registered function factory") ; } }
String qs = getQueryString() ; ARQ.getHttpRequestLogger().trace(qs) ;
JSONOutputResultSet(IndentedWriter indentedOut) { out = indentedOut ; outputGraphBNodeLabels = ARQ.isTrue(ARQ.outputGraphBNodeLabels) ; }
/** Ensure things have started - applications do not need call this. * The method is public so any part of ARQ can call it. * Note the final static initializer call */ public static synchronized void init() { if ( initialized ) return ; initialized = true ; globalContext = defaultSettings() ; StageBuilder.init() ; ARQMgt.init() ; // After context and after PATH/NAME/VERSION/BUILD_DATE are set // This is the pattern for any subsystem to register. String NS = ARQ.PATH ; SystemInfo sysInfo = new SystemInfo(ARQ.arqIRI, ARQ.VERSION, ARQ.BUILD_DATE) ; ARQMgt.register(NS+".system:type=SystemInfo", sysInfo) ; SystemARQ.registerSubSystem(sysInfo) ; SystemInfo sysInfo2 = new SystemInfo("http://openjena.org/#jena", Jena.VERSION, Jena.BUILD_DATE) ; ARQMgt.register(NS+".system:type=SystemInfo", sysInfo2) ; SystemARQ.registerSubSystem(sysInfo2) ; RIOT.init() ; }