public static HGTypedValue project(HyperGraph hg,
									   HGHandle type, 
									   Object value, 
									   String [] dimPath,
									   boolean throwExceptionOnNotFound)
	{
		Object topvalue = value;
		for (int j = 0; j < dimPath.length; j++)
		{
			HGAtomType tinstance = (HGAtomType)hg.get(type);
			if (! (tinstance instanceof HGCompositeType))
				if (throwExceptionOnNotFound)
					throw new HGException("Only composite types can be indexed by value parts: " + value
						+ ", during projection of " + formatDimensionPath(dimPath) + 
						" in type " + tinstance);
				else
					return null;
			HGProjection proj = ((HGCompositeType)tinstance).getProjection(dimPath[j]);
			if (proj == null)
				if (throwExceptionOnNotFound)
					throw new HGException("Dimension " + dimPath[j] +
							" does not exist in type " + tinstance);
				else
					return null;
            if (value == null)
                throw new IllegalArgumentException("The value " + value + 
                          " doesn't have a property at " + Arrays.asList(dimPath));
            if (value instanceof HGValueLink)
                value = ((HGValueLink)value).getValue();
			value = proj.project(value);
			type = proj.getType();
		}
		return new HGTypedValue(value, type);
	}