Re: RDF resource and tree
R_O_O_K <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.rdf |
|---|---|
| Organization | Aster City Cable |
| Message-ID | <[email protected]> |
Hi! The expression http://localhost/bookstore/rdf/author#lastname doesn't point to anything in the scope of http://localhost/bookstore/book/12178 What you would mean is http://localhost/bookstore/rdf/book#author, which points to a resource rather than literal. You will have to use somewhat more refined rules to accomplish your task. See http://xulplanet.com/tutorials/xulqa/index.html#templates for some good examples. Best regards! Michał Ziemski Dnia 2005-01-25 19:57, Użytkownik Denis Laprise napisał: > > I've added it but it doesn't work. I think the problem is on the XUL side. > > Thank you for your help. > > R_O_O_K wrote: > >> Hi! >> >> Try >> <BOOK:author rdf:resource="http://localhost/bookstore/author/12178" /> >> rather than >> <BOOK:author resource="http://localhost/bookstore/author/12178" /> >> >> Maybe that would help. >> >> Michał Ziemski >> >> Dnia 2005-01-25 19:18, Użytkownik Denis Laprise napisał: >> >>> Hi, >>> >>> I'd like to match the following RDF graph >>> >>> <?xml version="1.0" encoding="iso-8859-1"?> >>> <RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#" >>> xmlns:AUTHOR="http://localhost/bookstore/rdf/author#" >>> xmlns:PUBLISHER="http://localhost/bookstore/rdf/publisher#" >>> xmlns:BOOK="http://localhost/bookstore/rdf/book#" >>> xmlns:REVIEW="http://localhost/bookstore/rdf/review#"> >>> >>> >>> <RDF:Description >>> about="http://localhost/bookstore/author/12178"> >>> <AUTHOR:id>12178</AUTHOR:id> >>> <AUTHOR:firstname>Auteur #0</AUTHOR:firstname> >>> <AUTHOR:lastname>Nom famille</AUTHOR:lastname> >>> </RDF:Description> >>> [...] >>> </RDF:Description> >>> <RDF:Description >>> about="http://localhost/bookstore/publisher/12178"> >>> <PUBLISHER:id>12178</PUBLISHER:id> >>> <PUBLISHER:name>Publisher #0</PUBLISHER:name> >>> </RDF:Description> >>> [...] >>> >>> <RDF:Bag >>> about="http://localhost/bookstore/myBookstore"> <RDF:li> >>> <RDF:Description about="http://localhost/bookstore/book/12178"> >>> <BOOK:isbn>714877320</BOOK:isbn> >>> <BOOK:title>Livre #0</BOOK:title> >>> <BOOK:author >>> resource="http://localhost/bookstore/author/12178" /> >>> <BOOK:publisher >>> resource="http://localhost/bookstore/publisher/12178" /> >>> </RDF:Description> >>> </RDF:li> >>> >>> [...] >>> >>> </RDF:Bag> >>> </RDF:RDF> >>> >>> to a tree like this: >>> >>> >>> <tree id="treeBook" key="isbn" enableColumnDrag="true" flex="1" >>> sdatasources="bookstore_ext.rdf.php" >>> ref="http://localhost/bookstore/myBookstore" onAccept="handleAccept"> >>> <treecols> >>> <treecol id="isbn" label="ISBN" flex="1" primary="true" /> >>> <treecol id="title" label="Title" flex="2" /> >>> <treecol id="author" label="Author" flex="1" /> >>> <treecol id="publisher" label="Publisher" flex="1" /> >>> </treecols> >>> <template> >>> <rule> >>> <treechildren flex="1"> >>> <treeitem uri="rdf:*"> >>> <treerow >>> id="rdf:http://localhost/bookstore/book#isbn"> >>> <treecell >>> label="rdf:http://localhost/bookstore/rdf/book#isbn"/> >>> <treecell >>> label="rdf:http://localhost/bookstore/rdf/book#title"/> >>> <treecell >>> label="rdf:http://localhost/bookstore/rdf/author#lastname" >>> readonly="true"/> >>> <treecell >>> label="rdf:http://localhost/bookstore/rdf/publisher#name" >>> readonly="true"/> >>> </treerow> >>> </treeitem> >>> </treechildren> >>> </rule> >>> </template> </tree> >>> >>> The tree ends up showing the isbn and title of the book, but I did'nt >>> succed yet to show the author nor the publisher. I guess a must >>> define a predicate but I can't figure it out. >>> >>> Thank you