ChildMindInstitute / MindLogger-bug-reports

GitHub repository for bug tracking and feature requesting for the MindLogger project
Other
0 stars 1 forks source link

✨📁 Merge like-for-like content #76

Open shnizzedy opened 4 years ago

shnizzedy commented 4 years ago

Is your feature request related to a problem? Please describe. As I understand the goals of this project, the purpose of having modular content is twofold: fluent reuse of content and a semantic model that includes whether a given pair of documents are the same. However, the way we are currently encoding content, documents that are otherwise identical are served at different URLs and are thus considered different documents.

Example

https://raw.githubusercontent.com/hotavocado/HBN_EMA_NIMH2/03794703dd2275ca8a8b8b6dcb7b58c65370fcfe/activities/evening_set/items/Context2https://raw.githubusercontent.com/hotavocado/HBN_EMA_NIMH2/03794703dd2275ca8a8b8b6dcb7b58c65370fcfe/activities/day_set/items/Context2

{
    "@context": [
        "https://raw.githubusercontent.com/ReproNim/reproschema/master/contexts/generic"
    ],
    "@type": "reproschema:Field",
    "skos:altLabel": "Context2",
    "preamble": {
        "en": "Context:"
    },
    "ui": {
        "inputType": "radio"
    },
    "question": {
        "en": "Where are you right now?"
    },
    "responseOptions": {
        "choices": [
            {
                "schema:value": 1,
                "schema:name": "In my home ",
                "@type": "schema:option"
            },
            {
                "schema:value": 2,
                "schema:name": "in home of relative or friend ",
                "@type": "schema:option"
            },
            {
                "schema:value": 3,
                "schema:name": "at work or in class ",
                "@type": "schema:option"
            },
            {
                "schema:value": 4,
                "schema:name": "in a restaurant/cafe/bar ",
                "@type": "schema:option"
            },
            {
                "schema:value": 5,
                "schema:name": "in a store or shop ",
                "@type": "schema:option"
            },
            {
                "schema:value": 6,
                "schema:name": "in the gym or fitness center ",
                "@type": "schema:option"
            },
            {
                "schema:value": 7,
                "schema:name": "in a hospital or doctor's office ",
                "@type": "schema:option"
            },
            {
                "schema:value": 8,
                "schema:name": "in a vehicle (car/bus) ",
                "@type": "schema:option"
            },
            {
                "schema:value": 9,
                "schema:name": "in a public building ",
                "@type": "schema:option"
            },
            {
                "schema:value": 10,
                "schema:name": "in a park or garden ",
                "@type": "schema:option"
            },
            {
                "schema:value": 11,
                "schema:name": "other place inside ",
                "@type": "schema:option"
            },
            {
                "schema:value": 12,
                "schema:name": "other place outside",
                "@type": "schema:option"
            }
        ]
    }
}

{
    "@context": [
        "https://raw.githubusercontent.com/ReproNim/reproschema/master/contexts/generic"
    ],
    "@type": "reproschema:Field",
    "skos:altLabel": "Context2",
    "preamble": {
        "en": "Context:"
    },
    "ui": {
        "inputType": "radio"
    },
    "question": {
        "en": "Where are you right now?"
    },
    "responseOptions": {
        "choices": [
            {
                "schema:value": 1,
                "schema:name": "In my home ",
                "@type": "schema:option"
            },
            {
                "schema:value": 2,
                "schema:name": "in home of relative or friend ",
                "@type": "schema:option"
            },
            {
                "schema:value": 3,
                "schema:name": "at work or in class ",
                "@type": "schema:option"
            },
            {
                "schema:value": 4,
                "schema:name": "in a restaurant/cafe/bar ",
                "@type": "schema:option"
            },
            {
                "schema:value": 5,
                "schema:name": "in a store or shop ",
                "@type": "schema:option"
            },
            {
                "schema:value": 6,
                "schema:name": "in the gym or fitness center ",
                "@type": "schema:option"
            },
            {
                "schema:value": 7,
                "schema:name": "in a hospital or doctor's office ",
                "@type": "schema:option"
            },
            {
                "schema:value": 8,
                "schema:name": "in a vehicle (car/bus) ",
                "@type": "schema:option"
            },
            {
                "schema:value": 9,
                "schema:name": "in a public building ",
                "@type": "schema:option"
            },
            {
                "schema:value": 10,
                "schema:name": "in a park or garden ",
                "@type": "schema:option"
            },
            {
                "schema:value": 11,
                "schema:name": "other place inside ",
                "@type": "schema:option"
            },
            {
                "schema:value": 12,
                "schema:name": "other place outside",
                "@type": "schema:option"
            }
        ]
    }
}

Describe the solution you'd like When content is identical, it should be treated as such. We should either merge duplicate documents into one (as they are loaded? periodically?), design a system for encoding Arrays of semantically equivalent documents, or come up with another solution.