[Jslib] Re: RDF class

Eric Plaster eric.plaster@qlogic.com
Thu, 09 Aug 2001 10:30:30 -0500


--------------030905050205000205040808
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit


Part of rewriting this RDF class is figuring out the language.  I only 
learned enough to be dangerous, so I'm going to have to learn what this 
actually does.  But by all means, it should be included.

Martin T. Kutschker wrote:

>Eric Plaster <eric.plaster@qlogic.com> schrieb in im Newsbeitrag:
>public.mozdev.jslib/3B7165A0.60602@qlogic.com...
>
>>Let me know what you guy's think.  I'll start coding this up sometime this
>>
>week.
>
>Should we take into account what Kevin Watt suggested a long time ago (see
>archive of May):
>
>I [Kevin] was thinking of adding the following function to add a resource
>instead of a literal... Would that accomplish the resource I'm hoping for?
>I wrote some code, but have to go to class.  Just thought I'd ask and see if
>it made sense to y'all.
>
>  setRefAttribute : function(aNode, name, bNode)
> //bNode was value - = instead of a literal, make it a reference::
>  {
>    alert ('in setRefAttribute');
>    var realnode = this._getRealNode(aNode);
>    var newnode = this.RDF.GetResource(realnode);
>    var oldvalue = this.getAttribute(realnode, name);
>
>    //get real node for our destination, as well
>    var Brealnode = this._getRealNode(bNode);
>    var Bnewnode = this.RDF.GetResource(Brealnode);
>
>    if(newnode) {
>      // Add an assertion to the RDF datasource for each property of the
>resource
>      if(oldvalue) {
>        this.dsource.Change(newnode,
>            this.RDF.GetResource(this.nc + name),
>            this.RDF.GetResource(oldvalue),
>            this.RDF.GetResource(Bnewnode) );
>      } else {
>        this.dsource.Assert(newnode,
>            this.RDF.GetResource(this.nc + name),
>            this.RDF.GetResource(Bnewnode),
>            true );
>
>        alert ('added new Assert(' + newnode + '), ' +
>this.RDF.GetResource(this.nc + name) + ', ' +
>            this.RDF.GetResource(Bnewnode) + ', true');
>      }
>    }
>  }
>


--------------030905050205000205040808
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<html>
<head>
</head>
<body>
<br>
Part of rewriting this RDF class is figuring out the language. &nbsp;I only learned
enough to be dangerous, so I'm going to have to learn what this actually
does. &nbsp;But by all means, it should be included.<br>
<br>
Martin T. Kutschker wrote:<br>
<blockquote type="cite" cite="mid:public.mozdev.jslib%2F9ktqmh$b9s$1@tigris.mozdev.org">
  <pre wrap="">Eric Plaster <a class="moz-txt-link-rfc2396E" href="mailto:eric.plaster@qlogic.com">&lt;eric.plaster@qlogic.com&gt;</a> schrieb in im Newsbeitrag:<br><a class="moz-txt-link-abbreviated" href="mailto:public.mozdev.jslib/3B7165A0.60602@qlogic.com">public.mozdev.jslib/3B7165A0.60602@qlogic.com</a>...<br></pre>
  <blockquote type="cite">
    <pre wrap="">Let me know what you guy's think.  I'll start coding this up sometime this<br></pre>
    </blockquote>
    <pre wrap=""><!---->week.<br><br>Should we take into account what Kevin Watt suggested a long time ago (see<br>archive of May):<br><br>I [Kevin] was thinking of adding the following function to add a resource<br>instead of a literal... Would that accomplish the resource I'm hoping for?<br>I wrote some code, but have to go to class.  Just thought I'd ask and see if<br>it made sense to y'all.<br><br>  setRefAttribute : function(aNode, name, bNode)<br> //bNode was value - = instead of a literal, make it a reference::<br>  {<br>    alert ('in setRefAttribute');<br>    var realnode = this._getRealNode(aNode);<br>    var newnode = this.RDF.GetResource(realnode);<br>    var oldvalue = this.getAttribute(realnode, name);<br><br>    //get real node for our destination, as well<br>    var Brealnode = this._getRealNode(bNode);<br>    var Bnewnode = this.RDF.GetResource(Brealnode);<br><br>    if(newnode) {<br>      // Add an assertion to the RDF datasource for each property of the<br>
resource<br>      if(oldvalue) {<br>        this.dsource.Change(newnode,<br>            this.RDF.GetResource(this.nc + name),<br>            this.RDF.GetResource(oldvalue),<br>            this.RDF.GetResource(Bnewnode) );<br>      } else {<br>        this.dsource.Assert(newnode,<br>            this.RDF.GetResource(this.nc + name),<br>            this.RDF.GetResource(Bnewnode),<br>            true );<br><br>        alert ('added new Assert(' + newnode + '), ' +<br>this.RDF.GetResource(this.nc + name) + ', ' +<br>            this.RDF.GetResource(Bnewnode) + ', true');<br>      }<br>    }<br>  }<br></pre>
    </blockquote>
    <br>
    </body>
    </html>

--------------030905050205000205040808--