[Mulgara-general] Two Database instances in the same process?

Paul Gearon gearon at ieee.org
Mon Sep 28 15:07:43 UTC 2009


On Sun, Sep 27, 2009 at 10:31 PM, Karsten Huneycutt <kph at skuld.us> wrote:
> As currently distributed, instead of ~rdf:Literal, it says
> mulgara:UriReference.  But yeah, they're correct but invalid.

Ah, I remember now. The ~ operator wasn't implemented when this was
first written, so instead of removing blank nodes, I detected URIs.

Also, since rdfs:Literal is a part of the rdf namespace, I don't think
I could do any "magic" with it (as in, detecting if something is a
literal). That's why it uses mulgara:UriReference. This detects
anything that's a URI (as opposed to a blank node or a literal). This
does cause the blank nodes to be skipped, but seemed OK at the time.

> I think I figured it out.  This rule:
>
> Z(U) :- A(X,U), rdfs:range(A,Z).                      -- 3
>
> can become:
>
> xsd:string("some string") :- mymodel:someProperty
> (mymodel:someInstance, "some string"), rdfs:range
> (mymodel:someProperty, xsd:string).
>
> and it's downhill from there (rule 4a fires and puts in the
> rdfs:Resource statement, etc).

Makes sense. The original set of rules (written for Krule in RDF/XML,
several years before RLog), were being tested with RDFS that didn't
use typed literals. So this sort of thing was missed.

> I've added mulgara:UriReference(U) to that rule (rule "3") as well,
> but I think I caused some sort of problem with the reasoner.  It used
> to take three-four minutes to reason over the (relatively small 10K
> statement) model; it churned for 20 before I gave up.

Hmm, this should essentially act as a filter, so it shouldn't be
taking much longer. I'll check it out. What you did here should work.

> I switched both that rule and the rule "4b" to including:
>
>  ~rdfs:Datatype(U), ~rdfs:Literal(U)
>
> and it no longer causes the literals to appear in subject position.
> ~rdf:Literal(U) didn't seem to work -- probably because the other
> rules that would connect instances of rdf:Datatype with rdf:Literal
> are not allowed to fire because they themselves would put literals in
> the subject position. :(

Also, I think you really need something that detects literals, as
opposed to finding statements that include this URI. I don't think
that's available right now, but it should be. I'll look for it, and if
it's not  available then I'll add it. Either way, I'll document it.
:-)

Paul



More information about the Mulgara-general mailing list