jsLib inMemRDF
Denis Laprise <[email protected]> Fri, 01 Apr 2005 20:56:14 -0500
| Newsgroups | gmane.comp.mozilla.devel.rdf |
|---|---|
| Organization | Another Netscape Collabra Server User |
| Message-ID | <[email protected]> |
Hi,
I'm trying to create the following RDF file dynamically with jsLib
inMemRDF (I know it can be made with a RDFFile call but I want to
understand how inMemRDF works):
<RDF:Description about="http://localhost/genericStore/Book/12197">
<Book:Title>Book #9</Book:Title>
<Book:ISBN>907000733</Book:ISBN>
<Book:PublisherId>12197</Book:PublisherId>
<Book:AuthorId>12188</Book:AuthorId>
</RDF:Description>
<RDF:Bag about="http://localhost/genericStore/Book">
<RDF:li resource="http://localhost/genericStore/Book/12197"/>
</RDF:Bag>
I've tried this but it doesn't work. I don't understand how to insert
the sub-nodes.
var datastore = new inMemRDF("http://localhost/genericStore/Book",
"http://localhost/genericStore/Book#");
var newNode = datastore.addNode('12197');
datastore.setAttrRes(newNode, 'http://localhost/genericStore/Book/12197');
datastore.setAttrLit(newNode, 'Title', 'Book #9');
datastore.setAttrLit(newNode, 'ISBN', '907000733');
Thank you very much
Denis Laprise