Package com.hp.hpl.jena.graph

Examples of com.hp.hpl.jena.graph.Graph


       
        s = Var.lookup(binding, s) ;
        o = Var.lookup(binding, o) ;
        Iterator<Node> iter = null ;
        Node endNode = null ;
        Graph graph = execCxt.getActiveGraph() ;
       
        if ( Var.isVar(s) && Var.isVar(o) )
        {
            if ( s.equals(o) )
                return ungroundedPathSameVar(binding, graph, Var.alloc(s), path, execCxt) ;
View Full Code Here


     */
    @Override
    public void headAction(Node[] args, int length, RuleContext context) {
        boolean ok = false;
        InfGraph inf = context.getGraph();
        Graph raw = inf.getRawGraph();
        Graph deductions = inf.getDeductionsGraph();
        for (int i = 0; i < length; i++) {
            Node clauseN = getArg(i, args, context);
            if (Util.isNumeric(clauseN)) {
                int clauseIndex = Util.getIntValue(clauseN);
                Object clause = context.getRule().getBodyElement(clauseIndex);
                if (clause instanceof TriplePattern) {
                    Triple t = context.getEnv().instantiate((TriplePattern)clause);
                    raw.delete(t);
                    deductions.delete(t);
                } else {
                    throw new BuiltinException(this, context, "illegal triple to remove non-triple clause");
                }
            } else {
                throw new BuiltinException(this, context, "illegal arg to remove (" + clauseN + "), must be an integer");
View Full Code Here

    {
        checkGraphName(uri) ;
        Node n = NodeFactory.createURI(uri) ;
        synchronized(internalLock)
        {
            Graph g = dsg.getGraph(n) ;
            if ( g == null )
                return null ;
            return graph2model(g) ;
        }
    }
View Full Code Here

        if ( ! caching )
            return _createNamedGraph(graphNode) ;

        synchronized(this)
        {   // MRSW - need to create and update the cache atomically.
            Graph graph = namedGraphs.get(graphNode) ;
            if ( graph == null )
            {
                graph = _createNamedGraph(graphNode) ;
                namedGraphs.put(graphNode, graph) ;
            }
View Full Code Here

public abstract class DatasetGraphCollection extends DatasetGraphBaseFind
{
    @Override
    public void add(Quad quad)
    {
        Graph g = fetchGraph(quad.getGraph()) ;
        if ( g == null )
            throw new JenaException("No such graph: "+quad.getGraph()) ;
        g.add(quad.asTriple()) ;
    }
View Full Code Here

    }

    @Override
    public void delete(Quad quad)
    {
        Graph g = fetchGraph(quad.getGraph()) ;
        if ( g == null )
            throw new JenaException("No such graph: "+quad.getGraph()) ;
        g.delete(quad.asTriple()) ;
    }
View Full Code Here

    }
   
    @Override
    protected Iter<Quad> findInSpecificNamedGraph(Node g, Node s, Node p , Node o)
    {
        Graph graph = fetchGraph(g) ;
        if ( g == null )
            return Iter.nullIter() ;
        return triples2quads(g, graph.find(s, p, o)) ;
    }
View Full Code Here

            throw new ExprEvalException("ListIndex : object not a list of length 2") ;

        Node indexNode = objectArgs.get(0) ;
        Node memberNode = objectArgs.get(1) ;
       
        Graph graph = execCxt.getActiveGraph() ;
       
        if ( Var.isVar(indexNode) && ! Var.isVar(memberNode) )
            return findIndex(graph, binding, listNode, Var.alloc(indexNode), memberNode, execCxt) ;
           
        if ( ! Var.isVar(indexNode) && Var.isVar(memberNode) )
View Full Code Here

public class listLength extends ListBase1
{
    @Override
    public QueryIterator execOneList(Binding binding, Node listNode, Node predicate, Node length, ExecutionContext execCxt)
    {
        Graph graph = execCxt.getActiveGraph() ;
        if ( Var.isVar(listNode) )
            throw new ARQInternalErrorException("listLength: Subject is a variable") ;
        // Case : arg 1 (the list) is bound and arg 2 not bound => generate possibilities
        // Case : arg 1 is bound and arg 2 is bound => test for membership.
View Full Code Here

    @Override
    protected QueryIterator execObjectBound(Binding binding, Var listVar, Node predicate, Node length,
                                            ExecutionContext execCxt)
    {
        Graph graph = execCxt.getActiveGraph() ;
        return length(binding, graph, listVar,  Var.alloc(length) , execCxt) ;
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.graph.Graph

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.