Lifetime of RDF nodes in Redland RDF after parsing a model?

二次信任 提交于 2019-12-11 01:37:25

问题


I am parsing an RDF_model using librdf_parser_parse_string_into_model. I then retain the librdf_model but free the librdf_parser. It looks to me as if the nodes in the model then have disappeared as well.

So what lifetime does Redland RDF impose on librdf_nodes in this case? Is the the lifetime of the model that contains them (as would seem most convenient) or the lifetime of the parser that created them (as now may be the case)? The documentation seems to be silent on this.


回答1:


Redland nodes librdf_node are implemented as Raptor terms raptor_term. These are reference counted but not cached in any other way, so are free()-d when they are no longer referenced. Similarly librdf_uri are raptor_uri and work the same way.



来源:https://stackoverflow.com/questions/16607448/lifetime-of-rdf-nodes-in-redland-rdf-after-parsing-a-model

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