TTL文件格式 - 我不知道这是什么 [英] TTL file format - I have no idea what this is

查看:311
本文介绍了TTL文件格式 - 我不知道这是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个具有结构的文件,但我不知道它是什么格式,也不知道如何解析它。文件扩展名为ttl,但我以前从未遇到过。



文件中的一些行如下所示:

 < HTTP://data.europa.eu/esco/label/790ff9ed-c43b-435c-b6b3-6a4a6e8e8326> 
a skosxl:标签;
skosxl:literalFormgérerdesopérationsd'allègement@fr。

< http://data.europa.eu/esco/label/98570af6-b237-4cdd-b555-98fe3de26ef8>
a skosxl:标签;
esco:hasLabelRole< http://data.europa.eu/esco/label-role/neutral> ,< http://data.europa.eu/esco/label-role/male> ,< http://data.europa.eu/esco/label-role/female> ;
skosxl:literalForm刨花板机器技术员@en。

< http://data.europa.eu/esco/label/aaac5531-fc8d-40d5-bfb8-fc9ba741ac21>
a skosxl:标签;
esco:hasLabelRolehttp://data.europa.eu/esco/label-role/female,http://data.europa.eu/esco/label-role/standard-female;
skosxl:literalFormpracovnicedennípéčeoděti@cs。

而且它会像这样继续增加400多MB。为一些节点添加了其他属性,但不是所有节点。

它让我想起了某种形式的XML,但是我没有太多使用不同格式的经验。它也看起来像一个可以作为图表模式的东西。
您是否知道它是什么数据格式,以及如何在python中解析它?

解决方案

是,@Phil是正确的,它是用于存储RDF数据的turtle语法。

我建议你将它导入某种RDF商店,而不是自己试着解析400MB +。您可以使用 GraphDB Blazegraph Virtuso ,名单还在继续。搜索RDF商店应该提供许多其他选项。



然后,您可以使用 SPARQL 使用Python查询RDF存储(与关系数据库的SQL相似) RDFlib 。以下是来自RDFLib的示例


I have a file which has a structure, but I don't know what format it is, nor how to parse it. The file extension is ttl, but I have never encountered this before.

Some lines from the file looks like this:

<http://data.europa.eu/esco/label/790ff9ed-c43b-435c-b6b3-6a4a6e8e8326>
    a                   skosxl:Label ;
    skosxl:literalForm  "gérer des opérations d’allègement"@fr .

<http://data.europa.eu/esco/label/98570af6-b237-4cdd-b555-98fe3de26ef8>
    a                   skosxl:Label ;
    esco:hasLabelRole   <http://data.europa.eu/esco/label-role/neutral> , <http://data.europa.eu/esco/label-role/male> , <http://data.europa.eu/esco/label-role/female> ;
    skosxl:literalForm  "particleboard machine technician"@en .

<http://data.europa.eu/esco/label/aaac5531-fc8d-40d5-bfb8-fc9ba741ac21>
    a                   skosxl:Label ;
    esco:hasLabelRole   "http://data.europa.eu/esco/label-role/female" , "http://data.europa.eu/esco/label-role/standard-female" ;
    skosxl:literalForm  "pracovnice denní péče o děti"@cs .

And it goes on like this for 400 more MB. Additional attributes are added, for some, but not all nodes.

It reminds me of some form of XML, but I don't have much experience working with different formats. It also looks like something that can be modeles as a graph. Do you have any idea what data format it is, and how I could parse it in python?

解决方案

Yes, @Phil is correct that is turtle syntax for storing RDF data.

I would suggest you import it into an RDF store of some sort rather than try and parse 400MB+ yourself. You can use GraphDB, Blazegraph, Virtuso and the list goes on. A search for RDF stores should give many other options.

Then you can use SPARQL to query the RDF store (which is like SQL for relational databases) using Python RDFlib. Here is an example from RDFLib.

这篇关于TTL文件格式 - 我不知道这是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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