什么是适合 .net 的优秀 RDF 库?

发布于 2024-07-07 14:46:22 字数 1557 浏览 8 评论 0原文

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

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

发布评论

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

评论(5

一梦浮鱼 2024-07-14 14:46:22

ROWLEX 实际上非常酷(使用 SemWeb 内部)。 它不仅仅是一个浏览器应用程序,而是一个用 C# 编写的 SDK。 如果您使用 ROWLEX,则不再直接与 RDF 的三元组交互(尽管可以),而是提供面向对象的外观和感觉。 主要有两种使用场景:

  1. 业务类优先:您拥有 .NET 业务类。 您可以像使用 XML 序列化属性一样以声明方式向类添加属性。 此后,ROWLEX 可以提取与您的业务类相对应的本体和/或可以将您的业务对象序列化为 RDF。
  2. 本体优先:您拥有本体,ROWLEX 生成 .NET 类您可以使用它来构建/浏览 RDF 文档。 很棒的是,这些自动生成的类比代码生成器的典型结果要好得多。 它们通过提供隐式和显式转换运算符来覆盖整个继承图,可以轻松使用和模仿 OWL 的多重继承功能。

典型的用法是本体优先方法。 例如,假设您的本体描述了以下多重继承场景:

汽车是车辆的子类

汽车是公司资产的子类

使用 ROWLEX,您将获得 Car、Vehicle 和 CompanyAsset 的 .NET 类。 以下 C# 代码将毫无问题地进行编译:

    RdfDocument rdfDoc = new RdfDocument();
    Car car = new Car("myCarUri", rdfDoc);
    Vehicle vehicle = car; // implicit casting
    CompanyAsset companyAsset = car; // implicit casting 
    vehicle.WheelCount = 4;
    companyAsset.MonetaryValue = 15000;
    Console.WriteLine(rdfDoc.ToN3());

这将打印:

myCarUri typeOf Car 
myCarUri WheelCount 4 
myCarUri MonetaryValue 15000

The "car" 业务对象在 RdfDocument 内表示为三元组。 自动生成的 C#/VB 类表现为视图。 您可以在同一个业务对象上拥有多个 C# 视图(每个视图的类型完全不同)。 当您与这些视图交互时,您实际上修改了 RdfDocument。

ROWLEX is actually very cool (uses SemWeb internally). It is not just a browser app but rather an SDK written in C#. If you use ROWLEX, you do not directly interact with the tripples of RDF anymore (though you can), but gives an object oriented look&feel. There are two main usage scenarios:

  1. Business class first: You have your .NET business classes. You declaratively add attributes to your classes similarly as you do with XML serialization attributes. After this, ROWLEX can extract the ontology corresponding your business classes and/or can serialize your business objects into RDF.
  2. Ontology first: You have your ontology(s) and ROWLEX generates .NET classes for you that you can use to build/browse RDF documents. The great thing is that these autogenerated classes are far better then the typical results of codegenerators. They are comfortable to use and mimic the multiple inheritence feature of OWL by providing implicit and explicit cast operators to cover the entire inheritence graph.

The typical usage is the Ontology first approach. For example, let us say that your ontology describes the following multiple inheritence scenario:

Car isSubClassOf Vehicle

Car isSubClassOf CompanyAsset

Using ROWLEX, you will get .NET classes for Car, Vehicle, and CompanyAsset. The following C# code will compile without any problem:

    RdfDocument rdfDoc = new RdfDocument();
    Car car = new Car("myCarUri", rdfDoc);
    Vehicle vehicle = car; // implicit casting
    CompanyAsset companyAsset = car; // implicit casting 
    vehicle.WheelCount = 4;
    companyAsset.MonetaryValue = 15000;
    Console.WriteLine(rdfDoc.ToN3());

This would print:

myCarUri typeOf Car 
myCarUri WheelCount 4 
myCarUri MonetaryValue 15000

The "car" business object is represented inside the RdfDocument as triples. The autogenerated C#/VB classes behave as a views. You can have several C# views - each of a completely different type - on the same business object. When you interact with these views, you actually modifying the RdfDocument.

笔芯 2024-07-14 14:46:22

BrightstarDB 是一个原生的 .NET NoSQL RDF 三重存储,支持 SPARQL,是一个支持 LINQ 和 OData 的 .NET 实体框架。 它对开发人员和开源项目免费,并且商业用途的运行时成本很小。

BrightstarDB 提供三个级别的 API。

  1. SPARQL 查询和简单事务 API。
  2. 将三元组集合分组为数据对象的通用对象 API
  3. Visual Studio 集成采用接口定义并生成强类型 .NET 域模型,该模型将其数据作为 RDF 存储在 BrightstarDB 实例中。 .NET 模型具有 LINQ 支持,也可以作为 OData 服务公开。

所有 BrightstarDB 文档均在线提供,并且无需注册即可从 http://www.brightstardb.com 下载该软件

BrightstarDB is a native, .NET NoSQL RDF triple store, with SPARQL support, a .NET entity framework with LINQ and OData support. It is free for developers and open source projects and has a small runtime cost for commercial use.

BrightstarDB provide three levels of API.

  1. SPARQL query and simple transaction API.
  2. A generic object api that groups collections of triples into data objects
  3. A Visual Studio integration that takes Interface definitions and generated a strongly typed .NET domain model that stores its data as RDF in a BrightstarDB instance. The .NET model has LINQ support and can also be exposed as an OData service.

All BrightstarDB documentation is online and the software is available for download with no registration at http://www.brightstardb.com

梦一生花开无言 2024-07-14 14:46:22

我制作了一个开源库 dotNetRDF - OWL 支持目前有些有限,但可能不适合您的使用

I produce an open source library dotNetRDF - OWL support is currently somewhat limited though so may not be ideal for your uses

病毒体 2024-07-14 14:46:22

几个月前我对此进行了一些研究。 比较有趣的之一
我能找到的项目是:
http://www.hookedonlinq.com/linqtordf.ashx

I researched this just a bit several months ago. One of the more interesting
projects I could find is:
http://www.hookedonlinq.com/linqtordf.ashx

饮湿 2024-07-14 14:46:22

在 Codeplex 尝试 RDFSharp。 看起来年轻但很有前途。

Try RDFSharp at Codeplex. Seems young but promising.

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