terminusdb / terminusdb/terminusdb-client-python

add support for unfolding to python schema

Open
#470 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: python client enhancement python triage
Dominant language
Python
Stars
80
Forks
62
PR merge metrics
No merged PRs in 30d

Description

Is your feature request related to a problem? Please describe.

adding _unfoldable = [] does nothing when creating a schema with the python client.
E.g.:

myschema = Schema()


class Method(DocumentTemplate):
    _schema = myschema
    linked = OtherClass
    _unfoldable = [] #

Expected output: The resulting schema has @unfoldable in the document definition, but it hasn't.

Describe the solution you'd like

for unfoldable, it seems that it could just function analogous to _schema or _abstract. so _unfoldable = [].

Describe alternatives you've considered
Decorator.

Additional context
Im trying to use terminus exclusively from python (i.e. i'd like to be able to access all functionality in a pythonic way, including retrieval -> need to be able to have unfoldable for the db to return a subgraph/tree instead of only a list of solutions).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how Python schema construction handles the existing _schema and _abstract attributes, then compare that path with document-definition generation. Implement support for _unfoldable = [] so the resulting definition includes @unfoldable, and verify that the generated schema supports retrieval of the requested subgraph or tree.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.