options.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:prophet 作者: MKLab-ITI 项目源码 文件源码
def add_http_context(self, subj, http_code) :
        """
        Add an additional HTTP context to a message with subject in C{subj}, using the U{<http://www.w3.org/2006/http#>}
        vocabulary. Typically used to extend an error structure, as created by L{add_triples}.

        @param subj: an RDFLib resource, typically a blank node
        @param http_code: HTTP status code
        """
        bnode = BNode()
        self.graph.add((subj, ns_rdfa["context"], bnode))
        self.graph.add((bnode, ns_rdf["type"], ns_ht["Response"]))
        self.graph.add((bnode, ns_ht["responseCode"], URIRef("http://www.w3.org/2006/http#%s" % http_code)))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号