processor.py 文件源码

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

项目:bibcat 作者: KnowledgeLinks 项目源码 文件源码
def __generate_reference__(self, triple_map, **kwargs):
        """Internal method takes a triple_map and returns the result of
        applying to XPath to the current DOM context

        Args:
        -----
            triple_map: SimpleNamespace
            element: etree.Element
        """
        element = kwargs.get("element")
        found_elements = element.xpath(
            triple_map.reference,
            namespaces=self.xml_ns)
        for elem in found_elements:
            raw_text = elem.text.strip()
            #! Quick and dirty test for valid URI
            if not raw_text.startswith("http"):
                continue
            return rdflib.URIRef(raw_text)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号