def __applyFormula3(self, currStatus, currResponse): targetURI = currResponse.url newStatus = derefresultpackage.Status(targetURI, 0, targetURI) self.result["formulaList"].append("formula(3)") self.result["targetURI"] = targetURI self.result["returnedDocURI"] = targetURI return newStatus
def __applyFormula2(self, currStatus, currResponse): requestURI = currStatus.requestURI status = currResponse.status returnedURI = currStatus.temporaryURI newStatus = derefresultpackage.Status(requestURI, status, returnedURI) self.result["formulaList"].append("formula(2)") self.result["returnedDocURI"] = returnedURI #self.result["isDocURI"] = 1 return newStatus
def __applyFormula4(self, currStatus, currResponse): targetURI = currStatus.requestURI returnedURI = currResponse.url status = currResponse.status newStatus = derefresultpackage.Status(targetURI, status, returnedURI) self.result["targetURI"] = targetURI self.result["returnedDocURI"] = returnedURI self.result["formulaList"].append("formula(4)") self.result["redirect303Num"] += 1 return newStatus
def __applyFormula5(self, currStatus, currResponse): targetURI = currStatus.requestURI newStatus = derefresultpackage.Status(targetURI, -2, "empty") self.result["targetURI"] = targetURI self.result["returnedDocURI"] = "empty" self.result["formulaList"].append("formula(5)") Validator.result["isBad"] = 1 ''' self.result["isValid"] = 0 self.result['isRDF'] = 0 self.result['isThing'] = 0 ''' return newStatus
def __applyFormula7(self, currStatus, currResponse): targetURI = currStatus.requestURI status = currStatus.statusCode returnURI = currStatus.temporaryURI newStatus = derefresultpackage.Status(targetURI, status, returnURI) self.result["targetURI"] = targetURI self.result["returnedDocURI"] = returnURI self.result["formulaList"].append("formula(7)") ''' if self.result['isHash'] and not self.result['isRDF']: self.result['isDocURI']=1 ''' ''' self.result['isDocURI']=0 if self.result['isRDF']: self.result['isThing']=1 ''' self.result['exitFrom8'] = 1 return newStatus
def __init__(self, uri): self.result = {} Validator.result = {} Validator.result["dereference result"] = [] Validator.result["isBad"] = 0 Validator.result["is400"] = 0 self.result["requestURI"] = uri self.result["targetURI"] = uri self.result["returnedDocURI"] = uri Validator.result["statusList"] = [] self.result["currStatus"] = derefresultpackage.Status(uri, 0, uri) Validator.result["statusList"].append(self.result["currStatus"]) self.result["isValid"] = 1 self.result["isRightImp"] = 1 self.result["foundRequest"] = 0 self.result["isRDF"] = 0 self.result["isDocURI"] = 0 self.result["isRightImp"] = 0 self.result["redirect303Num"] = 0 self.result["formulaList"] = [] self.result["isHash"] = 0 self.result["isSlash"] = 0 self.result["isComplyModel"] = 1 self.result['relatedTriple'] = [] self.result['isThing'] = 0 self.result['info'] = '' self.result['isException'] = 0 self.result['exceptionMsg'] = '' self.result['exceptionType'] = '' self.result['exitFrom8'] = 0 self.result['format'] = '' self.result[ 'returnFormat'] = '' # application/rdf+xml, application/rdf+n3, text/xml, text/html, Validator.result["statusCodeList"] = [] Validator.result["statusURLList"] = [] Validator.result['finalStatusAndURL'] = []
def __applyFormula6(self, currStatus, currResponse): requestURI = currStatus.requestURI newStatus = derefresultpackage.Status(requestURI, -1, currResponse.url) self.result["formulaList"].append("formula(6) ") self.result["returnedDocURI"] = currResponse.url return newStatus