1. Doug Burke
  2. swish
  3. Issues
Issue #3 resolved

Scripts do not work as expected

Doug Burke
repo owner created an issue

Of the three scripts provided in the 0.3.0.1 release, only VehicleCapacity.ss works; the other two (SwishExample.ss and SwishTest.ss) fail to validate the proof - e.g.

{{{

!sh

% ./Swish -s=SwishExample.ss Swish 0.3.0.1

Charles is male and has parent Tom

Dmitry Bobrov rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# . Dmitry Bobrov rdfs: http://www.w3.org/2000/01/rdf-schema# . Dmitry Bobrov rdfd: http://id.ninebynine.org/2003/rdfext/rdfd# . Dmitry Bobrov owl: http://www.w3.org/2002/07/owl# . Dmitry Bobrov log: http://www.w3.org/2000/10/swap/log# . Dmitry Bobrov : http://id.ninebynine.org/default/ . Dmitry Bobrov ex: http://id.ninebynine.org/wip/2003/swishtest/ . Dmitry Bobrov pv: http://id.ninebynine.org/wip/2003/swishtest/pv/ . Dmitry Bobrov xsd: http://www.w3.org/2001/XMLSchema# . Dmitry Bobrov xsd_integer: http://id.ninebynine.org/2003/XMLSchema/integer# . Dmitry Bobrov rs_rdf: http://id.ninebynine.org/2003/Ruleset/rdf# . Dmitry Bobrov rs_rdfs: http://id.ninebynine.org/2003/Ruleset/rdfs# . :Charles ex:parent :Tom ; a ex:Male .

Proof not satisfied: ex:Proof01, Invalid step: ex:Step01c: rule does not deduce consequence from antecedents There was a problem executing a Swish script.

Swish: There was a problem executing a Swish script. }}}

(SwishTest.ss will fail unless the directory data/ exists since it writes files to that directory).

Comments (4)

  1. Doug Burke reporter

    SwishTest.ss fails because the graph

    @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
    @prefix : <http://id.ninebynine.org/default/> .
    _:b1 :seatedCapacity "30"^^xsd:integer ;
         :totalCapacity "50"^^xsd:integer ;
         a :PassengerVehicle .
    _:b2 :standingCapacity "20"^^xsd:integer ;
         :totalCapacity "50"^^xsd:integer ;
         a :PassengerVehicle .
    

    gets written out as

    @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
    @prefix : <http://id.ninebynine.org/default/> .
    [
     :seatedCapacity "30"^^xsd:integer ;
     :totalCapacity "50"^^xsd:integer ;
     a :PassengerVehicle
    ] .
    

    It looks like the N3 formatter is discarding the second bnode, probably because of the conversion to use "[]" syntax. The NTriples formatter creates the expected graph (ie 6 statements with two bnodes).

  2. Doug Burke reporter

    I have decided that the SwishExample.ss script - which is a copy of the version described at http://www.ninebynine.org/RDFNotes/Swish/Intro.html#ScriptExample - is actually wrong, and Swish is doing the right thing by failing to prove ex:Proof01. The proof should read something like

    @proof ex:Proof01 ( rs_rdf:rules rs_rdfs:rules )
      @input  ex:Input01
      @step   rs_rdfs:r3 ( rs_rdfs:a10 rs_rdfs:a39 )
              => ex:Step01a :- { rdfs:Literal rdf:type rdfs:Class . }
      @step   rs_rdfs:r8 ( ex:Step01a )
              => ex:Step01b :- { rdfs:Literal rdfs:subClassOf rdfs:Resource . }
      @step   rs_rdf:lg ( ex:Input01 )
              => ex:Step01c1 :- { ex:foo ex:prop _:a . _:a rdf:_allocatedTo "a" . }
      @step   rs_rdfs:r1 ( ex:Step01c1 )
              => ex:Step01c2 :- { _:a rdf:type rdfs:Literal . }
      @step   rs_rdfs:r9 ( ex:Step01b ex:Step01c2 )
              => ex:Step01d :- { _:a rdf:type rdfs:Resource . }
      @step   rs_rdf:se  ( ex:Step01c1 ex:Step01c2 ex:Step01d )   => ex:Result
      @result ex:Result
    

    The script has been updated to use this version as of 603527401676 . I'll close the bug once 0.3.0.3 has been released.

  3. Log in to comment