// Subject is bound : still two cases: object bound (do a check) and object unbound (assign the local name)
private QueryIterator execFixedSubject(Node nodeURI, Node nodeLocalname, Binding binding, ExecutionContext execCxt)
{
if ( ! nodeURI.isURI() )
// Subject bound but not a URI
return new QueryIterNullIterator(execCxt) ;
// Subject is bound and a URI - get the localname as a Node
Node localname = NodeFactory.createLiteral(nodeURI.getLocalName()) ;
// Object - unbound variable or a value?
if ( ! nodeLocalname.isVariable() )
{
// Object bound or a query constant. Is it the same as the calculated value?
if ( nodeLocalname.equals(localname) )
// Same
return QueryIterSingleton.create(binding, execCxt) ;
// No - different - no match.
return new QueryIterNullIterator(execCxt) ;
}
// Object unbound variable - assign the localname to it.
return QueryIterSingleton.create(binding, Var.alloc(nodeLocalname), localname, execCxt) ;
}