private Resource getFunction(ExprFunction function) {
		String symbol = function.getOpName();
		if(symbol == null) {
			symbol = function.getFunctionSymbol().getSymbol();
		}
		if(symbol != null) {
			List<Resource> list = symbolsMap.get(symbol.toLowerCase());
			if(list != null) {
				if(list.size() == 1) {
					return list.get(0);
				}
				else {
					// Disambiguate functions with same symbol (+ and -)
					for(Resource f : list) {
						int count = 0;
						StmtIterator dit = f.listProperties(SPIN.constraint);
						while(dit.hasNext()) {
							dit.next();
							count++;
						}
						int argsCount = function.getArgs().size();
						if(argsCount == count) {
							return f;
						}
					}
				}
			}
		}
		String iri = function.getFunctionIRI();
		if(iri != null) {
			return model.getResource(iri);
		}
		else if(symbol != null) {
			// Case if fn: functions are entered without prefix
			return model.getResource("http://www.w3.org/2005/xpath-functions#" + symbol);
		}
		else {
			return null;
		}
	}