Skip to content
Snippets Groups Projects
Select Git revision
  • f7e48e33fc7630d1380b3cd2b130b5140e88a496
  • master default protected
  • L2SS-1914-fix_job_dispatch
  • TMSS-3170
  • TMSS-3167
  • TMSS-3161
  • TMSS-3158-Front-End-Only-Allow-Changing-Again
  • TMSS-3133
  • TMSS-3319-Fix-Templates
  • test-fix-deploy
  • TMSS-3134
  • TMSS-2872
  • defer-state
  • add-custom-monitoring-points
  • TMSS-3101-Front-End-Only
  • TMSS-984-choices
  • SDC-1400-Front-End-Only
  • TMSS-3079-PII
  • TMSS-2936
  • check-for-max-244-subbands
  • TMSS-2927---Front-End-Only-PXII
  • Before-Remove-TMSS
  • LOFAR-Release-4_4_318 protected
  • LOFAR-Release-4_4_317 protected
  • LOFAR-Release-4_4_316 protected
  • LOFAR-Release-4_4_315 protected
  • LOFAR-Release-4_4_314 protected
  • LOFAR-Release-4_4_313 protected
  • LOFAR-Release-4_4_312 protected
  • LOFAR-Release-4_4_311 protected
  • LOFAR-Release-4_4_310 protected
  • LOFAR-Release-4_4_309 protected
  • LOFAR-Release-4_4_308 protected
  • LOFAR-Release-4_4_307 protected
  • LOFAR-Release-4_4_306 protected
  • LOFAR-Release-4_4_304 protected
  • LOFAR-Release-4_4_303 protected
  • LOFAR-Release-4_4_302 protected
  • LOFAR-Release-4_4_301 protected
  • LOFAR-Release-4_4_300 protected
  • LOFAR-Release-4_4_299 protected
41 results

create_add_virtual_instrument.sql.py

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    repo_processing.py 2.03 KiB
    from neo4j import Driver 
    from graph_creation.cwl_parsing import get_cwl_from_repo
    from graph_creation.docker_parsing import parse_all_dockerfiles
    from graph_creation.utils import process_step_lookup
    from graph_creation.cwl_processing import process_cwl_commandline, process_cwl_inputs, process_cwl_outputs, process_cwl_steps
    from neo4j_graph_queries.utils import get_is_workflow
    import pprint
    
    def process_repos(repo_list: list[str], driver: Driver) -> None:
        """
        Processes a list of local repository paths containing CWL (Common Workflow Language) files,
        parsing each CWL file and creating the corresponding nodes and relationships in a Neo4j graph.
    
        The function extracts workflows and tools from each repository, processes the inputs, outputs, and 
        steps for each entity, and links them into a dependency graph. The Neo4j driver is used to interact 
        with the database, creating nodes and relationships based on the parsed CWL data.
    
        Parameters:
            repo_list (list[str]): A list of paths to local repositories. Each repository contains CWL files 
                                   that define workflows and tools
            driver (Driver): A Neo4j driver used to interact with the database
    
        Returns:
            None
        """
        for repo in repo_list:
            # Parse CWL files of current repo
            all_entities = get_cwl_from_repo(repo)
    
            # links = parse_all_dockerfiles(repo)
            for entity in all_entities:
                print(f'Processing: {entity["path"]}')
                is_workflow = get_is_workflow(entity)
                steps = None
                if is_workflow:
                    steps = process_step_lookup(entity)
                process_cwl_inputs(driver, entity)
                process_cwl_outputs(driver, entity, steps)
                if steps:
                    process_cwl_steps(driver, entity, steps)
                # elif entity['class'] == 'ExpressionTool':
                #     process_cwl_expression(driver, entity)
                # elif entity['class'] == 'CommandLineTool':
                #     process_cwl_commandline(driver, entity, links)