
Semantica Ingest 模块完全指南从本地文件到实时流的一站式数据接入【免费下载链接】semanticaGraph-Native Infrastructure for Context and Accountable AI Systems项目地址: https://gitcode.com/GitHub_Trending/sema/semanticasemantica.ingest是 Semantica 知识图谱平台的统一数据入口提供 15 个开箱即用的接入适配器覆盖本地文件、Web 网页、SQL 数据库、云存储、消息队列、Git 仓库、邮件与 RDF 本体等异构数据源。读完本文你将掌握ingest()统一调度器的自动类型探测机制、各 Ingestor 的完整用法与可选依赖、以及如何把接入步骤编排进 Semantica 的抽取流水线实现一次接入、全链路可用。本文以 docs/reference/ingest.md 为骨架结合 semantica/ingest/ 下的源码实现与 tests/ingest/ 测试用例从实践到原理逐层展开。模块概览15 种接入适配器semantica.ingest将获取数据这一环节抽象为一组职责单一的 Ingestor 类每个 Ingestor 返回各自的类型化对象FileObject、WebContent、TableData、ParquetData等而不是千篇一律的字典这让下游解析、抽取阶段可以按类型分派处理。类作用FileIngestorPDF、DOCX、HTML、JSON、CSV、Excel、PPTX、ZIP/TAR按扩展名自动识别类型CloudStorageIngestorAWS S3、Google Cloud Storage、Azure Blob Storage 的统一客户端WebIngestorWeb 抓取与爬虫提供ingest_url、crawl_sitemap、crawl_domainRESTIngestor通用 REST API 接入支持 headers、params、重试与分页PublicAPIIngestor免认证公共 API 接入内置预配置示例与限速FeedIngestorRSS/Atom 订阅接入配合FeedMonitor做实时监控StreamIngestorKafka、RabbitMQ、AWS Kinesis、Apache Pulsar 实时流接入RepoIngestorGit 仓库源码文件、提交历史与元数据DBIngestor通过 SQLAlchemy 接入 SQL 数据库表、视图与自定义查询SnowflakeIngestorSnowflake 数据仓库查询与表导出DatabricksIngestorDatabricks Unity Catalog 元数据、Delta 表查询与血缘SAPIngestorSAP OData 服务S/4HANA Cloud、SuccessFactors、NetWeaver Gateway实体集发现与 v2/v4 分页接入ParquetIngestorApache Parquet 文件与分区数据集支持列选择ArrowIngestorApache Arrow IPC 与 Feather 文件处理XMLIngestorXXE 安全的 XML 解析可选 XSD schema 校验EmailIngestorIMAP/POP3 邮件接入支持附件提取OntologyIngestorOWL/RDF/Turtle 本体文件接入MCPIngestorModel Context ProtocolMCP资源接入ingest()统一调度器从路径或 URL 自动探测源类型并路由从源码结构看这些类中大部分采用懒加载导出见 semantica/ingest/init.pyWebIngestor、DBIngestor等只在被实际引用时才加载对应模块从而保证import semantica.ingest本身不引入任何重依赖。可选依赖与安装方式不同 Ingestor 依赖不同的第三方库且缺依赖时在调用时报ImportError而不是在导入时报错。这与 semantica/ingest/init.py 中定义的可选依赖提示一致。常见对应关系如下功能依赖安装命令Web / Feed / Email 接入beautifulsoup4pip install semantica[documents]XML 接入lxmlpip install semantica[documents]Parquet 接入pyarrowpip install semantica[ingest-parquet]Arrow / Feather 接入pyarrowpip install semantica[ingest-arrow]Git 仓库接入GitPythonpip install semantica[ingest-git]SAP OData 接入requestspip install semantica[ingest-sap]Salesforce 接入simple-salesforcepip install semantica[db-salesforce]这些 extra 定义可参见 pyproject.toml。此外SQL 数据库接入需要pip install sqlalchemy加对应的数据库驱动流接入分别需要kafka-python、pika、boto3、pulsar-client。快速上手三个典型场景场景一接入本地文件FileIngestor是本地文件的最快路径自动按扩展名识别格式、自动解压 ZIP/TAR 归档、把内容读入.content字节或.text文本属性from semantica.ingest import FileIngestor ingestor FileIngestor() # 单个文件 - FileObject file_obj ingestor.ingest_file(data/report.pdf) print(file_obj.name) # report.pdf print(file_obj.file_type) # pdf print(file_obj.text) # 解码后的文本内容FileObject 的属性 print(file_obj.size) # 字节数 # 目录扫描 - List[FileObject] files ingestor.ingest_directory(data/, recursiveTrue) for f in files: print(f.name, f.file_type, f.size)ingest()也会自动路由到文件或目录接入from semantica.ingest import ingest result ingest(data/report.pdf) # {files: [FileObject]}提示FileIngestor是本地文件的最快路径。它按扩展名自动识别格式、自动处理 ZIP/TAR 归档并将内容读入.content字节或.text文本属性。当你只需要文件元数据时使用read_contentFalse跳过内容读取。场景二连接数据库DBIngestor的构造函数不接收任何必填参数连接串直接传给各方法这是新手最容易踩的坑from semantica.ingest import DBIngestor ingestor DBIngestor() # 接入全部表或按 include_tables 过滤 result ingestor.ingest_database( postgresql://user:passlocalhost/db, include_tables[documents], ) # result[tables][documents][rows] 包含行字典 # 执行自定义查询参数化防注入 rows ingestor.execute_query( postgresql://user:passlocalhost/db, SELECT id, content, created_at FROM documents WHERE status :s, sactive, ) # 导出单表 - TableData table ingestor.export_table( postgresql://user:passlocalhost/db, table_namedocuments, limit1000, )警告DBIngestor()构造函数不接收连接串。连接串必须作为第一个位置参数传给ingest_database()、execute_query()或export_table()而不是传给DBIngestor()本身。从 semantica/ingest/methods.py 的实现可以看到ingest_database()会自动从连接串前缀探测数据库类型postgresql/mysql/sqlite/oracle/mssql并注册了对应的默认方法。场景三喂入抽取流水线接入只是第一步Semantica 的标准用法是把ingest作为 Pipeline 的首个步骤与解析、NER 抽取串联from semantica.ingest import FileIngestor from semantica.pipeline import PipelineBuilder, ExecutionEngine from semantica.parse import DocumentParser from semantica.semantic_extract import NERExtractor ingestor FileIngestor() parser DocumentParser() extractor NERExtractor(methodml) builder PipelineBuilder() builder.add_step(ingest, file_ingest, handleringestor.ingest_file) builder.add_step(parse, document_parse, handlerparser.parse) builder.add_step(extract, ner_extract, handlerextractor.extract) builder.connect_steps(ingest, parse) builder.connect_steps(parse, extract) pipeline builder.build(my_pipeline) result ExecutionEngine().execute_pipeline(pipeline, datadata/report.pdf)文件类接入File、Parquet、XMLFileIngestor扩展名自动识别支持格式包括PDF、DOCX、TXT、HTML、JSON、CSV、ExcelXLSX/XLS、PPTX、ZIP/TAR 归档。FileIngestor还提供了便捷的ingest()方法自动判断路径是文件还是目录from semantica.ingest import FileIngestor ingestor FileIngestor() # 单个文件 file_obj ingestor.ingest_file(data/report.pdf) # 目录返回 List[FileObject] files ingestor.ingest_directory(data/, recursiveTrue) # ingest() 自动分派到 ingest_file 或 ingest_directory files ingestor.ingest(data/)注意Glob 模式如data/**/*.docx不受支持。ingest()只接受文件路径或目录路径。要在目录内按扩展名过滤请使用ingest_directory()的pattern过滤参数。从源码看file_ingestor.py 中的FileTypeDetector采用多方法检测扩展名分析、MIME 类型检测、魔数文件签名分析三者结合支持的格式清单来自 semantica/utils/constants.py 中的SUPPORTED_DOCUMENT_FORMATS、SUPPORTED_IMAGE_FORMATS等常量。ParquetIngestor保留列类型的列式接入PyArrow 驱动的 Parquet 接入支持 Hive 风格分区数据集如year2024/month01/...from semantica.ingest import ParquetIngestor ingestor ParquetIngestor() # 单个 Parquet 文件 - ParquetData data ingestor.ingest_file(data/events.parquet) # 分区目录 data ingestor.ingest_directory(data/partitioned/) # 只加载指定列以 kwarg 传入 from semantica.ingest import ingest_parquet data ingest_parquet(data/events.parquet, columns[id, text, timestamp]) # 不加载数据只提取 schema schema ingest_parquet(data/events.parquet, methodschema)需要pyarrowpip install pyarrow或pip install semantica[ingest-parquet]。提示结构化分析数据请用ParquetIngestor而不是FileIngestor。Parquet 接入保留列类型int、float、datetime而 CSV 读取会丢失这些类型。使用columns[id, text]可避免加载无关列——对拥有数百列的超宽表尤为关键。在 parquet_ingestor.py 的ingest()签名中除了columns还支持limit行数采样上限与filtersPyArrow 过滤表达式并且当source是目录时自动切换到ingest_directory。返回的ParquetData包含data、row_count、columns、schema、source、metadata等字段。XMLIngestorXXE 安全与 XSD 校验基于 lxml 的接入默认禁用外部实体解析resolve_entitiesFalse并配合no_networkTrue禁止网络访问见 xml_ingestor.py 与 xml_ingestor.pyfrom semantica.ingest import XMLIngestor # 基本接入 ingestor XMLIngestor() data ingestor.ingest_file(data/records.xml) # 带 XSD 校验以 kwarg 传入 schema_path from semantica.ingest import ingest_xml data ingest_xml(data/records.xml, schema_pathschema.xsd) # 只输出校验报告 report ingest_xml(data/feed.xml, methodvalidate, schema_pathschema.xsd) # 目录扫描 results ingestor.ingest_directory(data/records/)警告XMLIngestor默认即 XXE 安全。不要用标准库xml.etree.ElementTree预先解析 XML 再传给 Semantica——它不阻断 XXE 攻击。XMLIngestor使用resolve_entitiesFalse的 lxml 安全解析不可信 XML。从源码看返回的XMLIngestionData包含root嵌套字典树、elements扁平元素列表、namespaces、root_tag、validation、metadata等结构化字段ingest_file()还支持validate_dtd、recover恢复畸形 XML、include_comments等选项见 xml_ingestor.py。Web 与订阅类接入Web、Public API、Feed、Repo、EmailWebIngestor限速 robots.txt 合规的爬虫from semantica.ingest import WebIngestor ingestor WebIngestor( delay1.0, # 请求间隔秒数 respect_robotsTrue, # 遵守 robots.txt timeout30, ) # 单 URL - WebContent content ingestor.ingest_url(https://example.com/about) print(content.title) print(content.text) print(content.links) # Sitemap 爬取 - List[WebContent] pages ingestor.crawl_sitemap(https://example.com/sitemap.xml) # 域名爬取 - List[WebContent] pages ingestor.crawl_domain(https://example.com, max_pages50)需要beautifulsoup4pip install beautifulsoup4或pip install semantica[documents]。提示爬虫务必限速。WebIngestor(delay1.0, respect_robotsTrue)是负责任的默认配置。不限速可能被目标服务器封禁或违反其服务条款。源码层面的支撑RateLimiter强制请求间最小间隔web_ingestor.pyRobotsChecker基于urllib.robotparser.RobotFileParser按域名缓存 robots.txt 判定web_ingestor.pyHTTP 层则通过 ssrf.py 的request_with_ssrf_guard做 SSRF 防护。WebContent包含url、title、text、html、metadata、links、status_code等字段。PublicAPIIngestor免认证公共 API适用于无需 key 或 token 的公共 REST 风格 API。它默认拒绝常见的认证头与查询参数需要认证的 API 请改用RESTIngestorfrom semantica.ingest import PublicAPIIngestor, PublicAPIExamples, ingest_public_api ingestor PublicAPIIngestor(rate_limit_delay1.0) # 接入任意公共端点 data ingestor.ingest_public_api(https://jsonplaceholder.typicode.com/posts) # 使用预配置示例按名称 data ingestor.ingest_example(rest_countries_all) # 检测端点是否免认证可访问 detection ingestor.detect_public_api(https://jsonplaceholder.typicode.com/posts) # 列出可用预配置示例 examples PublicAPIExamples.list_examples() # 便捷函数 data ingest_public_api(https://jsonplaceholder.typicode.com/posts)从 methods.py 看ingest_public_api支持endpoint、example、detect、batch、examples五种 method并支持传http_method覆盖 HTTP 方法method一词已被调度占用。FeedIngestorRSS/Atom 订阅from semantica.ingest import FeedIngestor ingestor FeedIngestor() # 接入订阅 - FeedData feed ingestor.ingest_feed(https://feeds.example.com/rss) # 从网站发现订阅源 from semantica.ingest import ingest_feed feeds ingest_feed(https://example.com, methoddiscover)需要beautifulsoup4。FeedIngestor还导出FeedMonitor用于轮询式订阅更新监控。RepoIngestorGit 仓库接入接入源码文件、提交历史与依赖图谱from semantica.ingest import RepoIngestor ingestor RepoIngestor( branchmain, file_types[.py, .md, .yaml], include_commitsTrue, commit_rangeHEAD~100..HEAD, ) result ingestor.ingest_repository(https://github.com/org/repo) result ingestor.ingest_repository(/path/to/local/repo)需要GitPythonpip install gitpython或pip install semantica[ingest-git]。从 methods.py 看ingest_repository还能识别 SCP 风格 SSH 远程userhost:path并支持clone、analyze等 method。EmailIngestorIMAP/POP3 邮件支持附件提取与线程分析from semantica.ingest import EmailIngestor import os ingestor EmailIngestor( protocolimap, hostimap.gmail.com, port993, use_sslTrue, usernameos.getenv(EMAIL_USER), passwordos.getenv(EMAIL_PASS), folderINBOX, attachment_types[.pdf, .docx, .txt], include_thread_analysisTrue, max_emails500, ) emails ingestor.ingest()需要beautifulsoup4。邮件正文的 HTML 解析、Message-ID/In-Reply-To头驱动的会话线程分析均由该模块完成。云存储接入CloudStorageIngestor统一客户端覆盖 AWS S3、Google Cloud Storage、Azure Blob Storagefrom semantica.ingest import CloudStorageIngestor import os # AWS S3列对象并下载 ingestor CloudStorageIngestor( providers3, access_key_idos.getenv(AWS_ACCESS_KEY_ID), secret_access_keyos.getenv(AWS_SECRET_ACCESS_KEY), regionus-east-1, ) objects ingestor.list_objects(my-documents-bucket, prefixreports/2024/) content ingestor.download_object(my-documents-bucket, reports/2024/report.pdf) # FileIngestor.ingest_cloud() 封装了 CloudStorageIngestor from semantica.ingest import FileIngestor files FileIngestor().ingest_cloud( providers3, bucketmy-documents-bucket, prefixreports/2024/, access_key_idos.getenv(AWS_ACCESS_KEY_ID), secret_access_keyos.getenv(AWS_SECRET_ACCESS_KEY), regionus-east-1, )通过指定provider参数s3、gcs、azure即可切换云厂商对象列表与下载结果可直接喂给FileIngestor的解析链路。数据库类接入SQL、Snowflake、DatabricksDBIngestorSQL已在快速上手展示核心用法此处补充其能力边界ingest_database()返回result[schema]、result[tables]、result[total_tables]三个键execute_query()返回List[Dict]export_table()返回TableData并支持limit。需要sqlalchemy加对应数据库驱动底层通过 SQLAlchemy 统一抽象了 PostgreSQL、MySQL、SQLite、Oracle、SQL Server。SnowflakeIngestorfrom semantica.ingest import SnowflakeIngestor import os ingestor SnowflakeIngestor( accountos.getenv(SNOWFLAKE_ACCOUNT), useros.getenv(SNOWFLAKE_USER), passwordos.getenv(SNOWFLAKE_PASSWORD), warehouseCOMPUTE_WH, databaseANALYTICS, schemaPUBLIC, ) result ingestor.ingest_query(SELECT * FROM documents) result ingestor.ingest_table(documents)完整的 Snowflake 配置与认证细节可参考 Snowflake 集成指南。DatabricksIngestorfrom semantica.ingest import DatabricksIngestor import os ingestor DatabricksIngestor( hostos.getenv(DATABRICKS_HOST), tokenos.getenv(DATABRICKS_TOKEN), http_pathos.getenv(DATABRICKS_HTTP_PATH), catalogmain, schemadefault, ) result ingestor.ingest_query(SELECT * FROM documents) result ingestor.ingest_table(documents) lineage ingestor.get_table_lineage(documents)get_table_lineage()直接对接 Unity Catalog 血缘信息可将上游表依赖一并纳入知识图谱。更多 Unity Catalog 配置见 Databricks 集成指南。流式接入StreamIngestor面向 Kafka、RabbitMQ、AWS Kinesis、Apache Pulsar 的实时接入。每个方法返回类型化的处理器Processor统一提供消息处理、批量启停与健康检查from semantica.ingest import StreamIngestor ingestor StreamIngestor() # Kafka - KafkaProcessor processor ingestor.ingest_kafka( topicdocuments, bootstrap_servers[localhost:9092], ) processor.set_message_handler(lambda msg: print(msg)) processor.start_consuming() # RabbitMQ - RabbitMQProcessor processor ingestor.ingest_rabbitmq( queuedocument_queue, connection_urlamqp://guest:guestlocalhost/, ) # AWS Kinesis - KinesisProcessor processor ingestor.ingest_kinesis( stream_namedocuments-stream, regionus-east-1, ) # Apache Pulsar - PulsarProcessor processor ingestor.ingest_pulsar( topicpersistent://public/default/documents, service_urlpulsar://localhost:6650, ) # 一次性启动/停止全部处理器 ingestor.start_streaming() ingestor.stop_streaming() # 监控流健康 health ingestor.monitor.check_health()警告StreamIngestor的各方法要求目标 broker 的客户端库已安装——ingest_kafka需要kafka-python、ingest_rabbitmq需要pika、ingest_kinesis需要boto3、ingest_pulsar需要pulsar-client。缺失依赖会在调用时抛出ImportError而不是导入时。底层 stream_ingestor.py 的StreamProcessor基类提供消息转换transform、校验validate、错误处理与统计跟踪并内置StreamMessage数据结构content、metadata、partition、offset等各 broker 处理器通过子类实现各自的_consume_loop()。ingest()统一调度器自动探测源类型ingest()从路径或 URL 自动探测源类型并路由到对应 Ingestor返回Dict[str, Any]顶层键随源类型变化from semantica.ingest import ingest # 文件 result ingest(report.pdf) # {files: [FileObject]} result ingest(data/, source_typefile) # {files: [FileObject, ...]} # Web result ingest(https://example.com) # {content: WebContent} # Feed按 URL 模式自动探测 result ingest(https://example.com/feed.xml) # {feeds: FeedData} # Parquet按 .parquet 扩展名自动探测 result ingest(events.parquet) # {data: ParquetData} # XML按 .xml 扩展名自动探测 result ingest(records.xml) # {xml: XMLIngestionData} # Ontology按 .ttl/.owl/.rdf 自动探测 result ingest(ontology.ttl) # {ontology: OntologyData} # Database按连接串前缀自动探测 result ingest(postgresql://user:passlocalhost/db) # {data: ...} # 公共 API显式指定 source_type result ingest( https://jsonplaceholder.typicode.com/posts, source_typepublic_api, ) # {data: APIData}ingest()参数参数类型默认值说明sourcesstr、Path或List必填文件路径、URL、目录或连接串source_typestrNone自动探测file、web、public_api、feed、stream、repo、email、db、parquet、xml、ontology、mcp等methodstrNone传给底层 Ingestor 的方法覆盖**kwargs转发给底层 Ingestor 方法的额外选项自动探测的判定顺序源码级从 methods.py 的ingest()实现可以精确还原自动探测逻辑URL 前缀http:///https://若含.xml、/feed、/rss、/atom则判定为feed否则为web连接串前缀postgresql://、mysql://、sqlite://、oracle://、mssql://判定为dbSCP 风格远程或 GitHub/GitLab 域名判定为repo扩展名.ttl/.owl/.rdf/.jsonld/.n3/.nt→ontology.parquet/.pq→parquet.arrow/.feather/.ipc→arrow.xml→xml兜底其余一切视为file。列表类型的sources也支持批量判定如全为.parquet的列表自动路由到 Parquet 接入。各 source_type 对应的返回键及可选 method 的完整注册表见 methods.py。FileObject 字段详解FileIngestor返回FileObject实例其完整 schema 如下与 file_ingestor.py 的 dataclass 定义一致from dataclasses import dataclass from datetime import datetime from typing import Any, Dict, Optional dataclass class FileObject: path: str # 绝对文件路径 name: str # 文件名如 report.pdf size: int # 字节大小 file_type: str # 检测出的类型不含点号如 pdf、docx mime_type: Optional[str] # MIME 类型若可检测 content: Optional[bytes] # 原始字节read_contentFalse 时为 None metadata: Dict[str, Any] # 扩展名、父目录、is_supported 等 ingested_at: datetime # 接入时间戳 property def text(self) - str: 从 content 字节解码文本UTF-8latin-1 兜底。 ...取文本用.text属性取原始字节用.contentfile_obj FileIngestor().ingest_file(report.pdf) text file_obj.text # 解码后的字符串 raw file_obj.content # 原始字节.text属性的实现细节优先按 UTF-8 解码失败则回退到 latin-1保证任意字节序列都有可读结果。目录扫描时跳过内容读取可显著降低内存占用files FileIngestor().ingest_directory(data/, recursiveTrue, read_contentFalse)OntologyIngestor本体文件接入将已有 OWL 或 RDF 本体文件作为结构化知识源接入from semantica.ingest import OntologyIngestor ingestor OntologyIngestor() data ingestor.ingest_ontology(domain_ontology.owl, formatturtle) # 或使用便捷函数 from semantica.ingest import ingest_ontology data ingest_ontology(domain_ontology.ttl)接入后的OntologyData可直接交给 semantica/ontology/ 模块做引擎加载与校验配合仓库内示例本体 cookbook/introduction/corporate_ontology.ttl 可快速验证流程。自定义 Ingestor注册你自己的格式method_registry提供了完整的扩展点。注册一个自定义接入函数后即可通过统一的便捷函数调用from semantica.ingest.registry import method_registry from semantica.ingest import FileObject def my_ingestor(source, **kwargs): # 返回你的格式产生的任意对象 return FileObject( pathsource, namesource, size0, file_typecustom, contentb..., metadata{}, ) method_registry.register(file, my_format, my_ingestor) # 现在可以通过便捷函数调用 from semantica.ingest import ingest_file result ingest_file(source_path, methodmy_format)从 registry.py 看MethodRegistry是一个按任务类型file、web、feed、stream、repo、email、db、public_api、parquet、xml、mcp、salesforce等组织的注册表提供register、get、list_all、unregister、clear五个类方法。各便捷函数在调用前都会先查自定义方法见 methods.py 的ingest_file示例并支持fallback_on_custom_error选项在自定义方法出错时回退到内置实现。全局配置与环境变量IngestConfig支持从环境变量、配置文件YAML/JSON/TOML与 Python API 三种来源配置接入行为见 config.py。常用的INGEST_前缀环境变量包括环境变量配置项类型说明INGEST_DEFAULT_SOURCE_TYPEdefault_source_typestr默认源类型INGEST_MAX_FILE_SIZEmax_file_sizeint最大文件大小INGEST_RECURSIVErecursivebool目录扫描是否递归INGEST_READ_CONTENTread_contentbool是否读取文件内容INGEST_RATE_LIMIT_DELAYrate_limit_delayfloat请求限速间隔秒INGEST_RESPECT_ROBOTSrespect_robotsbool是否遵守 robots.txtINGEST_BATCH_SIZEbatch_sizeint批处理大小INGEST_TIMEOUTtimeoutfloat请求超时秒MCP_SERVER_URLmcp_server_urlstrMCP 服务器 URL仅 Python/FastMCPMCP_SERVER_TIMEOUTmcp_server_timeoutfloatMCP 服务器超时测试验证与关联阅读仓库的 tests/ingest/ 目录覆盖了 FileIngestor、各 Ingestor 分派、可选依赖缺失提示test_optional_imports.py、Notebook 集成等场景tests/test_security_regression.py 则包含 XXE 防护相关的回归测试。调试时可用list_available_methods()查看当前注册的全部接入方法from semantica.ingest import list_available_methods all_methods list_available_methods()继续深入可参考以下文档Parse 模块 — 将原始接入源解析为结构化文本与表格Pipeline 模块 — 将 ingest 编排为流水线首个步骤Snowflake 集成 — Snowflake 专属配置与认证指南Databricks 集成 — Databricks Unity Catalog 配置、认证与血缘指南Provenance 模块 — 从接入到推理的完整血缘追踪小结semantica.ingest的价值在于统一入口 类型化返回 可扩展注册表三层设计ingest()让调用方无需关心源类型判断各 Ingestor 返回语义明确的对象直接对接下游parse与semantic_extractMethodRegistry让团队可以低成本接入自有格式。接入时只需记住三条原则本地文件走FileIngestor、结构化列式数据走ParquetIngestor、不可信 XML 务必走 XXE 安全的XMLIngestor——其余源类型交给统一调度器即可。【免费下载链接】semanticaGraph-Native Infrastructure for Context and Accountable AI Systems项目地址: https://gitcode.com/GitHub_Trending/sema/semantica创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考