FuXi 1.4.1 released

89 views
Skip to first unread message

Chimezie Ogbuji

unread,
Jun 12, 2013, 12:03:54 AM6/12/13
to fuxi-discussion
Driven by recent issues regarding the installation of FuXi 1.4, I
removed the dependency on easy_install / setuptools and switched to
pip as the installation method. I probably should have done this a
while ago.

I pushed this minor release to PyPi as FuXi 1.4.1. I have also
updated the installation wiki [1] as well as the main page to reflect
the use of pip for installation, the fact that FuXi depends on
layercake-python and not rdflib, and a link to the rdflib-4+ port of
FuXi. A snapshot of layercake-python will now be kept here [2] (for
use with pip installation as shown in the install wiki)

[1] https://code.google.com/p/fuxi/wiki/Installation_Testing
[2] https://fuxi.googlecode.com/hg/layercake-python.tar.bz2

-- Chime

ptwobr...@gmail.com

unread,
Jun 13, 2013, 12:16:17 AM6/13/13
to fuxi-di...@googlegroups.com
This is a nice update as far as simplified documentation and install goes.

One thing I'm not sure about, though, is that one of my toy examples that worked with previous versions of FuXi and works with the rdflib-4+ port on GitHub no longer produces any output with v1.4.1. Has anything changed that would prevent the following invocation from working as expected? I don't see anything in --help that suggests I'd now need an additional parameter to capture my output by perhaps I'm overlooking something.

FuXi --rules=chuck-norris.n3 --ruleFacts


My sample file, chuck-norris.n3

####################################################
#Assign a namespace for logic predicates
@prefix log: <http://www.w3.org/2000/10/swap/log#> .

#Assign a namespace for the vocabulary defined in this document
@prefix : <MiningTheSocialWeb#> .

#Socrates is a man
:Socrates a :Man.

@forAll :x .

#All men are mortal: Man(x) => Mortal(x)
{ :x a :Man } log:implies { :x a :Mortal } .

#Only gods live at Mt Olympus: Lives(x, MtOlympus) <=> God(x)
{ :x :lives :MtOlympus } log:implies { :x a :god } .
{ :x a :god } log:implies { :x :lives :MtOlympus } .

#All mortals drink whisky: Mortal(x) => Drinks(x, whisky)
{ :x a :Man } log:implies { :x :drinks :whisky } .

#Chuck Norris lives at Mt Olympus: Lives(ChuckNorris, MtOlympus)
:ChuckNorris :lives :MtOlympus .
####################################################


Previously, I'd get output similar to the following:

'Parsing RDF facts from ', 'chuck-norris.n3')
('Time to calculate closure on working memory: ', '1.70803070068 milli seconds')
<Network: 3 rules, 6 nodes, 3 tokens in working memory, 3 inferred tokens>
@prefix : <file:///Users/matthew/business-and-consulting/Mining-the-Social-Web/git/mtsw2e-github/ipynb/resources/ch08-semanticweb/MiningTheSocialWeb#> .
@prefix iw: <http://inferenceweb.stanford.edu/2004/07/iw.owl#> .
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skolem: <http://code.google.com/p/python-dlp/wiki/SkolemTerm#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

:ChuckNorris a :god .

:Socrates a :Mortal ;
:drinks :whisky .

With v1.4.1, I only get "Parsing RDF facts from chuck-norris.n3" with no additional output. This is all installed into a clean virtualenv using Python 2.7 and pip 1.2.1 in case that's helpful.
> --
> You received this message because you are subscribed to the Google Groups "fuxi-discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to fuxi-discussi...@googlegroups.com.
> To post to this group, send email to fuxi-di...@googlegroups.com.
> Visit this group at http://groups.google.com/group/fuxi-discussion?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Chimezie Ogbuji

unread,
Jun 15, 2013, 7:44:00 PM6/15/13
to fuxi-discussion
Hey Matt.

As it turned out, some recent changes to the command-line removed the
naive forward chaining capability, as FuXi is now more focused on
backward chaining reasoning with the recent addition of a more
advanced reasoning engine [1]. So, the invocations below were not
working. For the sake of backwards compatibility, I restored that
capability via the --naive option and have re-released 1.4.1 (so you
will need to reinstall that version of FuXi). I was able to reproduce
your example and demonstrate the use of the forward-chaining engine as
well (note I added an explicit base for the NS primarily so I could
use a qName in the second invocation below):

$ FuXi --rules=chuck-norris.n3 --ruleFacts --naive
Parsing RDF facts from chuck-norris.n3
Time to calculate closure on working memory: 1.54685974121 milli seconds
<Network: 3 rules, 6 nodes, 3 tokens in working memory, 3 inferred tokens>
@prefix : <http://example.com/MiningTheSocialWeb#> .

:ChuckNorris a :god .

:Socrates a :Mortal;
:drinks :whisky .

Below is an invokation using the preferred reasoning method

$ FuXi --rules=chuck-norris.n3 --ruleFacts
--ns=ex=http://example.com/MiningTheSocialWeb# --why="ASK {
ex:ChuckNorris a ex:god }" --debug
.. snip ..
Dispatched query against dataset: ASK { :ChuckNorris :lives :MtOlympus }
Time to reach answer ground goal answer of True: 134.645938873 milli seconds

This shows the meta-interpreter invoking a (ground) SPARQL query
against the dataset in order to answer the original query

Hopefully, this clarifies things.

-- Chime

[1] https://code.google.com/p/fuxi/wiki/Overview#Backward_Chaining_/_Top_Down_Evaluation

ptwobrussell

unread,
Jun 15, 2013, 7:50:22 PM6/15/13
to fuxi-di...@googlegroups.com, fuxi-discussion
Excellent, thank you for this update. It will be very useful to me, and I will test it out tonight.
> Visit this group at http://groups.google.com/group/fuxi-discussion.

Matthew Russell

unread,
Jun 17, 2013, 1:42:13 PM6/17/13
to fuxi-di...@googlegroups.com
Chime - 

I can get the expected results with the functionality you backported just fine with the latest 1.4.1 in a clean virtualenv, and that's all I really need at the moment, but just as a heads up, I can't get the expected output with the new "preferred" reasoning method. Here's what's happening in case you have any thoughts. (I am just regurgitating your prior guidance on what to do.)

######################
# Expected results...
######################


(test-fuxi-2)Goblin:test-fuxi-2 matthew$ FuXi --rules=chuck-norris.n3 --ruleFacts --naive
Parsing RDF facts from  /Users/matthew/business-and-consulting/Mining-the-Social-Web/git/mtsw2e-github/ipynb/resources/ch08-semanticweb/chuck-norris.n3
Time to calculate closure on working memory:  0.918865203857 milli seconds
<Network: 3 rules, 6 nodes, 3 tokens in working memory, 3 inferred tokens>
@prefix : <file:///Users/matthew/business-and-consulting/Mining-the-Social-Web/git/mtsw2e-github/ipynb/resources/ch08-semanticweb/MiningTheSocialWeb#> .

:ChuckNorris a :god .

:Socrates a :Mortal;
    :drinks :whisky .

######################
# Unexpected results (?)...
######################


(test-fuxi-2)Goblin:test-fuxi-2 matthew$ FuXi --rules=chuck-norris.n3 --ruleFacts --ns=ex=http://example.com/MiningTheSocialWeb# --why="ASK {ex:ChuckNorris a ex:god }" --debug
Parsing RDF facts from  chuck-norris.n3
No SIP graph!
Query was ground
Asserting initial BFP query  ex:god_query_b(ex:ChuckNorris)
<Network: 0 rules, 0 nodes, 0 tokens in working memory, 0 inferred tokens>

None
Time to reach answer ground goal answer of False: 4.78792190552 milli seconds
(test-fuxi-2)Goblin:test-fuxi-2 matthew$ 

In your sample output, it appeared that there would have been evidence cited as par tof the --why query?

Chimezie Ogbuji

unread,
Jun 19, 2013, 1:34:50 PM6/19/13
to fuxi-discussion
Hey Matt. Thanks for the feedback. See my response inline below.

On Mon, Jun 17, 2013 at 1:42 PM, Matthew Russell <ptwobr...@gmail.com> wrote:
> Chime -
>
> I can get the expected results with the functionality you backported just
> fine with the latest 1.4.1 in a clean virtualenv, and that's all I really
> need at the moment,

Ok.

> but just as a heads up, I can't get the expected output
> with the new "preferred" reasoning method. Here's what's happening in case
> you have any thoughts. (I am just regurgitating your prior guidance on what
> to do.)

> ..snip..
> ######################
> # Unexpected results (?)...
> ######################
> ..snip..
> No SIP graph!

This indicates that it can't find a combination of rules that could
provide answers to the query. I suspect the issue is the namespace
declaration I gave for your N3 graph. Mine is:

--------------------

####################################################
#Assign a namespace for logic predicates
@prefix log: <http://www.w3.org/2000/10/swap/log#> .

#Assign a namespace for the vocabulary defined in this document
@prefix : <http://example.com/MiningTheSocialWeb#> .

#Socrates is a man
:Socrates a :Man.

@forAll :x .

#All men are mortal: Man(x) => Mortal(x)
{ :x a :Man } => { :x a :Mortal } .

#Only gods live at Mt Olympus: Lives(x, MtOlympus) <=> God(x)
{ :x :lives :MtOlympus } => { :x a :god } .
{ :x a :god } => { :x :lives :MtOlympus } .

#All mortals drink whisky: Mortal(x) => Drinks(x, whisky)
{ :x a :Man } => { :x :drinks :whisky } .

#Chuck Norris lives at Mt Olympus: Lives(ChuckNorris, MtOlympus)
:ChuckNorris :lives :MtOlympus .
####################################################

--------------------

Is your base URI (specified by the empty prefix) the same as above or
is it as it was in your original graph? If it is different, that would
explain the discrepancy.


> In your sample output, it appeared that there would have been evidence cited
> as par tof the --why query?

The original intent of the --why option was to give evidence, but the
proof generation capabilities are still a work in progress. For now,
the only evidence is what is given by the --debug option when used
with --why. So,
in the end the name of the --why option is misleading. It really
should be ---prove instead.

-- Chime

ptwobr...@gmail.com

unread,
Jun 28, 2013, 7:48:06 PM6/28/13
to fuxi-di...@googlegroups.com
Chime - Thank you. I understand now, and you were right that I needed up make sure that my namespace for the example vocabulary was a proper URI. Everything seems to be in order now.
Reply all
Reply to author
Forward
0 new messages