SemWeb库RDF解析器C# [英] SemWeb Library RDF parser for c#

查看:283
本文介绍了SemWeb库RDF解析器C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我试图使用 RDF 库的C#名为<一个HREF =http://razor.occams.info/code/semweb/相对=nofollow> SemWeb
,但我不beeing能看懂我的RDF文件,至极为570 MB大,因为我似乎无法实现任何他们给出的例子和文档是有点差。

Hi I'm trying to use a RDF library for c# called SemWeb but i'm not beeing able to read my rdf file, wich is 570 MB large because i can't seem to implement any of the examples they give and the documentation is a little poor.

有没有人使用这个库或其他解析RDF文件?

Does anyone use this library or another to parse RDF files?

我需要迫切,因为我这样做,需要一个解析器RDF一所大学工作。

I need it urgently since i'm doing an university job that requires a parser to RDF.

谢谢

推荐答案

要使用SemWeb是很简单的读取文件,只是使用类似以下内容:

To read a file using SemWeb is very simple, just use something like the following:

MemoryStore mem = new MemoryStore();
mem.Import(new N3Reader("file.ttl"));

//Iterate over and print statements
foreach (Statement stmt in mem)
{
    Console.WriteLine(stmt.ToString());
}

如果您的文件RDF / XML,那么你会使用RdfXmlReader类代替

If your file is RDF/XML then you'd use the RdfXmlReader class instead.

另外,你可以用我的图书馆 dotNetRDF 阅读您的文件:

Alternatively you could use my library dotNetRDF to read your file:

Graph g = new Graph();
FileLoader.Load(g, "file.ttl");

//Iterate over and print Triples
foreach (Triple t in g.Triples)
{
    Console.WriteLine(t.ToString());
}



唯一的问题是,如果你的文件是RDF / XML在我的图书馆解析器目前不会处理该大小的文件。如果您的文件NTriples /乌龟/ N3,那么你应该不会有问题,但可能需要等待几分钟(例如为柏林SPARQL基准的〜90MB百万三重数据集,大约需要4分钟解析,但某种程度上取决于你的机器上)

Only problem is that if your file is RDF/XML the parser in my library won't handle files of that size currently. If your file is NTriples/Turtle/N3 then you shouldn't have an issue but be prepared to wait for a couple of minutes (for example an ~90MB 1 million triple dataset for the Berlin SPARQL Benchmark takes ~4 minutes to parse but is somewhat dependant on your machine)

这实际上可能是一般的问题,我不知道如何SemWeb的RDF / XML解析器实现的,因此它可能也有类似的问题我自己有非常大的文件。

This may actually be an issue in general, I'm not sure how the RDF/XML parser in SemWeb is implemented so it may have similar issues to my own with very large files.

注意

这是否是阅读您的文件,最好的办法可能取决于你再打算与解析后的数据做。有可能是更有效的方式来读取/过程的两个SemWeb和dotNetRDF取决于你打算然后用这些数据做什么。

Whether this is the best approach for reading your file may depend on what you then intend to do with the data once parsed. There may be more efficient ways to read in/process your data in both SemWeb and dotNetRDF depending on what you intend to then do with that data.

这篇关于SemWeb库RDF解析器C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆