}
}
if (nodeOrArc instanceof Resource){// the path should start with an arc location step
// path expr should be evaluated either on incoming or outgoing statements
// whether we evaluate it on incoming or outgoing arcs depends on the 1st location step's axis
MemStatementList properties = getPropertyArcs((MemResource)nodeOrArc, expr.steps[0].axis);
for (int i=0;i<properties.size();i++){
selectProperty(expr, startStepIndex, properties.get(i), selectedElements, pathInstances);
}
}
else if (nodeOrArc instanceof Statement){// the path should start with a node location step
// path expr should be evaluated either on subject or object of statement
// depending on the 1st location step's axis