How to deal with Cross-references

I want to create a cross-reference from two collections: “Person” and “Files”, each Person can have one ore more files.
My current solution is the following but does not work, I’m missing something I suppose.

# create referenced collection first
files_collection = client.collections.create(
    name="Files",
    description="Files belonging to a person",
    vectorizer_config=Configure.Vectorizer.text2vec_cohere(model="embed-multilingual-light-v3.0"),
    properties=[
        Property(name="filePath", data_type=DataType.TEXT, skip_vectorization=True),
        Property(name="size", data_type=DataType.NUMBER,skip_vectorization=True, index_filterable=True),
        Property(name="chunk", data_type=DataType.TEXT, index_searchable=True)]
)

# Create collection
person_collection = client.collections.create(
    name="Person",
    vectorizer_config=Configure.Vectorizer.text2vec_cohere(model="embed-multilingual-light-v3.0"),
    references=[
        ReferenceProperty(
            name="personToFiles",
            target_collection="Files"
        )
    ],
    properties=[
        Property(name="name", data_type=DataType.TEXT),
        Property(
            name="home_address",
            data_type=DataType.OBJECT,
            nested_properties=[
                Property(
                    name="street",
                   
                    data_type=DataType.OBJECT,
                    nested_properties=[
                        Property(name="number", data_type=DataType.INT),
                        Property(name="name", data_type=DataType.TEXT),
                    ],
                ),
                Property(name="city", data_type=DataType.TEXT,  index_searchable=True),
            ],
        ),
        Property(
            name="office_addresses",
            index_filterable=True,
            data_type=DataType.OBJECT_ARRAY,
            nested_properties=[
                Property(name="office_name", data_type=DataType.TEXT, index_searchable=True, index_filterable=True),
                Property(
                    name="street",
                    data_type=DataType.OBJECT,
                    nested_properties=[
                        Property(name="name", data_type=DataType.TEXT, index_searchable=True),
                        Property(name="number", data_type=DataType.INT),
                    ],
                ),
            ],
        ),
    ],
  
)

Than I add a “Person” object:

# Create an object
example_object_1 = {
    "name": "John Smith",
    "home_address": {
        "street": {
            "number": 123,
            "name": "Main Street",
        },
        "city": "London",
    },
    "office_addresses": [
        {
            "office_name": "London HQ",
            "street": {"number": 456, "name": "Oxford Street"},
        },
        {
            "office_name": "Manchester Branch",
            "street": {"number": 789, "name": "Piccadilly Gardens"},
        },
    ],
}

person1_uuid = person_collection.data.insert(example_object_1)
print(person1_uuid)

And a file object:

f

ile1_uuid=files_collection.data.insert(
    properties={"filePath":"./Build a Large Language Model.pdf",
        "size":2048.56,
        "chunk":"""
        Fast forward to 2022, with the release of ChatGPT, large language models (LLMs)
        have taken the world by storm and have revolutionized how many of us work. These
        models are incredibly versatile, aiding in tasks such as checking grammar, composing
        emails, summarizing lengthy documents, and much more. This is owed to their ability
        to parse and generate human-like text, which is important in various fields, from cus-
        tomer service to content creation, and even in more technical domains like coding
        and data analysis.
        """
    },  
    references={"personToFiles": person1_uuid},  
)
file1_uuid

Now to query data I can use:

response = person_collection.query.fetch_objects(
    # uuid=file1_uuid,
    return_references=QueryReference(
        link_on="personToFiles",
        return_properties=["chunk","filePath"]
    )
)
response

But I get a response as:

QueryReturn(objects=[Object(uuid=_WeaviateUUIDInt('2fc77ed7-05ee-4f23-b2dd-7c9f5dbb6a99'), metadata=MetadataReturn(creation_time=None, last_update_time=None, distance=None, certainty=None, score=None, explain_score=None, is_consistent=None, rerank_score=None), properties={'home_address': {'street': {'number': 123, 'name': 'Main Street'}, 'city': 'London'}, 'office_addresses': [{'office_name': 'London HQ', 'street': {'number': 456, 'name': 'Oxford Street'}}, {'office_name': 'Manchester Branch', 'street': {'number': 789, 'name': 'Piccadilly Gardens'}}], 'name': 'John Smith'}, references={}, vector={}, collection='Person')])

No “chunk” or “filePath” fields and references is an empty object.
Please do not suggest reading documentation; I have already reviewed it but couldn’t achieve a working example. Kindly provide detailed instructions. Thanks!

Finally solved, for anyone that could find useful to look for a solution you can find a complete Jupyter notebook on gist link