Could you clarify the semantics of the "truthValue" argument in calls to nsIRDFDataSource?
Are there any differences in its meaning in calls to hasAssertions() vs GetTargets() etc etc
I had read it meant some kind of underlying permanency, but the somewhere else it meant a resource object could you clarify for me?
Cheers,
N
IIRC, and honestly, that's far fetched, as that stuff predates me, the
truth value is there to overwrite an existing arch in a read-only
datasource with a "non-existing arch" in another datasource, so that the
combined compound datasource would act like that arch doesn't exist.
http://mxr.mozilla.org/mozilla1.9.1/source/rdf/base/src/nsCompositeDataSource.cpp#278
is one of the fragments of implementing that.
Axel
Hi Axel,
Great thanks very much, I had looked through that code, but so little of it's documented I couldn't make much sense of it! It seems it's
basically a way of temporarily hiding an arc in a datasource?
My confusion was in my custom ds.GetTargets() I was getting called for the assertion:
#resource -> http://home.netscape.com/NC-rdf#child, true
and I didn't understand the implications of this truthValue in a non-assert call, but I guess it's a way of a) hiding and b) asserting temporary
arcs, so that predicates like "http://home.netscape.com/NC-rdf#child" don't get rendered in XUL templates etc.
Cheers,
N
> IIRC, and honestly, that's far fetched, as that stuff predates me, the
> truth value is there to overwrite an existing arch in a read-only
> datasource with a "non-existing arch" in another datasource, so that
> the combined compound datasource would act like that arch doesn't exist.
In case it helps, this is exactly my understanding too, except
s/arch/arc/g ;-)
--
Warning: May contain traces of nuts.
Just some background, I'm writing ADO.NET interfaces for Mozilla, and in this case I'm wrapping an SQLite ADO impl inside a custom
SqlRdfDatasource (http://www.redbacksystems.com/xulu/)
So these were calls I was receiving to my wrapped DS that I was trying to convert to SQL calls.
I found a thread on the old Mozilla RDF NG, that Neil you actually commented on, that clarified further, as well as this:
http://sagan.ajusco.upn.mx:8080/library/mozilla/ch10/03.html.
So AFAICT - here goes...
The truthValue is effectively RDF reification, it says this arc is not true or not true. Not that it's not asserted (which as Neil said is just
"unknown", just that it's not true
Consider:
Car => Colour = Blue
Car => Colour != Blue
Now it appears hasAssertion() is the one that is really is on some kind of drugs, but it doesn't make sense unless taken in the context of Assert()
If you:
Assert( Car, Colour, Blue, true )
You have made the statement:
Car => Colour = Blue
If you:
Assert( Car, Colour, Blue, false )
You have made the statement:
Car => Colour != Blue
so:
hasAssertion( Car, Colour, Blue, true )
You would assume is checking for the truth of this statement - but actually it's not, and this was seen in my hasAssertion() calls that I
couldn't get my head round as basically I was being called in a vicious loop for the same arcs over and over.
the truthValue in hasAssertion() is the opposite of the use in Assert() - the question is about the arcs negation - the hasAssertion() call is
effectively asking "has this arc been asserted not true?".
So:
Assert( Car, Colour, Blue, false )
Followed by:
hasAssertion( Car, Colour, Blue, true )
Returns true - yes the statement has been made false
Assert( Car, Colour, Blue, true )
Followed by:
hasAssertion( Car, Colour, Blue, true )
Returns false - no the the statement hasn't been made false
So: truthValue == true - is it true that this arc is not true
So: truthValue == false - is it false that this arc is not true
Why anyone would code a double negative into an argument meaning I have no idea.
Phew, I'm done.
N