Search in sources :

Example 6 with SystemInfo

use of org.apache.jena.sparql.mgt.SystemInfo in project jena by apache.

the class TDB method initialization2.

private static void initialization2() {
    // Set management information.
    SystemInfo systemInfo = new SystemInfo(TDB.tdbIRI, TDB.PATH, TDB.VERSION, TDB.BUILD_DATE);
    SystemARQ.registerSubSystem(systemInfo);
}
Also used : SystemInfo(org.apache.jena.sparql.mgt.SystemInfo)

Example 7 with SystemInfo

use of org.apache.jena.sparql.mgt.SystemInfo in project jena by apache.

the class TDBMgt method init.

public static void init() {
    String NS = TDB.PATH;
    SystemInfo sysInfo = new SystemInfo(TDB.tdbIRI, TDB.PATH, TDB.VERSION, TDB.BUILD_DATE);
//        ARQMgt.register(NS+".system:type=SystemInfo", sysInfo) ;
//        ARQMgt.register(NS+".system2:type=SystemInfo", new TDBSystemInfo()) ; 
}
Also used : SystemInfo(org.apache.jena.sparql.mgt.SystemInfo)

Example 8 with SystemInfo

use of org.apache.jena.sparql.mgt.SystemInfo in project jena by apache.

the class version method execEvaluated.

@Override
public QueryIterator execEvaluated(Binding binding, PropFuncArg subject, Node predicate, PropFuncArg object, ExecutionContext execCxt) {
    List<Binding> results = new ArrayList<>();
    Node subj = subject.getArg();
    Node obj = object.getArg();
    Iterator<SystemInfo> iter = SystemARQ.registeredSubsystems();
    for (; iter.hasNext(); ) {
        SystemInfo info = iter.next();
        if (!isSameOrVar(subj, info.getIRI()))
            continue;
        Node version = NodeFactory.createLiteral(info.getVersion());
        if (!isSameOrVar(obj, version))
            continue;
        BindingMap b = BindingFactory.create(binding);
        if (subj.isVariable())
            b.add(Var.alloc(subj), info.getIRI());
        if (subj.isVariable())
            b.add(Var.alloc(obj), version);
        results.add(b);
    }
    return new QueryIterPlainWrapper(results.iterator(), execCxt);
}
Also used : Binding(org.apache.jena.sparql.engine.binding.Binding) QueryIterPlainWrapper(org.apache.jena.sparql.engine.iterator.QueryIterPlainWrapper) SystemInfo(org.apache.jena.sparql.mgt.SystemInfo) Node(org.apache.jena.graph.Node) ArrayList(java.util.ArrayList) BindingMap(org.apache.jena.sparql.engine.binding.BindingMap)

Example 9 with SystemInfo

use of org.apache.jena.sparql.mgt.SystemInfo in project jena by apache.

the class ARQ method init.

public static void init() {
    if (initialized) {
        return;
    }
    synchronized (initLock) {
        if (initialized) {
            JenaSystem.logLifecycle("ARQ.init - skip");
            return;
        }
        initialized = true;
        JenaSystem.logLifecycle("ARQ.init - start");
        // Force constants to be set.  This should be independent of other initialization including jena core.
        ARQConstants.getGlobalPrefixMap();
        ResultSetLang.init();
        globalContext = defaultSettings();
        // After context and after PATH/NAME/VERSION/BUILD_DATE are set
        ARQMgt.init();
        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);
        AssemblerUtils.init();
        // Register RIOT details here, not earlier, to avoid
        // initialization loops with RIOT.init() called directly.
        RIOT.register();
        // Initialise the standard library.
        FunctionRegistry.init();
        AggregateRegistry.init();
        PropertyFunctionRegistry.init();
        JenaSystem.logLifecycle("ARQ.init - finish");
    }
}
Also used : SystemInfo(org.apache.jena.sparql.mgt.SystemInfo)

Aggregations

SystemInfo (org.apache.jena.sparql.mgt.SystemInfo)9 PropertyFunction (org.apache.jena.sparql.pfunction.PropertyFunction)2 PropertyFunctionFactory (org.apache.jena.sparql.pfunction.PropertyFunctionFactory)2 ArrayList (java.util.ArrayList)1 Node (org.apache.jena.graph.Node)1 Binding (org.apache.jena.sparql.engine.binding.Binding)1 BindingMap (org.apache.jena.sparql.engine.binding.BindingMap)1 QueryIterPlainWrapper (org.apache.jena.sparql.engine.iterator.QueryIterPlainWrapper)1