From: Christian B. <in...@bi...> - 2005-05-26 15:37:56
|
Hallo, I am new to RDFAPI-PHP but very impressed by the careful design and the good documentation. I am stuck with a problem, however, and thought you might be able to help me: I have a hierarchical folder structure in my database which I want to display in a Mozilla XUL Tree Widget that can natively use the RDF as a datasource. $db = $rdf->getNewModel($datasource); $dbRes = new ResModel($db); if I create a root sequence like so: $treeRootSeq = $dbRes->createSeq("urn:bibliograph:folder#root"); and programmatically add members of the sequence: $folderRes = $dbRes->createResource("urn:bibliograph:folder#(newFolderId goes here)"); $treeRootSeq->add( $folderRes ); the generated RDF looks like this: <rdf:Description rdf:about="urn:bibliograph:folder#root"> <rdf:_2 rdf:resource="urn:bibliograph:folder#89e51c22d059c6abde622855aa7f5321"/> </rdf:Description> .... <rdf:Seq rdf:about="urn:bibliograph:folder#828679db024d9dc591676782c63b949d"> <rdf:_1 rdf:resource="urn:bibliograph:folder#92eb042f602b699051344f1b2e25c12f"/> <rdf:_2 rdf:resource="urn:bibliograph:folder#6c00094831008383d4e1b9cba22bf30f"/> <rdf:_3 rdf:resource="urn:bibliograph:folder#48a124b55bfa09881264c0342d419a50"/> </rdf:Seq> What I would like to have, however, is this: <rdf:Description rdf:about="urn:bibliograph:folder#root"> <rdf:Seq> <rdf:li rdf:resource="urn:bibliograph:folder#92eb042f602b699051344f1b2e25c12f"/> <rdf:li rdf:resource="urn:bibliograph:folder#6c00094831008383d4e1b9cba22bf30f"/> <rdf:li rdf:resource="urn:bibliograph:folder#48a124b55bfa09881264c0342d419a50"/> </rdf:Seq> </rdf:Description> How do I have to code this? Thanks, Christian |