考虑一个如下句子:

John Smith旅行到华盛顿。

名称标签将在美好的一天识别'John Smith'作为一个人,并“华盛顿”作为一个地方。但是,没有其他证据,它无法判断所有可能的'约翰史密斯在世界上的哪个,甚至是各种华盛顿的哪一个,它已经得到了。

最终,一些解决方法可能根据其他证据决定。然而,直到这一点,在RDF中代表这些参考资料是什么是良好做法?在某些命名空间中指定构成唯一标识符?制作空白元组(例如,某些名为John Smith的人在Document D'中引用了其他一些选择?一本书,我给了一个涉及匿名天气站的例子,但我并不符合他们的榜样如何适应其他关于rdf的所有其他东西。

有帮助吗?

解决方案

在您自己的命名空间中分配唯一标识符。如果您稍后发现此“华盛顿州”与。或者其他,您可以添加猫头鹰:sameas以断言。

其他提示

首先,存在现有的优质服务,您可以用于实体识别,例如 opencalais ,<一个href=“http://www.zemanta.com/”rel=“nofollow noreferrer”> zemanta 和 alchemy

更具体,是的,是的,只是对每件事的自己的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提升。

您可以按照上面讨论的,或者使用空白节点来施用您自己的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文本/普通片段标识符唯一地标识正在处理的文件,这为您提供了灵活性,您希望如何识别单个运行。替代方案是在文档根的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有一系列猫头鹰:东西,所以它可以应用于任何东西。替代方案可能使用skos:概念和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 .
.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top