ROWLEX 和 OntologyExtractor
我有一个简单的 C# 业务类,想要创建一个 RDF 文档。 我指定的大多数数据类型都可以使用 OntologyExtractor 来创建 owl 模式。 我将如何处理 DataTime? (可为空)和 System.Guid 数据类型 例如
[RdfSerializable(Ontology = "http://ceoc/", HasResourceUri = true)]
public abstract class IIncident
{
[ResourceUri]
public abstract string Details { get; set; }
[RdfProperty(true)]
public abstract DateTime? log { get; set; }
[RdfProperty(true)]
public abstract Guid intellegience { get; set; }
}
I have simple bussiness class in c# and want to create a RDF document. Most of the datatype that i specify I can get OntologyExtractor to create owl schema. How would I handle DataTime? (nullable) and System.Guid datatypes
e.g.
[RdfSerializable(Ontology = "http://ceoc/", HasResourceUri = true)]
public abstract class IIncident
{
[ResourceUri]
public abstract string Details { get; set; }
[RdfProperty(true)]
public abstract DateTime? log { get; set; }
[RdfProperty(true)]
public abstract Guid intellegience { get; set; }
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ROWLEX 最初是为了支持 .NET1.1 而构建的,因此不支持 .NET2.0 中引入的 Nullable 类型。 不过,ROWLEX 现在是开源的,因此欢迎贡献。 实际上,Nullable 支持的实现看起来并不昂贵。
编辑:ROWLEX 2.1 已发布,现在完全支持 Nullable 类型。
顺便说一句,问题中的示例代码不适用于属性“intellegience”,因为 GUID 不是受支持的 XSD 值类型。 我假设 Details 属性旨在装饰为 RdfProperty,而“intellegience”(如果作为字符串公开)应该是 ResourceUri。
ROWLEX was originally built to support .NET1.1 therefore Nullable types that are introduced in .NET2.0 are not supported. However, ROWLEX is open source now, therefore contributions are welcome. Actually the implementation of Nullable support does not look very expensive.
EDIT: ROWLEX 2.1 has been released and it fully supports Nullable types now.
BTW, the example code in the question will not work with the property "intellegience" because GUID is not a supported XSD value type. I assume that the Details prop was intended to be decorated as RdfProperty, while 'intellegience' (if exposed as a string) should be the ResourceUri.