cliffxuan / fuxi

Automatically exported from code.google.com/p/fuxi
0 stars 0 forks source link

Add SPIN SPARQL RDFsyntax as output syntax for FuXi command-line #23

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
it would be nice (and straightforward) to be able to do:

$ FuXi --input-format=n3 --output=rif --rules=transitive-test.n3 Time to build 
production rule Forall ?Y ?X ?Z ( ex:hasAncestor(?X ?Z) :- And( 
ex:hasAncestor(?X ?Y) ex:hasAncestor(?X ?Z) ) )

$ FuXi --input-format=n3 --output=spin --rules=transitive-test.n3 Time to build 
production 

@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix ex: <http://example.com/terms#> .
@prefix sp: <http://spinrdf.org/sp>
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.

[ a  sp:Construct ;
      sp:templates ([ sp:object sp:_Z ;
                      sp:predicate ex:hasAncestor ;
                      sp:subject spin:_X
                    ]) ;
      sp:where ([ sp:object spin:_Y ;
                  sp:predicate ex:hasAncestor ;
                  sp:subject sp:_X
                ] 
                [ sp:object sp:_Z ;
                  sp:predicate ex:hasAncestor ;
                  sp:subject sp:_Y
                ])
    ]

Where transitive-test.n3 is:

@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix ex: <http://example.com/terms#> .

{ ?X ex:hasAncestor ?Y . ?X ex:hasAncestor ?Z } => { ?X ex:hasAncestor ?Z } .

This way n3 rules can be 'vizualized' within TopBraid composer, The OWL2 RL in 
RIF templateRules  algorithm (which FuXi supports) can be leveraged to generate 
efficient, custom SPIN rules from an OWL 2 RL ontology

Original issue reported on code.google.com by chime...@gmail.com on 29 Jul 2010 at 11:21