[Jslib] Re: RDF redesign

Martin T. Kutschker Martin.T.Kutschker@blackbox.net
Sun, 28 Oct 2001 14:53:04 +0100


This is a multi-part message in MIME format.

------=_NextPart_000_000B_01C15FC0.3F8C3F80
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Eric Plaster <plaster@urbanrage.com> schrieb in im Newsbeitrag: =
public.mozdev.jslib/3BD88800.3090502@urbanrage.com...

  Ok, I said that I was going to work on this back in Aug, but got =
distracted by a lay off.  So I'm going to start work on it again (see my =
posting here on 8/8).  I'll be checking in stuff into libraries/rdf =
(which currently doesn't exist) so I shouldn't be getting in anyones =
way.

  If anyone has any suggestions, shoot them my way.  My goals:

    a.. Full compatability with all rdfs (no magic)=20
    b.. Sub class structure (see previous post)=20
    c.. Easier to work with.=20
  Let me know what you guys think.
  -eric

We need something like this.

  getRefAttribute : function(aNode, name)
  {
    var realnode =3D this._getRealNode(aNode);

    var itemRes =3D this.RDF.GetResource(this.nc + name);
    if (!itemRes) return null;

    var IDRes =3D this.RDF.GetResource(realnode);
    if (!IDRes) return null;
       =20
    var thisNode =3D this.dsource.GetTarget(IDRes, itemRes, true);
    if (thisNode) thisNode =3D =
thisNode.QueryInterface(Components.interfaces.nsIRDFResource);
    if (thisNode)
    {
      return thisNode.Value;
    }
    return null;
  },

With it you may walk through Mozilla's own RDF trees.

Masi

------=_NextPart_000_000B_01C15FC0.3F8C3F80
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4616.200" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>Eric Plaster &lt;<A=20
href=3D"mailto:plaster@urbanrage.com">plaster@urbanrage.com</A>&gt; =
schrieb in im=20
Newsbeitrag: <A=20
href=3D"mailto:public.mozdev.jslib/3BD88800.3090502@urbanrage.com">public=
.mozdev.jslib/3BD88800.3090502@urbanrage.com</A>...</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"><FONT=20
  face=3D"Andale Mono" size=3D2></FONT><BR>Ok, I said that I was going =
to work on=20
  this back in Aug, but got distracted by a lay off. &nbsp;So I'm going =
to start=20
  work on it again (see my posting here on 8/8). &nbsp;I'll be checking =
in stuff=20
  into libraries/rdf (which currently doesn't exist) so I shouldn't be =
getting=20
  in anyones way.<BR><BR>If anyone has any suggestions, shoot them my =
way.=20
  &nbsp;My goals:<BR>
  <UL>
    <LI>Full compatability with all rdfs (no magic)=20
    <LI>Sub class structure (see previous post)=20
    <LI>Easier to work with. </LI></UL>
  <DIV>Let me know what you guys think.<BR>-eric<BR></DIV></BLOCKQUOTE>
<DIV dir=3Dltr><FONT face=3D"Andale Mono" size=3D2>We need something =
like=20
this.</FONT></DIV>
<DIV dir=3Dltr><FONT face=3D"Andale Mono" =
size=3D2></FONT>&nbsp;</DIV><FONT=20
face=3D"Andale Mono" size=3D2></FONT>
<DIV dir=3Dltr><FONT face=3D"Andale Mono" size=3D2>&nbsp; =
getRefAttribute :=20
function(aNode, name)<BR>&nbsp; {<BR>&nbsp;&nbsp;&nbsp; var realnode =3D =

this._getRealNode(aNode);</FONT></DIV>
<DIV><FONT face=3D"Andale Mono" size=3D2></FONT>&nbsp;</DIV>
<DIV dir=3Dltr><FONT face=3D"Andale Mono" size=3D2>&nbsp;&nbsp;&nbsp; =
var itemRes =3D=20
this.RDF.GetResource(this.nc + name);<BR>&nbsp;&nbsp;&nbsp; if =
(!itemRes) return=20
null;</FONT></DIV>
<DIV><FONT face=3D"Andale Mono" size=3D2></FONT>&nbsp;</DIV>
<DIV dir=3Dltr><FONT face=3D"Andale Mono" size=3D2>&nbsp;&nbsp;&nbsp; =
var IDRes =3D=20
this.RDF.GetResource(realnode);<BR>&nbsp;&nbsp;&nbsp; if (!IDRes) return =

null;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
<BR>&nbsp;&nbsp;&nbsp; var=20
thisNode =3D this.dsource.GetTarget(IDRes, itemRes, =
true);<BR>&nbsp;&nbsp;&nbsp;=20
if (thisNode) thisNode =3D=20
thisNode.QueryInterface(Components.interfaces.nsIRDFResource);<BR>&nbsp;&=
nbsp;&nbsp;=20
if (thisNode)<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
return=20
thisNode.Value;<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; return=20
null;<BR>&nbsp; },<BR></FONT></DIV>
<DIV dir=3Dltr><FONT face=3D"Andale Mono" size=3D2>With it you may walk =
through=20
Mozilla's own RDF trees.</FONT></DIV>
<DIV dir=3Dltr><FONT face=3D"Andale Mono" size=3D2></FONT>&nbsp;</DIV>
<DIV dir=3Dltr><FONT color=3D#999999><B><I><FONT=20
color=3D#666666><SMALL>Masi</SMALL></FONT></I></B></FONT></DIV></BODY></H=
TML>

------=_NextPart_000_000B_01C15FC0.3F8C3F80--