如何反序列化 OWL 文档?

发布于 2024-08-02 04:39:41 字数 502 浏览 10 评论 0原文

我使用 ROWLEX 创建了一堆类,并使用 Now i would like to deserialize it (类似于 XmlSerializer.Deserialize() 的工作方式)将它们序列化为 RDF

RdfDocument rdfDocument = Rdfizer.Serialize(ontology);

对象中

(类似于 XmlSerializer.Deserialize() 的工作方式),以便我可以将本体中的数据填充到我想要的 做这样的事情:

RdfSerializer serializer = new RdfSeriailzer(typeof(MyOntology));
  MyOntology ontology = (MyOntology)serializer.Deserize(fileStream);

谁能告诉我如何使用 ROWLEX 将 OWL 文档反序列化回我的对象​​?

谢谢

I created a bunch of classes using ROWLEX and had them serialized to RDF using

RdfDocument rdfDocument = Rdfizer.Serialize(ontology);

Now i would like to deserialize it (similar to how XmlSerializer.Deserialize() works) so that I could have the data in the ontology populated in my object

I would like to do something like this:

RdfSerializer serializer = new RdfSeriailzer(typeof(MyOntology));
  MyOntology ontology = (MyOntology)serializer.Deserize(fileStream);

Could anyone please tell me how I can deserialize an OWL document back to my object using ROWLEX?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

莫相离 2024-08-09 04:39:41

我有一个非常简单且令人失望的答案:未实现反序列化。

背后的理由:
.NET 是一个非常严格和正式的环境,而 RDF 则不是。以通用方式转换数据仅朝着限制较少的方向可行。仅当您自己掌握这两项活动时,全周期序列化/反序列化才能可靠地工作。如果一家公司实现序列化,将 RDF 发送给另一家实现反序列化的公司,那么您就不能期望太多。不同类型的系统有不同的业务逻辑,完美的1:1映射在理论上也是不可能的。构建一个高度容错的反序列化是可能的,但您无法保证反序列化的 .NET 对象将具有与原始 RDF 文档相同的含义。因为 RDF 文档中的个人可能因 RDF 的本质而存在偏见。

我能想到的唯一合理的理由是,如果您使用 ROWLEX 作为数据存储层,将对象保存到 RDF 或从 RDF 检索对象。但是还有很多其他方法可以存储持久/检索对象。你真的需要这个吗?

I have a very simple and disappointing answer: deserialization is not implemented.

Rational behind:
.NET is a very strict and formal environment while RDF is not. Converting data in a generic manner is only feasible towards the less restrictive direction. Full cycle serialization/deserialization could work reliably only if you are holding both activities in your own hand. If one company implements serialization, sends the RDF over to another company that implements the deserialization, you cannot expect too much. Different kinds of systems have different business logic and perfect 1:1 mapping is not even theoretically possible. It would be possible to build a very fault-tolerant deserialization, but you would get no guarantee that the deserialized .NET objects would carry the same meaning as the original RDF document. Because individuals in RDF documents can be partial by the very nature of RDF.

The only justified reason I can think of where guaranteed serialization/deserialization could work (correct me if I am wrong), if you would use ROWLEX as data storage layer, persisting/retrieving your objects to/from RDF. But there are so many other alternatives to store persist/retrieve your objects. Would you really need this?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文