我有一个项目,我需要解析一个 RDF 文件并记录我之后必须搜索特定数据的所有数据。我在网上搜索,我能找到的只是如何查询上述 RDF 文件,但我想解析它并将所有类保存在对象中。
这是一个类在我的文件中的外观:
<BFO rdf:about="BFO:0000007">
<rdfs:label>process</rdfs:label>
<Definition>
<rdf:Description>
<def>A process is an entity that exists in time by occurring or happening, has temporal parts and always involves and depends on some entity during the time it occurs.</def>
</rdf:Description>
</Definition>
<is_a rdf:resource="EFO:0000001"/>
</BFO>
更新:
是的,你说的一切都有效,非常感谢你,但最后一个问题:) 我拥有的命名空间是:
<?xml version='1.0' encoding='UTF-8'?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns="http://www.ebi.ac.uk/efo/">
</rdf>
我的问题是
<Definition>
<rdf:Description>
<def>smth here</def>
</rdf:Description>
</Definition>
i couldn't find a way to get the def tag, any idea how i can access it? sry to bother again:)