Python 数据集和目录之间的冲突
我试图在XML的数据集定义中添加一些标记。根据欧洲数据门户的de结构,我必须遵循标签Python 数据集和目录之间的冲突,python,xml,dataset,rdf,ckan,Python,Xml,Dataset,Rdf,Ckan,我试图在XML的数据集定义中添加一些标记。根据欧洲数据门户的de结构,我必须遵循标签 <foaf:Agent rdf:about="URI/of/the/publisher"> <foaf:name xml:lang="es"> Name of the publisher</foaf:name> </foaf:Agent> <dct:publisher rdf:resource=”URI/of/
<foaf:Agent rdf:about="URI/of/the/publisher">
<foaf:name xml:lang="es"> Name of the publisher</foaf:name>
</foaf:Agent>
<dct:publisher rdf:resource=”URI/of/the/publisher”>
因此,每次我使用带有FOAF.name和FOAF.Agent的g.add时,它都会将我的标记从dataset标记(dcat:dataset)中发送出来,并将其从大约转换为资源定义。
我觉得这可能是代码冲突。我在哪里会做出错误的反抗
更新:
在进行了多次尝试之后,我发现为使结构不进入“主标记”而发出的命令存在冲突,因为使用了“RDF.type”定义,因为主结构是g.add((dataset\u ref,RDF.type,DCAT.dataset))
,当我尝试创建父标记和子标记时,父结构与主标记重复,因为它获得相同的值,因为我在文档中发现,如果子结构在父结构上找不到“RDF.type”,它将通过调用“RDF:Description”自动生成它
我只是设法得到了以下结构,即使它不是我需要得到的
<dcat:Dataset rdf:about="URI-ref">
<dct:description xml:lang="es"> Description of the dataset </dct:description>
<dct:title xml:lang="en">Title of dataset</dct:title>
<dct:publisher rdf:resource="URI-ref"/>
</dcat:Dataset>
<foaf:Agent rdf:about="URI-ref">
<foaf:name>Name of the publisher</foaf:name>
</foaf:Agent>
数据集的描述
数据集标题
出版商名称
我无法将Foaf:Agent和Foaf:name添加到dcat:Dataset中。
g.add((Dataset\u ref,Foaf.Agent,EDP\u publisher))
->是否有理由将Foaf:Agent
用作属性?我的意思是,它显然是FOAF词汇表中的一个类,不是吗?我也不明白你所说的“数据集之外”是什么意思-你只是在RDF图中添加了三元组。FOAF:agent的使用是因为欧洲数据门户声明了这样的标记。在数据集之外,我的意思是:标题文本。Name publisher
我正在尝试再次将Name publisher放入其中,foaf:Agent
不是一个属性。。。再看看你的另一个问题,它不明白为什么这很重要。这只是RDF的XML序列化,从语义上讲并不重要。
<dcat:Dataset rdf:about="URI-ref">
<dct:description xml:lang="es"> Description of the dataset </dct:description>
<dct:title xml:lang="en">Title of dataset</dct:title>
<dct:publisher rdf:resource="URI-ref"/>
</dcat:Dataset>
<foaf:Agent rdf:about="URI-ref">
<foaf:name>Name of the publisher</foaf:name>
</foaf:Agent>