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

Karsten Huneycutt kph at skuld.us
Mon Sep 28 02:31:05 UTC 2009


Hello --

On Sep 27, 2009, at 8:52 PM, Paul Gearon wrote:

> On Sun, Sep 27, 2009 at 6:54 PM, Karsten Huneycutt <kph at skuld.us>  
> wrote:
>
>> I did it that way (staging entailments graph) because I wasn't sure  
>> if
>> any invalid inferences would be removed from the entailments graph
>> during the reasoning process -- eg, if the source graph contains:
>>
>> A subclassOf B
>> A subclassOf C
>> B subclassOf D
>> C subclassOf E
>>
>> the reasoner would then assert in the entailments graph:
>>
>> A subclassOf D
>> A subclassOf E
>>
>> If the original assertion A subclassOf C is removed from the source
>> graph, would the reasoner remove A subclassOf E from the entailments
>> graph without the entailments graph being cleared first?
>
> No. RDF/RDFS/OWL are all monotonic, and the reasoner works with this
> assumption. Of course, in reality we need to remove data, but the
> reasoner is built around the theoretic framework rather than the
> pragmatic.

That's what I assumed, so I am using the staging graph. :)

>> On another note, I'm seeing some weird behavior.  I'm using rdfs-
>> krule.rdf (with krule.owl), and the reasoner is asserting things like
>>
>> "literal value here"^^<xsd:string> rdf:type rdfs:Literal
>> "literal value here"^^<xsd:string> rdf:type rdfs:Resource
>>
>> or
>>
>> "another literal"^^<xsd:string> rdf:type xsd:string
>> "another literal"^^<xsd:string> rdf:type rdfs:Resource
>>
>> That's clearly not valid RDF, and is causing problems trying to get
>> the data exported.  Is that expected, or is there something in the
>> source graphs that could be causing this?  The same thing happens  
>> with
>> rdfs.dl, too.
>
> It's not *supposed* to happen, and it never used to. I'll check this  
> out.
>
> These things are in fact correct assertions. However, RDF has an
> artificial restriction that literals cannot be subjects. (The
> restriction comes about because it's not possible to encode literal
> subjects in RDF/XML, which was the first dialect and had a lot of
> influence over the design of RDF).
>
> The reasoner is supposed to look for literal subjects and filter them
> out (you might see rules in rdfs.dl which include ~Literal). I thought
> it was working, but apparently something is wrong. I'll look at it
> tomorrow.

As currently distributed, instead of ~rdf:Literal, it says  
mulgara:UriReference.  But yeah, they're correct but invalid.

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).

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.

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. :(

KH

-- 
Karsten Huneycutt
kph at skuld.us







More information about the Mulgara-general mailing list