Пример #1
0
def get_version2schema():
    global _version2schema
    if _version2schema is not None:
        return _version2schema
    current = {
        "$id": SCHEMA_URL_PREF + "current/tnrs/infer_context.json",
        "type": "object",
        "$schema": "http://json-schema.org/draft-07/schema#",
        "properties": {
            "ambiguous_names": {
                "type": "array",
                "items": {
                    "type": "string"
                }
            },
            "context_name": {
                "type": "string"
            },
            "context_ott_id": {
                "type": "integer"
            }
        },
        "required": ["ambiguous_names", "context_name", "context_ott_id"]
    }

    v2 = copy.deepcopy(current)
    _version2schema = compose_schema2version(v2=v2, current=current)
    return _version2schema
Пример #2
0
def get_version2schema():
    global _version2schema
    if _version2schema is not None:
        return _version2schema

    current = {
        "$id": SCHEMA_URL_PREF + "current/taxonomy/mrca.json",
        "type": "object",
        "definitions": {},
        "$schema": "http://json-schema.org/draft-07/schema#",
        "properties": {
            "mrca": {
                "type": "object"
            },
            "ott_ids_not_found": {
                "type": "array",
                "items": {
                    "type": "integer"
                }
            }
        }
    }
    v2 = copy.deepcopy(current)
    v2['properties']['mrca']['properties'] = taxon_obj_properties('v2')
    current['properties']['mrca']['properties'] = taxon_obj_properties('v3')
    _version2schema = compose_schema2version(v2=v2, current=current)
    return _version2schema
Пример #3
0
def get_version2schema():
    global _version2schema
    if _version2schema is not None:
        return _version2schema
    current = {
        "$id": SCHEMA_URL_PREF + "current/taxonomy/about.json",
        "type": "object",
        "$schema": "http://json-schema.org/draft-07/schema#",
        "properties": get_taxonomy_about_properties('v3'),
        "required": ["author", "name", "source", "version", "weburl"]
    }
    _version2schema = compose_schema2version(v2=copy.deepcopy(current),
                                             current=current)
    return get_version2schema()
Пример #4
0
def get_version2schema():
    global _version2schema
    if _version2schema is not None:
        return _version2schema
    current = {
        "$id": SCHEMA_URL_PREF + "current/tree_of_life/about.json",
        "type": "object",
        "$schema": "http://json-schema.org/draft-07/schema#",
        "properties": get_find_properties_properties('v3'),
        "required": ["tree_properties", "study_properties"]
    }
    v2 = copy.deepcopy(current)
    _version2schema = compose_schema2version(v2=v2, current=current)
    return get_version2schema()
Пример #5
0
def get_version2schema():
    global _version2schema
    if _version2schema is not None:
        return _version2schema
    current = {
        "$id": SCHEMA_URL_PREF + "current/taxonomy/taxon.json",
        "type": "object",
        "definitions": {},
        "$schema": "http://json-schema.org/draft-07/schema#"
    }
    v2 = copy.deepcopy(current)
    v2['properties'] = taxon_obj_properties('v2')
    current['properties'] = taxon_obj_properties('v3')
    _version2schema = compose_schema2version(v2=v2, current=current)
    return _version2schema
Пример #6
0
def get_version2schema():
    global _version2schema
    if _version2schema is not None:
        return _version2schema
    current = {
        "$id": SCHEMA_URL_PREF + "current/tree_of_life/about.json",
        "type": "object",
        "$schema": "http://json-schema.org/draft-07/schema#",
        "properties": get_tree_of_life_mrca_properties('v3'),
        "required": ["mrca", "source_id_map"]
    }
    v2 = copy.deepcopy(current)
    p2 = get_tree_of_life_mrca_properties('v2')
    v2["properties"] = p2
    v2["required"] = list(p2.keys())
    _version2schema = compose_schema2version(v2=v2, current=current)
    return get_version2schema()
Пример #7
0
def get_version2schema():
    global _version2schema
    if _version2schema is not None:
        return _version2schema
    current = {
        "$id": SCHEMA_URL_PREF + "current/tnrs/autocomplete_name.json",
        "type": "array",
        "$schema": "http://json-schema.org/draft-07/schema#",
        "items": {
            "type": "object"
        }
    }
    v2 = copy.deepcopy(current)
    add_taxon_properties(current["items"], 'current')
    add_taxon_properties(v2["items"], 'v2')
    _version2schema = compose_schema2version(v2=v2, current=current)
    return _version2schema
Пример #8
0
def get_version2schema():
    global _version2schema
    if _version2schema is not None:
        return _version2schema
    current = {
        "$id": SCHEMA_URL_PREF + "current/tree_of_life/about.json",
        "type": "object",
        "$schema": "http://json-schema.org/draft-07/schema#",
        "properties": get_tree_of_life_about_properties('v3'),
        "required": ["date_created", "num_source_studies", "num_source_trees",
                     "root", "synth_id", 'taxonomy_version', 'filtered_flags', ]
    }
    v2 = copy.deepcopy(current)
    p2 = get_tree_of_life_about_properties('v2')
    v2["properties"] = p2
    v2["required"] = list(p2.keys())
    _version2schema = compose_schema2version(v2=v2, current=current)
    return get_version2schema()
Пример #9
0
def get_version2schema():
    global _version2schema
    if _version2schema is not None:
        return _version2schema
    current = {
        "$id": SCHEMA_URL_PREF + "current/taxonomy/subtree.json",
        "type": "object",
        "$schema": "http://json-schema.org/draft-07/schema#",
        "properties": {},
    }
    v2 = copy.deepcopy(current)
    n = newick_property('v2')
    v2["properties"][n] = {"type": "string"}
    v2["required"] = [n]
    c = newick_property('current')
    current["properties"][c] = {"type": "string"}
    current["required"] = [c]
    _version2schema = compose_schema2version(v2=v2, current=current)
    return _version2schema
Пример #10
0
def get_version2schema():
    global _version2schema
    if _version2schema is not None:
        return _version2schema
    current = {
        "$id": SCHEMA_URL_PREF + "current/tree_of_life/about.json",
        "type": "object",
        "$schema": "http://json-schema.org/draft-07/schema#",
        "properties": {
            "newick": {
                "type": "string"
            },
        },
        "required": ["newick"]
    }
    v2 = copy.deepcopy(current)
    p2 = v2["properties"]
    p2["tree_id"] = {"type": "string"}
    v2["required"] = list(p2.keys())
    _version2schema = compose_schema2version(v2=v2, current=current)
    return get_version2schema()
Пример #11
0
def get_version2schema():
    global _version2schema
    if _version2schema is not None:
        return _version2schema
    current = {
        "$id": SCHEMA_URL_PREF + "current/tnrs/infer_context.json",
        "type": "object",
        "$schema": "http://json-schema.org/draft-07/schema#",
        "properties": {
            "context": {
                "type": "string"
            },
            "governing_code": {
                "type": "string"
            },
            "includes_approximate_matches": {
                "type": "boolean"
            },
            "includes_deprecated_taxa": {
                "type": "boolean"
            },
            "includes_suppressed_names": {
                "type": "boolean"
            },
            'matched_names': {
                "type": "array",
                "items": {
                    "type": "string"
                }
            },
            "results": {
                "type": "array",
            },
            "unambiguous_names": {
                "type": "array",
                "items": {
                    "type": "string"
                }
            },
            "unmatched_names": {
                "type": "array",
                "items": {
                    "type": "string"
                }
            }
        }
    }
    v2 = copy.deepcopy(current)
    v2p = v2['properties']
    for newer, older in [
        ('unambiguous_names', 'unambiguous_name_ids'),
        ('unmatched_names', 'unmatched_name_ids'),
        ('matched_names', 'matched_name_ids'),
        ('includes_suppressed_names', 'includes_dubious_names'),
    ]:
        v2p[older] = v2p[newer]
        del v2p[newer]
    # noinspection PyTypeChecker
    v2['properties']['results']["items"] = get_match_names_results_objects(
        'v2')
    # noinspection PyTypeChecker
    current['properties']['results'][
        "items"] = get_match_names_results_objects('v3')
    v2['properties']['taxonomy'] = get_taxonomy_about_properties('v2')
    current['properties']['taxonomy'] = get_taxonomy_about_properties('v3')
    v2['required'] = list(v2['properties'].keys())
    current['required'] = list(current['properties'].keys())
    _version2schema = compose_schema2version(v2=v2, current=current)
    return _version2schema
Пример #12
0
def get_version2schema():
    global _version2schema
    if _version2schema is not None:
        return _version2schema
    current = {
        "$id":
        SCHEMA_URL_PREF + "current/taxonomy/flags.json",
        "type":
        "object",
        "$schema":
        "http://json-schema.org/draft-07/schema#",
        "properties": {
            "barren": {
                "type": "integer"
            },
            "edited": {
                "type": "integer"
            },
            "environmental": {
                "type": "integer"
            },
            "environmental_inherited": {
                "type": "integer"
            },
            "extinct": {
                "type": "integer"
            },
            "extinct_direct": {
                "type": "integer"
            },
            "extinct_inherited": {
                "type": "integer"
            },
            "forced_visible": {
                "type": "integer"
            },
            "hidden": {
                "type": "integer"
            },
            "hidden_inherited": {
                "type": "integer"
            },
            "hybrid": {
                "type": "integer"
            },
            "incertae_sedis": {
                "type": "integer"
            },
            "incertae_sedis_direct": {
                "type": "integer"
            },
            "incertae_sedis_inherited": {
                "type": "integer"
            },
            "inconsistent": {
                "type": "integer"
            },
            "infraspecific": {
                "type": "integer"
            },
            "major_rank_conflict": {
                "type": "integer"
            },
            "major_rank_conflict_direct": {
                "type": "integer"
            },
            "major_rank_conflict_inherited": {
                "type": "integer"
            },
            "merged": {
                "type": "integer"
            },
            "not_otu": {
                "type": "integer"
            },
            "sibling_higher": {
                "type": "integer"
            },
            "sibling_lower": {
                "type": "integer"
            },
            "tattered": {
                "type": "integer"
            },
            "tattered_inherited": {
                "type": "integer"
            },
            "unclassified": {
                "type": "integer"
            },
            "unclassified_direct": {
                "type": "integer"
            },
            "unclassified_inherited": {
                "type": "integer"
            },
            "unplaced": {
                "type": "integer"
            },
            "unplaced_inherited": {
                "type": "integer"
            },
            "viral": {
                "type": "integer"
            },
            "was_container": {
                "type": "integer"
            }
        },
        "required": [
            'barren', 'edited', 'environmental', 'environmental_inherited',
            'extinct', 'extinct_direct', 'extinct_inherited', 'forced_visible',
            'hidden', 'hidden_inherited', 'hybrid', 'incertae_sedis',
            'incertae_sedis_direct', 'incertae_sedis_inherited',
            'inconsistent', 'infraspecific', 'major_rank_conflict',
            'major_rank_conflict_direct', 'major_rank_conflict_inherited',
            'merged', 'not_otu', 'sibling_higher', 'sibling_lower', 'tattered',
            'tattered_inherited', 'unclassified', 'unclassified_direct',
            'unclassified_inherited', 'unplaced', 'unplaced_inherited',
            'viral', 'was_container'
        ]
    }
    _version2schema = compose_schema2version(v2=copy.deepcopy(current),
                                             current=current)
    return get_version2schema()