[英]OWL API renamed entity from imported ontology
I have the ontology A which is imported in B. I would like to rename an entity, so I write: 我有在B中导入的本体A。我想重命名一个实体,所以我这样写:
OWLEntityRenamer renamer = new OWLEntityRenamer(manager, Collections.singleton(A));
Map<OWLEntity, IRI> entity2IRIMap = new HashMap<>();
entity2IRIMap.put(datafactory.getOWLNamedIndividual(iriBase+"Skyfos"), IRI.create(iriBase+"Skyphos"));
manager.applyChanges(renamer.changeIRI(entity2IRIMap));
manager.save(A);
manager.save(B);
Now, the entity is correctly renamed in A, but in BI have both the entities. 现在,该实体已在A中正确重命名,但在BI中同时拥有两个实体。 In particular in B, each object-property that uses "Skyfos" continues to use "Skyfos" instead of "Skyphos".
特别是在B中,每个使用“ Skyfos”的对象属性都继续使用“ Skyfos”而不是“ Skyphos”。 Thank you.
谢谢。
这里的问题是OWLEntityRenamer需要修改所有本体。
You have passed only ontology A to the renamer. 您仅将本体A传递给重命名器。 If B already uses the old IRI, it won't be changed.
如果B已经使用旧的IRI,则不会更改。 Pass both ontologies to the renamer and try again.
将两种本体都传递给重命名器,然后重试。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.