RDFLib / FuXi

Chimezie Ogbuji's FuXi reasoner. NON-FUNCTIONING, RETAINED FOR ARCHIVAL PURPOSES. For working code plus version and associated support requirements see:
http://code.google.com/p/fuxi/
51 stars 28 forks source link

Please does anybody could help me with Inferences? #3

Closed rabriol closed 11 years ago

rabriol commented 11 years ago

I`m trying to make same inference based on Fuxi-1.4.2+rdflib-2.4.2 library. My code is:

    foafNS = Namespace('http://xmlns.com/foaf/0.1/')
    latinNs = Namespace('http://www.latinamerica.com/')
    owlNS = Namespace('http://www.w3.org/2002/07/owl#')
    rdfNS = Namespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#')
    rdfsNS = Namespace('http://www.w3.org/2000/01/rdf-schema#')
    xsdNS = Namespace('http://www.w3.org/2001/XMLSchema#')

    rdfType = rdfNS['type']

    t = ConjunctiveGraph()

    t.bind('la', latinNs)
    t.bind('foaf', foafNS)
    t.bind('rdfs', rdfsNS)
    t.bind('rdf', rdfNS)
    t.bind('owl', owlNS)

    t.add((latinNs['Document'], rdfType, owlNS['Class']))
    t.add((latinNs['Article'], latinNs['subClassOf'], latinNs['Document']))

    print t.serialize(format= 'xml')

    rule_store, rule_graph, network = SetupRuleStore(makeNetwork=True)
    network.inferredFacts = ConjunctiveGraph()

    for rule in HornFromN3('file:///Users/rafaeuoliveira/Developer/workspace/python/tgi/resources/rules.n3'):
        print rule
        network.buildNetworkFromClause(rule)

    network.feedFactsToAdd(generateTokenSet(t))

    for inferred in network.inferredFacts:
        t.add(inferred)

    print t.serialize(format='xml')

my rules.n3 is:

@prefix owl: <'http://www.w3.org/2002/07/owl#'>. @prefix rdfs: <'http://www.w3.org/2000/01/rdf-schema#'>. @prefix foaf: <'http://xmlns.com/foaf/0.1/'>. @prefix la: <'http://www.latinamerica.com/'>.

{ ?x la:subClassOf ?y. ?y a ?z} => {?x a ?z}.

but when I printed, it still don`t making any inference that should be:

Article is a type of Class

Does anybody could help me to understand what`s wrong?

gromgull commented 11 years ago

cross posted here: http://answers.semanticweb.com/questions/22590/pelase-help-me-making-inference-on-fuxi?page=1&focusedAnswerId=22591#22591

rabriol commented 11 years ago

Im Sorry Gunnar, I didnt know that was shared the two enviroments. The next questions I will make only in one of them. So thank you to had helped me on others semanticweb.com.