From: Peter B. <pb...@xs...> - 2005-02-14 13:29:32
|
Hello, I've begun using an InfModelF to add tripels to my model based on subclasses defined in the ontology. This is a great help. If a subclass b b subclass c i type a the model correctly infers that i type b i type c I incorrectly assumed the model would also infer a subclass c As I need the transitive closure of the subclass relation for the purpose of querying the model, what I used to do is compute it myself and store it in auxiliary files. I hoped the inference engine would save me the trouble. I have tried adding, in InfModel.php, in the function _addToInference, after case RDF_SCHEMA_URI.RDFS_SUBCLASSOF : $infRule2=new InfRule(); $infRule2->setTrigger(null,new Resource(RDF_SCHEMA_URI.RDFS_SUBCLASSOF),$statement->getSubject()); $infRule2->setEntailment('<s>',new Resource(RDF_SCHEMA_URI.RDFS_SUBCLASSOF),$statement->getObject()); $this->infRules[]=$infRule2; $this->_addInfRule($infRule2,$statementPosition); $infRule3=new InfRule(); $infRule3->setTrigger($statement->getObject(),new Resource(RDF_SCHEMA_URI.RDFS_SUBCLASSOF),null); $infRule3->setEntailment($statement->getSubject(),new Resource(RDF_SCHEMA_URI.RDFS_SUBCLASSOF),'<o>'); $this->infRules[]=$infRule3; $this->_addInfRule($infRule3,$statementPosition); which doesn't seem to work, and maybe I don't really know what I am doing here. Anyone has an idea on how to get the kind of inference that I need? Thanks, Peter |