Hi Rappers,
Another little patch for the N3Parser, which did not recognize missin=
g
definitions for two-letter prefixes (like "dc" :)) before. Please fin=
d
code and example below.
Might not be interesting for most readers, it's mainly for Tobias.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
+
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Proposed Change
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
# N3Parser.php, line 588, method applyStuff()
if (isset($prefixes[$ns])){
$list[$i] =3D '<'.$prefixes[$ns].$name.'>';
}
elseif (substr($ns, 0, 2) =3D=3D '^^' && isset($prefixes[$ns =3D subs=
tr($ns,
2)])){
$list[$i] =3D '^^'.$prefixes[$ns].$name;
} =20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
N3 Example=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
@prefix : <#>.
<>=09dc:creator=09"Hannes".
Without patch, this example is parsed as being valid despite the unbo=
und
prefix, you get a rather weird statement.
With this patch, the "Prefix not declared: dc:" error is triggered as
expected.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
+
Next patches follow - you find all sorts of these little beasts when =
you
actually use that stuff :)
Liebe Gr=FCsse,
Hannes
PS: I found it rather distracting that there are totally different
iterator interfaces in different places in RAP. Is there a deeper rea=
son
behind this? Or does just nobody care?=20
|