rdf表示文本中的实体引用

时间:2010-07-17 17:12:21

标签: rdf named-entity-extraction

考虑如下句子:

  约翰史密斯前往华盛顿。

名人标签可以在美好的一天识别出“约翰史密斯”作为一个人,而“华盛顿”作为一个地方。然而,如果没有其他证据,它无法分辨出世界上哪个可能的“约翰史密斯”,或者甚至是“华盛顿”中的哪一个,它都有。

最终,根据其他证据,某些决议程序可能会决定。但是,在那之前,在RDF中表示这些引用的好方法是什么?在某些命名空间中为它们分配了唯一的标识符?制作空白元组(例如'在文档d'中引用了一些名为John Smith的人。)?还有其他选择吗?我的一本书给出了一个涉及匿名气象站的例子,但我并不完全了解他们的例子如何适应所描述的RDF的所有其他内容。

4 个答案:

答案 0 :(得分:3)

在您自己的命名空间中为它们分配唯一标识符。如果你后来发现这个“华盛顿”与http://dbpedia.org/resource/Washington,_D.C。或者其他什么相同,你可以添加一个owl:sameAs来断言。

答案 1 :(得分:2)

首先,您可以使用现有的良好服务进行实体识别,例如OpenCalaisZemantaAlchemy

更具体一点,是,简单地“铸造”你自己的每个东西的URI(标识符),然后谈论它们 - 在乌龟中提供这个信息的表示

@prefix : <http://yourdomain.com/data/> .
@prefix myont: <http://yourdomain.com/ontology/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix dbpedia-owl: <http://dbpedia.org/ontology/Place>.
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

:John_Smith#d rdf:type foaf:Person ;
  foaf:name "John Smith"@en .

:Washington#d rdf:type dbpedia-owl:Place ;
  rdfs:label "Washington"@en .

:John_Smith#d myont:travelled_to :Washington#d .

<http://yourdomain.com/some-doc#this> rdf:type foaf:Document ;
  dcterms:references :John_Smith#d, :Washington#d .

如果你以后匹配它们,那么你可以使用owl:sameAs作为glenn mcdonald提及。

答案 2 :(得分:1)

您可能需要阅读Apache Stanbol的工作原理:http://stanbol.apache.org/docs/trunk/components/enhancer/enhancementstructure.html

答案 3 :(得分:0)

您可以如上所述制作自己的URI,也可以使用空白节点。两种方法都有利弊:

URI具有外部标识,因此您可以在将来的查询中明确引用您的概念,这可以使某些查询更简单;但是,他们有一个外部身份,因此用于构建URI的算法成为您基础架构的关键部分,您必须保证它们既稳定又独特。一开始这可能是微不足道的,但是当你开始处理在不同时间(通常是并行)和分布式系统上重新处理的多个文档时,它很快就不再是直接的了。

空白节点专门用于解决这个问题,它们的独特性得到了它们的范围保证;但是,如果您需要明确地在查询中引用空白节点,则需要使用非标准扩展,或者找到某种方式来表征该节点。

在这两种情况下,尤其是你应该使用空白节点时,你应该包括来源陈述来表征它。

@ nathan的例子是一个很好的例子。

所以使用空白节点的例子可能是:


@prefix my: <http://yourdomain.com/2010/07/20/conceptmap#> .
@prefix proc: <http://yourdomain.com/2010/07/20/processing#> .
@prefix prg: <http://yourdomain.com/processors#> .

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.example.org/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix doc: <http://yourdomain.com/doc-path/> .

_:1 rdf:type proc:ProcessRun ; 
    proc:parser prg:tagger ;
    proc:version "1.0.2" ;
    proc:time "2010-07-03 20:35:45"^^<xsd:Timestamp> ;
    proc:host prg:hostname-of-processing-node ;
    proc:file doc:some-doc#line=1,;md5=md5_sum_goes_here,mime-charset_goes_here ;

_:2 rdf:type foaf:Person ;
    foaf:name "John Smith"@en ;
    proc:identifiedBy _:1 ;
    proc:atLocation doc:some-doc#char=0,9 .


_:3 rdf:type owl:Thing ;
    foaf:name "Washington"@en ;
    proc:identifiedBy _:1 ;
    proc:atLocation doc:some-doc#char=24,33 .

<http://yourdomain.com/some-doc#this> rdf:type foaf:Document ;
                                      dcterms:references _:2, _:3 .

请注意使用rfc5147 text / plain片段标识符来唯一标识正在处理的文件,这为您提供了如何识别单个运行的灵活性。另一种方法是在文档根目录的URI中捕获所有这些,或者完全放弃起源。


@prefix : <http://yourdomain.com/ProcessRun/parser=tagger/version=1.0.2/time=2010-07-03+20:35:45/host=hostname-of-processing-node/file=http%3A%2F%2Fyourdomain.com%2Fdoc-path%2Fsome-doc%23line%3D1%2C%3Bmd5%3Dmd5_sum_goes_here%2Cmime-charset_goes_here/$gt; .

@prefix my: <http://yourdomain.com/2010/07/20/conceptmap#> .
@prefix proc: <http://yourdomain.com/2010/07/20/processing#> .
@prefix prg: <http://yourdomain.com/processors#> .

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.example.org/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix doc: <http://yourdomain.com/doc-path/some-doc#> .

:1 rdf:type proc:ProcessRun ; 
    proc:parser prg:tagger ;
    proc:version "1.0.2" ;
    proc:time "2010-07-03 20:35:45"^^<xsd:Timestamp> ;
    proc:host prg:hostname-of-processing-node ;
    proc:file doc:some-doc#line=1,;md5=md5_sum_goes_here,mime-charset_goes_here ;

:2 rdf:type foaf:Person ;
    foaf:name "John Smith"@en ;
    proc:identifiedBy :1 ;
    proc:atLocation doc:some-doc#char=0,9 .


:3 rdf:type owl:Thing ;
    foaf:name "Washington"@en ;
    proc:identifiedBy :1 ;
    proc:atLocation doc:some-doc#char=24,33 .

<http://yourdomain.com/some-doc#this> rdf:type foaf:Document ;
                                      dcterms:references :2, :3 .

你会注意到foaf:name有一系列owl:Thing,所以它可以应用于任何东西。另一种方法是使用skos:Concept和rdfs:标签为专有名词。

空白节点与URI的最后一个考虑因素是,您使用的任何数据存储最终都必须存储您使用的任何URI,如果您使用非常大的数据集,这可能会影响性能。

最终,如果我要在图表中发布出处信息以及最终的统一实体,我会倾向于使用空白节点并将URI分配给我最终统一实体的概念。

但是,如果我不打算跟踪推论的来源,这只是管道中的许多通道,最终会丢弃中间结果,我只会使用某种文档哈希,时间戳来填充URI。和id,并完成它。

@prefix : <http://yourdomain.com/entities#> .
@prefix my: <http://yourdomain.com/2010/07/20/conceptmap#> .

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .

:filename_timestamp_1 rdf:type foaf:Person ;
                      foaf:name "John Smith"@en .

:filename_timestamp_2 rdf:type owl:Thing ;
    foaf:name "Washington"@en .

<http://yourdomain.com/some-doc#this> rdf:type foaf:Document ;
                                      dcterms:references :2, :3 .