我在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; }
}发布于 2009-08-01 12:07:19
ROWLEX最初是为了支持.NET1.1而构建的,因此不支持在.NET2.0中引入的可以为空的类型。然而,ROWLEX现在是开源的,因此欢迎贡献。实际上,Nullable support的实现看起来并不是很昂贵。
EDIT: 2.1已经发布,现在完全支持可以为空的类型。
顺便说一句,问题中的示例代码不能与属性"intellegience“一起使用,因为GUID不是支持的XSD值类型。我假设Details属性应该被装饰为RdfProperty,而'intellegience‘(如果暴露为一个字符串)应该是ResourceUri。
https://stackoverflow.com/questions/1202943
复制相似问题