如何反序列化 OWL 文档?
我使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我有一个非常简单且令人失望的答案:未实现反序列化。
背后的理由:
.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?