func (p *ObjectProperty) Collection() *CollectionType {
	if p == nil {
		return nil
	}
	return p.coll
}
Collection returns the collection or nil if the collection is not set.
package vocab
import (
	"encoding/json"
	"fmt"
	"net/url"
)
type ObjectProperty struct {
	iri          *URLProperty
	obj          *ObjectType
	coll         *CollectionType
	orderedColl  *OrderedCollectionType
	activity     *ActivityType
	anchorObject *AnchorObjectType
	anchorEvent  *AnchorEventType
}
func NewObjectProperty(opts ...Opt) *ObjectProperty {
	options := NewOptions(opts...)
	return &ObjectProperty{
		iri:          NewURLProperty(options.Iri),
		obj:          options.Object,
		coll:         options.Collection,
		orderedColl:  options.OrderedCollection,
		activity:     options.Activity,
		anchorObject: options.AnchorObject,
		anchorEvent:  options.AnchorEvent,
	}
}
func (p *ObjectProperty) Type() *TypeProperty {
	if p == nil {
		return nil
	}
	if p.obj != nil {
		return p.obj.Type()
	}
	if p.coll != nil {
		return p.coll.Type()
	}
	if p.orderedColl != nil {
		return p.orderedColl.Type()
	}
	if p.activity != nil {
		return p.activity.Type()
	}
	if p.anchorObject != nil {
		return p.anchorObject.Type()
	}
	if p.anchorEvent != nil {
		return p.anchorEvent.Type()
	}
	return nil
}
func (p *ObjectProperty) IRI() *url.URL {
	if p == nil || p.iri == nil {
		return nil
	}
	return p.iri.u
}
func (p *ObjectProperty) Object() *ObjectType {
	if p == nil {
		return nil
	}
	return p.obj
}