inveniosoftware / domapping

Package generating elasticsearch mapping from jsonschemas
https://domapping.readthedocs.io
GNU General Public License v2.0
14 stars 8 forks source link

global: local file identifiers #7

Closed nharraud closed 8 years ago

nharraud commented 8 years ago

closes #5

nharraud commented 8 years ago

@JavierDelgadoFernandez @tiborsimko here is the PR. Can you tell be if this can generate your mappings? I also added type guessing from enum when they contain only "string" values.

JavierDelgadoFernandez commented 8 years ago

Thanks a lot @nharraud. I was testing the tool right now and here is the result for this file CMS Questionnaire. I needed to remove aditionalProperties from the schema (Only two lines out of 1200). The result looks like:

{
    "date_detection": true,
    "_all": {
        "enable": true
    },
    "properties": {
        "general": {
            "type": "object",
            "properties": {
                "faq_awareness": {
                    "type": "string"
                },
                "meetings_awareness": {
                    "type": "string"
                },
                "forum_awareness": {
                    "type": "string"
                },
                "forum_subscription": {
                    "type": "string"
                },
                "past_interaction": {
                    "type": "string"
                }
            }
        },
        "multivariate": {
            "type": "object",
            "properties": {
                "correlation_studies": {
                    "type": "object",
                    "properties": {
                        "name": {
                            "type": "string"
                        },
                        "comments": {
                            "type": "string"
                        }
                    }
                },
(...)
                "usage": {
                    "type": "string"
                },
                "bcgrnd_shape": {
                    "type": "object",
                    "properties": {
                        "name": {
                            "type": "string"
                        },
                        "comments": {
                            "type": "string"
                        }
                    }
                }
            }
        },
        "feedback": {
            "type": "object",
            "properties": {
                "subject_to_change": {
                    "type": "object",
                    "properties": {
                        "name": {
                            "type": "string"
                        },
                        "comments": {
                            "type": "string"
                        }
                    }
                },
                "feedback": {
                    "type": "string"
                },
                "additional_comments": {
                    "type": "string"
                }
            }
        }
    },
    "numeric_detection": true
}
nharraud commented 8 years ago

Ready for review.

nharraud commented 8 years ago

@lnielsen I will separate this in 2 PR as requested by @switowski

nharraud commented 8 years ago

Split done. Enum PR is #8

lnielsen commented 8 years ago

@switowski If you drop a :ship: in the comments, I'll merge.

switowski commented 8 years ago

looks good, :ship: