[Jslib] Re: RDF redesign

Eric Plaster plaster@visi.com
Mon, 12 Nov 2001 10:43:11 -0600


Martin T. Kutschker wrote:

>  
>
>     Eric Plaster <plaster@urbanrage.com <mailto:plaster@urbanrage.com>
>     > schrieb in im Newsbeitrag:
>     public.mozdev.jslib/3BEC5192.7050709@urbanrage.com
>     <mailto:public.mozdev.jslib/3BEC5192.7050709@urbanrage.com>...
>
>
>
>     Martin T. Kutschker wrote:
>
>         * NC:  This I felt was something that is completely
>           transparent.  From what I learned, you don't need it for
>           anything.  You can get a literal with out it, and it fills
>           it in for you.  So for example, these are equivelant
>
>             RDF.getResource( "http://jslib.mozdev.org/rdf#name");
>             RDF.getResource("name");
>
>         Don't ask me why this is so, but it is.  So if the NC is
>         unnessary, and it's only in the rdf file it's self, why even
>         have an option to set your NC?  Just default to
>         "http://jslib.mozdev.org/rdf#" because your using our class.
>
>          
>
> Well, but what about RDF files with multiple NCs?
>
To tell you the truth, I don't know.  I know that this works because I 
tested it with an example rdf file.  If it's smart enough to figure out 
the NC on a single NC rdf, it should do the right thing.

I think that this may be a small point at this time.  If it becomes an 
issue in the future, we can change it.

>
<snip/>

>     Agreed.  Like I said above, we should be able to open any rdf, and
>     write any rdf (that can be used in templates, etc...  in other
>     words, valid rdf).  So for example:
>
>         var rdf = new RDFFile("/tmp/bob.rdf");
>         var node = rdf.getNode("urn:test:names:bob");
>         node.getAttribute("name");
>
>          
>
>  
>
> Or:
>
>  
>
> var rdf = new RDFFile("/tmp/bob.rdf");
>
> rdf.setRoot("urn:test");
> var node = rdf.getNode(":names:bob"); // starting : denotes 
> "relavtive" node name
> node.getAttribute("name");
>
>  
>
The way that I implemented it so far, you're example is the same as:

var rdf = new RDFFile("/tmp/bob.rdf");

var seq = rdf.getSeq("urn:test");
var node = seq.getNode("names:bob");
node.getAttribute("name");


I don't know if we should have short cuts, as it can be confusing as to 
what level your at, etc.  Plus, it doesn't really fit in the rdf model. 
 It's just as easy to get the container and reference them relative, or 
reference them by full path.

>  
>
<snip/>

>     In rdf, to make a node into a container, you just have to make one
>     call:
>
>       RDFCUtils.MakeSeq(this.dsource, myresource);
>
>      
>
> Do you mean in RDF or in Mozilla's RDF implementation?
>
> I recall something on mozilla.org saying something about a defect in 
> the implementation
>
Yes, this is true in mozilla's implementation.

>
>     So, this is how it would play out (keep in mind, I'm just brain
>     storming, this is not how it is currently implemented):
>
>         var rdf = new RDFFile("/tmp/bob.rdf");
>         var res = rdf.addResource("urn:blah");
>         res.flush();
>
>     Your rdf file now looks like this:
>
>          <li about="urn:blah"/>
>
>      
>
> Really? I would have thought it would be
>
>  
>
> <Description about="urn:blah"/>
>
Sorry, you're right.  It would just be a description.  I was writing 
this from memory...

>  
>
> Or does the class assert an arc to rdf#li? I don't think that it 
> should do something like that, at least not in the RDF class. It could 
> be ok for a Container class.
>
>     Now you could do this:
>
>         res.addSubResource("bob");
>
>
>     Your rdf file now looks like this:
>
>         <Seq about="urn:blah">
>             <li about="urn:blah:bob"/>
>         </Seq>
>
>  
>
> Ok, a child node of Seq should be a li.
>
>  
>
> And please, could you stop posting HTML? I have always a hard time 
> replying to your posts. Thanx.
>
:( ok

>  
>
> Masi
>

-- 
Eric Plaster
Urban Rage Software <http://www.urbanrage.com>
Senior Software Engineer
RPG tools project
rpgtools@urbanrage.com
http://rpgtools.mozdev.org

*/ AD&D tools for the player and the DM/*