A new knowledge base can start from a real vocabulary instead of ten seeds - #102
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
实现 0008 的后端部分。建库时可以多选起点本体,
POST /workspaces/{id}/kbs收ontology_packs: ["schema-org", "w3c-org"],GET /ontology-packs给界面用的清单。文件内嵌进二进制,不在运行时下载——README 承诺整套系统可以跑在完全离线的内网环境。原文 gzip 存放,1.7 MB 压到 316 KB;
flate2本来就在依赖树里。来源、许可、抓取日记在crates/utopia-server/packs/README.md。撞名分两类处置。 现有逻辑已经解决了第一个包:占位者没有 IRI 就认领它,所以
schema:Organization会接管内置的organization。第二个包撞上已有 IRI 时走KeyTaken被跳过——对同义词是对的,对同名不同义是错的(W3C Org 的Role是职位,schema.org 的是演员饰演的角色,丢掉后者等于丢掉 Org 存在的理由)。新增
pack_alignment表声明这两类,并加了Disposition::Aligned:同义词跳过但不报成冲突——那不需要人裁,少建一个重复的类正是想要的结果。Aligned 还要把 IRI 指向已有那个类的 id,否则以它为父类的子类会解析不到。对齐表用的是声明而非猜出来的后缀,所以
owl_import那条"不自动加后缀,否则重导入认不出自己上次建的是哪个"的理由对它不适用。顺带修了一个既有 bug:解析器不给 base IRI,导致任何含相对 IRI 的本体文件在第一个
<#>上全军覆没。PROV-O 第 1345 行就是(<#> a owl:Ontology),手动导入一样会失败,只是没人试过。against_real_packs那个测试拿真包跑投影逐条核对齐表,它抓到了那个 bug,还有三处我凭印象写错的 IRI(schema:Role是大写、prov:contributed投影不产出、FOAF 没有image只有img/Image/depiction)。上游改前缀时它会先炸,而不是让对齐表静默失效。前端建库表单还没做。