The BioCypher Ecosystem
Remote validation server
Initializing search
    • About
    • BioCypher
    • BioChatter
    • Biotope
      • Philosophy
      • Timeline and Publications
      • Sponsors
        • User workshop 2026
        • Join Us
        • Where to Start
        • Contribute to the Documentation
        • Contribute to the Code Base
      • Home
        • Project
        • Design philosophy
        • Use Cases
        • BioCypher + LLMs
        • R and Bioconductor
        • Installation
        • Quickstart
        • LLM Integration
          • Basics
          • Handling Ontologies
          • Adapters
          • Example Notebook: BioCypher and Pandas
          • Agent API Guide
          • Hands-on Protein Graphs with BioCypher and Neo4j
          • Index
          • Standalone Docker Image
          • Index
          • About Adapters
          • About Ontologies
          • Schema Configuration Philosophy
          • Graph Class Guide
          • Architecture Migration Guide
        • Reference Index
          • API Reference
          • BioCypher
          • BioCypherWorkflow
          • Graph Class
          • Output Writing
          • Output In-Memory
          • Output Driver
          • Download and Cache
          • Ontology Handling
          • Graph Handling
          • Mapping and Translation
          • Logging
          • Miscellaneous Utility Functions
        • BioCypher Configuration
          • Overview
          • Neo4j
          • SQLite
          • PostgreSQL
          • NetworkX
          • Tabular Format
          • RDF
          • OWL
          • ArangoDB
        • Schema Configuration
        • Join Us
        • Where to Start
        • Contribute to the Documentation
        • Contribute to the Code Base
      • Home
        • Project
        • Design Philosophy
        • Use Cases
        • Installation
        • Quickstart
          • Basic Usage - Chat
          • Multimodal Models
          • Retrieval-Augmented Generation
          • In Chat Tool Calling
          • Ad hoc API Calling
          • Structured outputs
          • Reflexion via LangGraph
          • Open-source and Local LLMs
          • The Living Benchmark
          • Podcast my Paper
          • LLM in your Browser - WebAssembly
          • Knowledge Graph RAG
          • Retrieval-Augmented Generation (RAG)
          • Customising BioChatter Light - Simple
          • Customising BioChatter Light - Advanced
          • Customising BioChatter Light and Next - Cancer Genetics Use Case
        • Overview
        • All Results
        • Developer Guide
          • LLM Connectivity
          • Vectorstore Agent
          • Knowledge Graph Agent
          • API Calling: Base Classes
          • API Calling: Web APIs
          • API Calling: Python APIs
          • Reflexion Agent
          • Podcast
      • Home
      • Tutorial
      • Architecture
      • Project Context
      • Cluster Compliance
        • Init
        • Add
        • Map
        • Build
        • Propose Alignment
        • Propose Mapping (deprecated)
        • Annotate
        • Search
        • Config
    In [ ]:
    Copied!
    """
    Example Flask server for serving remote validation configurations.
    
    This demonstrates how to set up a simple HTTP server to provide
    validation configurations for biotope projects.
    
    Usage:
        python remote-validation-server.py
    
    Then in your biotope project:
        biotope config set-remote-validation --url http://localhost:5000/validation.yaml
    """
    
    """ Example Flask server for serving remote validation configurations. This demonstrates how to set up a simple HTTP server to provide validation configurations for biotope projects. Usage: python remote-validation-server.py Then in your biotope project: biotope config set-remote-validation --url http://localhost:5000/validation.yaml """
    In [ ]:
    Copied!
    import yaml
    from flask import Flask
    
    import yaml from flask import Flask
    In [ ]:
    Copied!
    app = Flask(__name__)
    
    app = Flask(__name__)
    In [ ]:
    Copied!
    # Example validation configurations for different use cases
    VALIDATION_CONFIGS = {
        "basic": {
            "annotation_validation": {
                "enabled": True,
                "minimum_required_fields": ["name", "description", "creator", "dateCreated", "distribution"],
                "field_validation": {
                    "name": {"type": "string", "min_length": 1},
                    "description": {"type": "string", "min_length": 10},
                    "creator": {"type": "object", "required_keys": ["name"]},
                    "dateCreated": {"type": "string", "format": "date"},
                    "distribution": {"type": "array", "min_length": 1},
                },
            }
        },
        "comprehensive": {
            "annotation_validation": {
                "enabled": True,
                "minimum_required_fields": [
                    "name",
                    "description",
                    "creator",
                    "dateCreated",
                    "distribution",
                    "license",
                    "version",
                    "citation",
                ],
                "field_validation": {
                    "name": {"type": "string", "min_length": 1},
                    "description": {"type": "string", "min_length": 20},
                    "creator": {"type": "object", "required_keys": ["name"]},
                    "dateCreated": {"type": "string", "format": "date"},
                    "distribution": {"type": "array", "min_length": 1},
                    "license": {"type": "string", "min_length": 5},
                    "version": {"type": "string", "min_length": 1},
                    "citation": {"type": "string", "min_length": 10},
                },
            }
        },
        "clinical": {
            "annotation_validation": {
                "enabled": True,
                "minimum_required_fields": [
                    "name",
                    "description",
                    "creator",
                    "dateCreated",
                    "distribution",
                    "license",
                    "ethics_approval",
                    "data_usage_agreement",
                ],
                "field_validation": {
                    "name": {"type": "string", "min_length": 1},
                    "description": {"type": "string", "min_length": 50},
                    "creator": {"type": "object", "required_keys": ["name", "institution"]},
                    "dateCreated": {"type": "string", "format": "date"},
                    "distribution": {"type": "array", "min_length": 1},
                    "license": {"type": "string", "min_length": 5},
                    "ethics_approval": {"type": "string", "min_length": 1},
                    "data_usage_agreement": {"type": "string", "min_length": 1},
                },
            }
        },
    }
    
    # Example validation configurations for different use cases VALIDATION_CONFIGS = { "basic": { "annotation_validation": { "enabled": True, "minimum_required_fields": ["name", "description", "creator", "dateCreated", "distribution"], "field_validation": { "name": {"type": "string", "min_length": 1}, "description": {"type": "string", "min_length": 10}, "creator": {"type": "object", "required_keys": ["name"]}, "dateCreated": {"type": "string", "format": "date"}, "distribution": {"type": "array", "min_length": 1}, }, } }, "comprehensive": { "annotation_validation": { "enabled": True, "minimum_required_fields": [ "name", "description", "creator", "dateCreated", "distribution", "license", "version", "citation", ], "field_validation": { "name": {"type": "string", "min_length": 1}, "description": {"type": "string", "min_length": 20}, "creator": {"type": "object", "required_keys": ["name"]}, "dateCreated": {"type": "string", "format": "date"}, "distribution": {"type": "array", "min_length": 1}, "license": {"type": "string", "min_length": 5}, "version": {"type": "string", "min_length": 1}, "citation": {"type": "string", "min_length": 10}, }, } }, "clinical": { "annotation_validation": { "enabled": True, "minimum_required_fields": [ "name", "description", "creator", "dateCreated", "distribution", "license", "ethics_approval", "data_usage_agreement", ], "field_validation": { "name": {"type": "string", "min_length": 1}, "description": {"type": "string", "min_length": 50}, "creator": {"type": "object", "required_keys": ["name", "institution"]}, "dateCreated": {"type": "string", "format": "date"}, "distribution": {"type": "array", "min_length": 1}, "license": {"type": "string", "min_length": 5}, "ethics_approval": {"type": "string", "min_length": 1}, "data_usage_agreement": {"type": "string", "min_length": 1}, }, } }, }
    In [ ]:
    Copied!
    @app.route("/")
    def index():
        """Show available validation configurations."""
        html = """
        <h1>Biotope Remote Validation Server</h1>
        <p>Available validation configurations:</p>
        <ul>
            <li><a href="/validation.yaml">Default validation</a></li>
            <li><a href="/basic/validation.yaml">Basic validation</a></li>
            <li><a href="/comprehensive/validation.yaml">Comprehensive validation</a></li>
            <li><a href="/clinical/validation.yaml">Clinical data validation</a></li>
        </ul>
        <p>Usage in biotope project:</p>
        <code>biotope config set-remote-validation --url http://localhost:5000/validation.yaml</code>
        """
        return html
    
    @app.route("/") def index(): """Show available validation configurations.""" html = """

    Biotope Remote Validation Server

    Available validation configurations:

    • Default validation
    • Basic validation
    • Comprehensive validation
    • Clinical data validation

    Usage in biotope project:

    biotope config set-remote-validation --url http://localhost:5000/validation.yaml """ return html
    In [ ]:
    Copied!
    @app.route("/validation.yaml")
    def default_validation():
        """Serve the default validation configuration."""
        return yaml.dump(VALIDATION_CONFIGS["basic"], default_flow_style=False), 200, {"Content-Type": "application/x-yaml"}
    
    @app.route("/validation.yaml") def default_validation(): """Serve the default validation configuration.""" return yaml.dump(VALIDATION_CONFIGS["basic"], default_flow_style=False), 200, {"Content-Type": "application/x-yaml"}
    In [ ]:
    Copied!
    @app.route("/<config_type>/validation.yaml")
    def specific_validation(config_type):
        """Serve a specific validation configuration."""
        if config_type not in VALIDATION_CONFIGS:
            return f"Configuration '{config_type}' not found", 404
    
        return (
            yaml.dump(VALIDATION_CONFIGS[config_type], default_flow_style=False),
            200,
            {"Content-Type": "application/x-yaml"},
        )
    
    @app.route("//validation.yaml") def specific_validation(config_type): """Serve a specific validation configuration.""" if config_type not in VALIDATION_CONFIGS: return f"Configuration '{config_type}' not found", 404 return ( yaml.dump(VALIDATION_CONFIGS[config_type], default_flow_style=False), 200, {"Content-Type": "application/x-yaml"}, )
    In [ ]:
    Copied!
    @app.route("/health")
    def health():
        """Health check endpoint."""
        return {"status": "healthy", "configurations": list(VALIDATION_CONFIGS.keys())}
    
    @app.route("/health") def health(): """Health check endpoint.""" return {"status": "healthy", "configurations": list(VALIDATION_CONFIGS.keys())}
    In [ ]:
    Copied!
    if __name__ == "__main__":
        print("Starting Biotope Remote Validation Server...")
        print("Available configurations:")
        for config_name in VALIDATION_CONFIGS.keys():
            print(f"  - {config_name}")
        print("\nUsage in biotope project:")
        print("  biotope config set-remote-validation --url http://localhost:5000/validation.yaml")
        print("\nServer starting on http://localhost:5000")
        app.run(debug=True, host="0.0.0.0", port=5000)
    
    if __name__ == "__main__": print("Starting Biotope Remote Validation Server...") print("Available configurations:") for config_name in VALIDATION_CONFIGS.keys(): print(f" - {config_name}") print("\nUsage in biotope project:") print(" biotope config set-remote-validation --url http://localhost:5000/validation.yaml") print("\nServer starting on http://localhost:5000") app.run(debug=True, host="0.0.0.0", port=5000)
    © Copyright 2021-2025, BioCypher developers.
    Made with Material for MkDocs