Namespaces) (*path.Path, error)
}

// PropertyPath is a struct wrapping PropertyPathI
type PropertyPath struct {
	PropertyPathI
}

// NewPropertyPath constructs a new PropertyPath
func NewPropertyPath(p PropertyPathI) *PropertyPath {
	return &PropertyPath{PropertyPathI: p}
}

// Description implements Step.
func (*PropertyPath) Description() string {
	return "PropertyPath is a string, multiple strins or path describing a set of properties"
}

// UnmarshalJSON implements RawMessage
func (p *PropertyPath) UnmarshalJSON(data []byte) error {
	var errors []error

	var propertyIRIs PropertyIRIs
	err := json.Unmarshal(data, &propertyIRIs)
	if err == nil {
		p.PropertyPathI = propertyIRIs
		return nil
	}
	errors = append(errors, err)

	var propertyIRIStrings PropertyIRIStrings
	err = json.Unmarshal(data, &propertyIRIStrings)
	if err == nil {
		p.PropertyPathI = propertyIRIStrings
		return nil
	}
	errors = append(errors, err)

	var propertyIRI PropertyIRI
	err = json.Unmarshal(data, &propertyIRI)
	if err == nil {
		p.PropertyPathI = propertyIRI
		return nil
	}
	errors = append(errors, err)

	var propertyIRIString PropertyIRIString
	err = json.Unmarshal(data, &propertyIRIString)
	if err == nil {
		p.PropertyPathI = propertyIRIString
		return nil
	}
	errors = append(errors, err)

	step, err := Unmarshal(data)
	if err == nil {
		pathStep, ok := step.(PathStep)
		if ok {
			p.PropertyPathI = pathStep
			return nil
		}
		errors = append(errors, fmt.Errorf("Step of type %T is not a PathStep. A PropertyPath step must be a PathStep", step))
	}
	errors = append(errors, err)

	return formatMultiError(errors)
}

// PropertyIRIs is a slice of property IRIs.
type PropertyIRIs []PropertyIRI

// BuildPath implements PropertyPath.
func (p PropertyIRIs) BuildPath(qs graph.QuadStore, ns *voc.Namespaces) (*path.Path, error) {
	var values []quad.Value
	for _, iri := range p {
		values = append(values, iri.full(ns))
	}
	return path.StartPath(qs, values...), nil
}

// PropertyIRIStrings is a slice of property IRI strings.
type PropertyIRIStrin