JSON 格式的 OWLClass 表示

OWLClass representation in JSON format

我知道可以将整个 ontology 保存在 JSON 中,是否可以将单个 OWLClass 转换为 JSON? 类似于:

OWLClass cl = ...;
JSONObject obj = cl.toJSON();
Thanks!

在 OWLAPI 中没有现成的方法来执行此操作,但是 OWLClass 仅由 IRI 组成,其唯一数据是字符串。因此,将单个对象序列化为字符串加上类型规范并进行相应的反序列化非常简单。

JSON 的自定义序列化介绍可用 here