我有以下资源: http://test.com/domainOnt/email#[email protected]
与 RDFLib 一样,当您在图中搜索 this 时,它会返回一个 URIRef 对象。我想从对象中删除命名空间,使其变为[email protected]
如有任何帮助,我们将不胜感激
split。如果所有类名都用“#”与命名空间分隔,则以下内容将起作用。
resource = URIRef('http://test.com/domainOnt/email#[email protected]')
print resource.split('#')[-1]
这个
问题和答案与您的非常相似。
resource = URIRef('http://test.com/domainOnt/email#[email protected]')
result = resource.fragment