Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial concept tree endpoint #7

Merged
merged 9 commits into from
May 21, 2024
Merged

Initial concept tree endpoint #7

merged 9 commits into from
May 21, 2024

Conversation

jacobtylerwalls
Copy link
Member

Setup

PYTHONPATH="../arches" python3 manage.py shell -c "from arches_rdm.testsport ConceptTreeViewTests; ConceptTreeViewTests.setUpTestData()"
  • Checkout arches/7.6 and cherry-pick archesproject/arches@8ff2a3a
  • In project, manage.py updateproject
  • As admin user, view localhost/concept_trees to get:
example dump
{
    "schemes": [
        {
            "labels": [
                {
                    "language": "en",
                    "value": "Test Scheme",
                    "valuetype": "prefLabel"
                }
            ],
            "resourceinstance_id": "d437da66-549f-4350-8510-c54dd69dd9e6",
            "top_concepts": [
                {
                    "labels": [
                        {
                            "language": "en",
                            "value": "Concept 1",
                            "valuetype": "prefLabel"
                        }
                    ],
                    "narrower": [
                        {
                            "labels": [
                                {
                                    "language": "en",
                                    "value": "Concept 3",
                                    "valuetype": "prefLabel"
                                }
                            ],
                            "narrower": [
                                {
                                    "labels": [
                                        {
                                            "language": "en",
                                            "value": "Concept 4",
                                            "valuetype": "prefLabel"
                                        }
                                    ],
                                    "narrower": [
                                        {
                                            "labels": [
                                                {
                                                    "language": "en",
                                                    "value": "Concept 5",
                                                    "valuetype": "prefLabel"
                                                }
                                            ],
                                            "narrower": [],
                                            "resourceinstance_id": "4692c3f4-1e54-46ab-b212-4d8117740f36"
                                        }
                                    ],
                                    "resourceinstance_id": "58a03e1a-a821-4924-9eb8-b6315e98aabe"
                                }
                            ],
                            "resourceinstance_id": "a318b69a-3786-4c00-bde6-111bec9838ba"
                        },
                        {
                            "labels": [
                                {
                                    "language": "en",
                                    "value": "Concept 2",
                                    "valuetype": "prefLabel"
                                }
                            ],
                            "narrower": [
                                {
                                    "labels": [
                                        {
                                            "language": "en",
                                            "value": "Concept 3",
                                            "valuetype": "prefLabel"
                                        }
                                    ],
                                    "narrower": [
                                        {
                                            "labels": [
                                                {
                                                    "language": "en",
                                                    "value": "Concept 4",
                                                    "valuetype": "prefLabel"
                                                }
                                            ],
                                            "narrower": [
                                                {
                                                    "labels": [
                                                        {
                                                            "language": "en",
                                                            "value": "Concept 5",
                                                            "valuetype": "prefLabel"
                                                        }
                                                    ],
                                                    "narrower": [],
                                                    "resourceinstance_id": "4692c3f4-1e54-46ab-b212-4d8117740f36"
                                                }
                                            ],
                                            "resourceinstance_id": "58a03e1a-a821-4924-9eb8-b6315e98aabe"
                                        }
                                    ],
                                    "resourceinstance_id": "a318b69a-3786-4c00-bde6-111bec9838ba"
                                }
                            ],
                            "resourceinstance_id": "31ce6aa0-2a50-4887-ab2a-f5bde8e58395"
                        },
                        {
                            "labels": [
                                {
                                    "language": "en",
                                    "value": "Concept 4",
                                    "valuetype": "prefLabel"
                                }
                            ],
                            "narrower": [
                                {
                                    "labels": [
                                        {
                                            "language": "en",
                                            "value": "Concept 5",
                                            "valuetype": "prefLabel"
                                        }
                                    ],
                                    "narrower": [],
                                    "resourceinstance_id": "4692c3f4-1e54-46ab-b212-4d8117740f36"
                                }
                            ],
                            "resourceinstance_id": "58a03e1a-a821-4924-9eb8-b6315e98aabe"
                        },
                        {
                            "labels": [
                                {
                                    "language": "en",
                                    "value": "Concept 5",
                                    "valuetype": "prefLabel"
                                }
                            ],
                            "narrower": [],
                            "resourceinstance_id": "4692c3f4-1e54-46ab-b212-4d8117740f36"
                        }
                    ],
                    "resourceinstance_id": "e9ec541c-a92f-4867-8382-3012a77c8325"
                }
            ]
        },
    ]
}

@robgaston
Copy link
Member

@jacobtylerwalls Can you take a look at the test failure here -- I suspect it's due to the repo name change, but I did not dig into it.

I would like to get this PR merged in, then look to rebasing/merging #10 before we start developing the Lingo UI (@chrabyrd does this approach make sense?)

@chrabyrd
Copy link
Contributor

@jacobtylerwalls Can you take a look at the test failure here -- I suspect it's due to the repo name change, but I did not dig into it.

I would like to get this PR merged in, then look to rebasing/merging #10 before we start developing the Lingo UI (@chrabyrd does this approach make sense?)

@robgaston yep that makes sense and is probably the easiest path forward 👍

@jacobtylerwalls jacobtylerwalls merged commit cdae72d into main May 21, 2024
1 check passed
@jacobtylerwalls jacobtylerwalls deleted the retrieve-tree branch May 21, 2024 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants