C# .net 的好的 RDF 库是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/240903/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is a good RDF library for .net?
提问by kitsune
采纳答案by Mr. Lame
ROWLEXis actually very cool (uses SemWebinternally). 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:
ROWLEX实际上非常酷(内部使用SemWeb)。它不仅仅是一个浏览器应用程序,而是一个用 C# 编写的 SDK。如果您使用 ROWLEX,您不再直接与 RDF 的三元组交互(尽管您可以),而是提供面向对象的外观和感觉。主要有两种使用场景:
- 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.
- Ontology first:You have your ontology(s) and ROWLEXgenerates .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.
- 商务课程优先:您拥有 .NET 商务课程。您可以像使用 XML 序列化属性一样以声明方式向类添加属性。在此之后,ROWLEX 可以提取对应于您的业务类的本体和/或可以将您的业务对象序列化为 RDF。
- 本体优先:您拥有本体,ROWLEX 会为您生成 .NET 类,您可以使用这些类来构建/浏览 RDF 文档。很棒的是,这些自动生成的类比代码生成器的典型结果要好得多。通过提供隐式和显式转换运算符来覆盖整个继承图,他们可以轻松地使用和模仿 OWL 的多重继承特性。
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:
使用 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());
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.
“汽车”业务对象在 RdfDocument 中表示为三元组。自动生成的 C#/VB 类表现为视图。您可以在同一个业务对象上拥有多个 C# 视图——每个视图的类型都完全不同。当您与这些视图交互时,您实际上是在修改 RdfDocument。
回答by IAdapter
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
几个月前我刚刚研究了这个。我能找到的更有趣的项目之一是:http: //www.hookedonlinq.com/linqtordf.ashx
回答by RobV
回答by Graham Moore
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 是一个原生的 .NET NoSQL RDF 三元组存储,支持 SPARQL,一个支持 LINQ 和 OData 的 .NET 实体框架。它对开发人员和开源项目是免费的,商业用途的运行成本很小。
BrightstarDB provide three levels of API.
BrightstarDB 提供三个级别的 API。
- SPARQL query and simple transaction API.
- A generic object api that groups collections of triples into data objects
- 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.
- SPARQL 查询和简单的事务 API。
- 将三元组集合分组为数据对象的通用对象 API
- Visual Studio 集成采用接口定义并生成强类型 .NET 域模型,将其数据作为 RDF 存储在 BrightstarDB 实例中。.NET 模型具有 LINQ 支持,也可以作为 OData 服务公开。
All BrightstarDB documentation is online and the software is available for download with no registration at http://www.brightstardb.com
所有 BrightstarDB 文档都在线,该软件无需注册即可在http://www.brightstardb.com 上下载