Comments on N3 and its use for writing rules

I have now read these pages of yours:
        http://www.w3.org/DesignIssues/Notation3.html
        http://www.w3.org/DesignIssues/Anonymous.html
        http://www.w3.org/2000/10/swap/Primer.html

There is a lot on inconsistencys.  Both <#g> and '#g' and :g is used.
But <#g> is not defiend in the BNF.  I guess you have replaced '' with
<>.

I also guess that the dot at the end inside {} is optional.




EXPLOSION OF NESTED MODELS

(I am using the word model[1], since I have put a diffrent meaning in
the word context[7].)

I would like to comment on the last part of the Primer:

    <> log:forAll :p, :q.
    { :p ont:inverse :q } log:implies
    {
      {
        { :x :p :y } log:implies { :y :q :x }
      } a log:Truth; log:forAll :x, :y.
    }.

And Now blow it to pieces, using the format "Model Stating[2]
Subject Predicate Object" (Triple, quad, whats next? penta something?)

  C00  S01  C00   log:forAll   :p
  C00  S02  C00   log:forAll   :q
  C01  S03  :p    ont:inverse  :q
  C02  S04  :x    :p           :y
  C03  S05  :y    :q           :x
  C04  S06  C02   log:implies  C03
  C05  S07  C04   rdf:type     log:Truth
  C05  S08  C04   log:forAll   :x
  C05  S09  C04   log:forAll   :y
  C00  S10  C01   log:implies  C05


That log:Truth statement got me thinking.  Let's consider your first
rule of models: "The statements are all independent, in that you can
remove any of the statements and the rest are still true".

What happens if we kill S07?  We would still have the statements S08
and S09.  Can't we implicitly say that C4 is true for all :x and :y?

Ok. Maby not.



Now, let us see this thing in action.  We start by Inserting some
seeds in the system.  Here we declare our trust in the infered
statements [3], here placed in L01:

  C11  S11 C00    rdf:type     log:Truth
  C11  S12 :child ont:inverse  :parent
  C11  S13 :agnus :child       :bengt
  C11  S14 L01    rdf:type     log:Truth


And now press GO!

  R01  L01->imports( C11 )
  R02  L01->imports( C00 )
  R03  L01->state( :p, rdf:type, log:variable )
  R04  L01->state( :q, rdf:type, log:variable )
  R05  L02 = L01->eval( C01 )
  R06  L01->find( *, ont:inverse, * )
  R07  L01->state( :p, =, :child )
  R08  L01->state( :q, =, :parent )
  R09  L01->imports( C05 )
  R10  L01->state( :x, rdf:type, log:variable )
  R11  L01->state( :y, rdf:type, log:variable )
  R12  L03 = L01->eval( C04 )
  R13  L04 = L01->eval( C02 )
  R14  L01->find( *, :child, * )
  R15  L01->state( :x, =, :agnus )
  R16  L01->state( :y, =, :bengt )
  R17  L03->imports( C03 )
  R18  L03->state( :bengt, :parent, :agnus )
  R19  L01->imports( L03 )

Ok. That seems to work. :)

This was just some pseudocode I invented as I wrote it. The  L01-L04 is
models produced by the inference function.  R01-R19 are just row
numbers.  The L01->f() syntax is for specifying in which model the
function operates.  See the Wraf API [4].

I was trying to find out for myself if we could keep the models
separated as in your example with an inner and outer model.


In Wraf, I will mostly use inverse inference.  I will start with the
sought after property and determine its value.  We just have to turn
the logic functions outside in.




BINDING QUANTIFIERS

I don't think it's necessary to bind quantifiers to a specific
model.  All statings already are in a model.  Look at S01 and
S02 above.  You don't have to say the same thing twice.  log:forAll is
not a binary predicate.

I suggest we declare them as special types of variables:

    log:Variable rdf:type rdfs:Class.
    log:ForAll rdfs:subClassOf log:Variable.



  UNIVERSAL

I don't think it is meaningful to say in what model a resource is a
variable and in what model it isn't.  The result would be the same
if you said:

    <> log:forAll :p, :q, :x, :y.
    { :p ont:inverse :q } log:implies
    {
        { :x :p :y } log:implies { :y :q :x }
    }.

Or, treating them as variables:

    my:revtype ont:inverse rdf:type.
    log:ForAll my:revtype :p, :q, :x, :y.
    { :p ont:inverse :q } log:implies
    {
        { :x :p :y } log:implies { :y :q :x }
    }.

Hehe.  And thats Yet Another Recursive Dependency (YARD). ;-)



  EXISTENTIAL

So, what about log:forSome ?  In the Notation3 page under #quoting,
you give the example:

  {
    [x:firstname "Ora"] dc:wrote [dc:title "Moby Dick"]
  } a n3:falsehood .

And you give this translation (model, stating, p, s, o ):

 #c1  #s1  n3:forSome         #c1    #g1
 #c1  #s2  x:firstname        #g1    "Ora"
 #c1  #s3  n3:forSome         #c1    #g2
 #c1  #s4  dc:wrote           #g1    #g2
 #c1  #s5  dc:title           #g2    "Moby Dick"
 doc  #s6  n3:forSome         doc    #c1
 doc  #s7  n3:subExpression   doc    #c1
 doc  #s8  rdf:type           #c1    n3:falsehood


Hum...  I don't agree with #s6.  The model #c1 says that there exist
some #g1 and #g2 such that #g1 wrote #g2.  #s8 negates that.  #s6
doesn't make sense. #c1 is an generated resource. But it's properties
is fully defined. #c1 is not a variable.

Futher, there is no need for #s7.


We can write back the remaining statings in n3, using the method from
above:

  n3:ForSome my:revtype :g1, :g2.
  :c1 =
  {
    :g1 x:firstname "Ora".
    :g1 dc:wrote :g2.
    :g2 dc:title "Moby Dick".
  } a n3:falsehood .



  BOTH UNIVERSAL AND EXISTENTIAL

Notation3 page section #quantification gives this example:

    {{:g :loves :h} log:forSome :g} log:forAll :h.

My nonattached version is ambigous:

    :g a log:ForSome.
    :h a log:forAll.
    :g :loves :h.

:g and :h is variables.  Let me rewrite a bit:

    :g a log:ForSome.
    :h a log:forAll.
    :h log:implies { :g :loves :h }.

Now, that takes care of it.  And for the other direction:

    :g a log:ForSome.
    :h a log:forAll.
    :g log:implies { :g :loves :h }.

Now, a lone resource is here taken to mean "{ :g a rdfs:Resource}".
But we would usually say something more about the resource.  Probably
this:

    :g a log:ForSome.
    :h a log:forAll.
    {:h a ont:Person} log:implies { :g :loves :h }.




THE MODEL FOR INFERED STATINGS

The Notation3 page introduces the log:parsesTo predicate.  I don't
like that name.

The thing here is that we in some way declare our trust[5] in a) source
data and b) a inference service[6].  When we ask the service to find some
infered data for us, we tell it what sources we trust.  We resulting
statings is placed in a separate model.

This resulting model should have metadata saying that it is infered
data, and the inference service and source data used.  The same source
model can be used in many inference models and the same inference
model can use many sources.

Let the model with the infered statings declare its sources.  If we
wan't we can state the trust in the resulting data.



 [1] http://uxn.nu/wraf/RDF-Service/doc/html/model.html
 [2] http://uxn.nu/wraf/RDF-Service/doc/html/stating.html
 [3] http://uxn.nu/wraf/RDF-Service/doc/html/inference.html
 [4] http://uxn.nu/wraf/RDF-Service/doc/html/api.html
 [5] http://uxn.nu/wraf/RDF-Service/doc/html/trust.html
 [6] http://uxn.nu/wraf/RDF-Service/doc/html/service.html
 [7] http://uxn.nu/wraf/RDF-Service/doc/html/context.html

-- 
/ Jonas Liljegren

The Wraf project http://www.uxn.nu/wraf/
Sponsored by http://www.rit.se/

Received on Tuesday, 13 March 2001 09:16:52 UTC