Exemplo n.º 1
0
def run_pa2checker(annotations):
    pa2checker.revert_checker_source()

    for annotation, classes in annotations.iteritems():
        pa2checker.create_type_annotation(annotation)
        pa2checker.update_ontology_utils(annotation, classes)
    pa2checker.recompile_checker_framework()
Exemplo n.º 2
0
def run_pa2checker(ontology_values):
    pa2checker.revert_checker_source()

    for ontology_value, classes in ontology_values.iteritems():
        pa2checker.insert_ontology_value(ontology_value)
        pa2checker.update_ontology_utils(ontology_value, classes)
    common.recompile_checker_framework()
Exemplo n.º 3
0
def main():
    parser = argparse.ArgumentParser(description='command line interface for map2annotation')
    parser.add_argument('--type-mapping',dest='type_mapping_file')
    parser.add_argument('--field-mapping', dest='field_mapping_file')
    parser.add_argument('--project-list', dest='projects', help='project_nameA,project_nameB,...')
    args = parser.parse_args()
    if args.type_mapping_file is None and args.field_mapping_file is None:
        print "error, required at least one mapping file to be indicated."
        parser.print_help()
        sys.exit(1)

    project_list = common.get_project_list()

    if args.projects:
        arg_projects = args.projects.split(',')
        project_list = [project for project in project_list if project in arg_projects]

    pa2checker.revert_checker_source()
    
    if not args.type_mapping_file is None:
        type_mappings_to_rules(args.type_mapping_file)

    if not args.field_mapping_file is None:
        field_mappings_to_annotation(project_list, args.field_mapping_file)

    for project in project_list:
        run_anno_inference(project)
Exemplo n.º 4
0
def run_pa2checker(annotations):
  pa2checker.revert_checker_source()

  for annotation, classes in annotations.iteritems():
    pa2checker.create_type_annotation(annotation)
    pa2checker.update_ontology_utils(annotation, classes)
    pa2checker.recompile_checker_framework()
Exemplo n.º 5
0
def convert_2_ontology_value(ontology_set):
    """ 1. clean up the ontology source code back to unchanged git version
        2. takes the ontology_set, and insert elements into ontology source as new ontologies
        3. re-compile ontology to make sure the insertions doesn't break the compilation
    """
    pa2checker.revert_checker_source()
    for new_ontology in ontology_set:
        pa2checker.insert_ontology_value(new_ontology)
    common.recompile_checker_framework()