我有一个用 EasyRDF 创建的 RDF 图:
<?xml version="1.0" encoding="utf-8" ?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/terms/" xmlns:foaf="http://xmlns.com/foaf/0.1/" <rdf:Description rdf:about="http://the-query-url"> <dc:creator>me</dc:creator> <foaf:primaryTopic rdf:resource="genid1"> </rdf:Description> <rdf:Description rdf:nodeID="genid1"> <!-- stuff --> </rdf:Description> </rdf:RDF>
以上不正确 - 对空白节点的引用foaf:primaryTopic
应该是_:genid1
.
当我将该行更改为
$meta_block->add('foaf:primaryTopic', $graph->resource('_:' . $symbol_block->getBNodeId()));
EasyRdf 嵌套资源,如下所示:
<?xml version="1.0" encoding="utf-8" ?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/terms/" xmlns:foaf="http://xmlns.com/foaf/0.1/" <rdf:Description rdf:about="http://the-query-url"> <dc:creator>me</dc:creator> <foaf:primaryTopic> <rdf:Description> <!-- stuff --> </rdf:Description> </foaf:primaryTopic> </rdf:Description> </rdf:RDF>
如何阻止 EasyRdf 嵌套节点?我希望输出与第一个示例一样,仅_:genid1
作为foaf:primaryTopic
.