Reading a Turtle/N3 RDF File with Python

我的未来我决定 提交于 2019-12-05 03:32:09

I think the first problem is w/the uppercase PREFIX-- if you lowercase those it gets past that point. Not sure if it's a bug in rdflib or in the Turtle .ttl, but the Turtle Validator online demo seems to agree it's a problem with the .ttl (says Validation failed: The @PREFIX directive is not supported, line 1 col 0. but that problem goes away if you lowercase them).

Once you're past that hurdle, neither parser likes the part around p:given_by [: "Bad syntax (']' expected) at ^ in:"... per rdflib; Turtle Validator says

Validation failed: Expecting a period, semicolon, comma, close-bracket, or close-brace but found '/', line 31 col 33.

so it specifically dislikes the p:source/Philip_Miller part.

From these two issues (who knows if there are others...!) I think you can conclude that this N3 source (the .ttl file you post) is broken, and turn your attention to whatever system made this file in the first place, and why it's making it in such a multiply broken way.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!