Added getCardinality for the Relationship class and isValid for the RelationalPath