在Web注释数据模型中使用RDF语句作为主体?

在Web注释数据模型中使用RDF语句作为主体?,rdf,semantic-web,protege,Rdf,Semantic Web,Protege,我试图使用,以便在RDF语句中添加出处信息 为了澄清问题,我的本体中的每个RDF语句(典型的主谓宾三元组)都是基于特定自由文本片段上提供的知识创建的。我想在每个RDF语句上创建一个WADM注释,将RDF语句本身作为主体,并将相应的自由文本片段作为目标 将自由文本片段作为目标对我来说是很清楚的。然而,我似乎找不到一个用RDF语句本身注释自由文本代码的例子 有人能给我举个例子,说明如何用Protege做到这一点吗?WADM不会限制你的身体。根据,body应该扩展到oa:hasBody。 oa:has

我试图使用,以便在RDF语句中添加出处信息

为了澄清问题,我的本体中的每个RDF语句(典型的主谓宾三元组)都是基于特定自由文本片段上提供的知识创建的。我想在每个RDF语句上创建一个WADM
注释
,将RDF语句本身作为
主体
,并将相应的自由文本片段作为
目标

将自由文本片段作为目标对我来说是很清楚的。然而,我似乎找不到一个用RDF语句本身注释自由文本代码的例子


有人能给我举个例子,说明如何用Protege做到这一点吗?

WADM不会限制你的身体。根据,
body
应该扩展到
oa:hasBody
oa:hasBody
的范围不限制其
rdfs:range

oa:hasBody a rdf:Property ;
  rdfs:label "hasBody" ;
  rdfs:domain oa:Annotation ;
  rdfs:isDefinedBy oa: .
因此,您可以使用:

{
“@context”:”http://www.w3.org/ns/anno.jsonld" ,
“id”:”http://example.org/annotation12345",
“类型”:“注释”,
“正文”:{
“id”:”http://example.org/statement12345",
“类型”:“rdf:语句”,
“rdf:主题”:http://dbpedia.org/resource/Great_Britain",
“rdf:谓词”:”http://dbpedia.org/ontology/capital",
“rdf:对象”:”http://dbpedia.org/resource/London"
},
“目标”:{
“来源”:https://en.wikipedia.org/wiki/London",
“选择器”:{
“类型”:“TextQuoteSelector”,
“准确”:“伦敦是英国的首都”,
“前缀”:“,
“后缀”:”
}
}
}


有谁能给我举一个例子,说明如何用Protege做到这一点

Protégé不是RDF编辑器。RDF是OWL序列化的抽象语法。JSON-LD可以用作RDF序列化的具体语法

但是,如果您想将Protégé用作RDF编辑器,那么下面的本体将被序列化为类似于上面的JSON-LD的JSON-LD:

Prefix: owl: <http://www.w3.org/2002/07/owl#>
Prefix: rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
Prefix: rdfs: <http://www.w3.org/2000/01/rdf-schema#>
Prefix: xml: <http://www.w3.org/XML/1998/namespace>
Prefix: xsd: <http://www.w3.org/2001/XMLSchema#>
Prefix: dbr: <http://dbpedia.org/resource/>
Prefix: dbo: <http://dbpedia.org/ontology/>
Prefix: oa: <http://www.w3.org/ns/oa#>
Prefix: ex: <http://example.org/>

Ontology: <http://example.org/>

# Import: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
# Import: <http://www.w3.org/ns/oa#>

ObjectProperty: oa:hasBody
ObjectProperty: oa:hasTarget
ObjectProperty: oa:hasSelector

DataProperty: oa:hasSource
DataProperty: oa:prefix
DataProperty: oa:exact
DataProperty: oa:suffix

ObjectProperty: rdf:subject
ObjectProperty: rdf:object
ObjectProperty: rdf:predicate  


Class: oa:Annotation  
Class: oa:TextQuoteSelector
Class: rdf:Statement

Individual: ex:annotation12345
    Facts:
        oa:hasBody ex:statement12345,
        oa:hasTarget ex:target12345
    Types: 
        oa:Annotation

Individual: ex:statement12345
    Facts: 
        rdf:object dbr:London,
        rdf:predicate dbo:capital,
        rdf:subject dbr:Great_Britain
    Types: 
        rdf:Statement

Individual: ex:target12345
    Facts: 
        oa:hasSelector ex:selector12345,
        oa:hasSource "https://en.wikipedia.org/wiki/London"

Individual: ex:selector12345
    Facts: 
        oa:suffix ". ",
        oa:prefix ". ",
        oa:exact "London is a capital of Great Britain"
    Types:
        oa:TextQuoteSelector

Individual: dbo:capital
Individual: dbr:Great_Britain
Individual: dbr:London


我想我找到了一个解决办法,通过使用“hasTarget”作为注释属性的注释对语句(例如ObjectPropertyAssert)进行注释

例如,如果我想使用RDF语句
注释位于internet某处的目标pdf,我将使用以下基本原理:

<ObjectPropertyAssertion>
        <Annotation>
            <AnnotationProperty IRI="http://www.w3.org/ns/oa#hasTarget"/>
            <AnonymousIndividual nodeID="_:genid-f7b71d4c-657e-40bc-bc69-31fc3af8b603"/>
        </Annotation>
        <ObjectProperty IRI="<Predicate>"/>
        <NamedIndividual IRI="<Subject>"/>
        <NamedIndividual IRI="<Object>"/>
</ObjectPropertyAssertion>

<AnnotationAssertion>
    <AnnotationProperty IRI="http://www.w3.org/ns/oa#hasSource"/>
    <AnonymousIndividual nodeID="_:genid-0d456ba2-52b9-470d-ad70-efafbc06d261"/>
    <Literal datatypeIRI="http://www.w3.org/2001/XMLSchema#anyURI">source_url</Literal>
</AnnotationAssertion>

<ObjectPropertyAssertion>
        <ObjectProperty IRI="http://www.w3.org/ns/oa#hasSelector"/>
        <AnonymousIndividual nodeID="_:genid-f7b71d4c-657e-40bc-bc69-31fc3af8b603"/>
        <NamedIndividual IRI="#selector_1"/>
</ObjectPropertyAssertion>

<ClassAssertion>
        <Class IRI="http://www.w3.org/ns/oa#TextQuoteSelector"/>
        <NamedIndividual IRI="#selector_1"/>
</ClassAssertion>

<DataPropertyAssertion>
        <DataProperty IRI="http://www.w3.org/ns/oa#exact"/>
        <NamedIndividual IRI="#selector_1"/>
        <Literal datatypeIRI="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral">some text</Literal>
</DataPropertyAssertion>

 <DataPropertyAssertion>
        <DataProperty IRI="http://www.w3.org/ns/oa#prefix"/>
        <NamedIndividual IRI="#selector_1"/>
        <Literal datatypeIRI="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral">some prefix</Literal>
</DataPropertyAssertion>

<DataPropertyAssertion>
        <DataProperty IRI="http://www.w3.org/ns/oa#suffix"/>
        <NamedIndividual IRI="#selector_1"/>
        <Literal datatypeIRI="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral">some suffix</Literal>
</DataPropertyAssertion>

源地址
一些文本
一些前缀
一些后缀
在protege中,可以通过在“property assertions”视图中的每个属性断言(即原始的
语句)右侧使用“@”符号注释语句来完成

我不确定它是否完全兼容,但对我来说似乎还可以

希望对其他人也有帮助

编辑:示例本体的完整版本,根据要求,由protege以OWL/XML格式直接生成

<?xml version="1.0"?>
<Ontology xmlns="http://www.w3.org/2002/07/owl#"
     xml:base="http://www.semanticweb.org/example"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:xml="http://www.w3.org/XML/1998/namespace"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
     ontologyIRI="http://www.semanticweb.org/example">
    <Prefix name="" IRI="http://www.semanticweb.org/example"/>
    <Prefix name="owl" IRI="http://www.w3.org/2002/07/owl#"/>
    <Prefix name="rdf" IRI="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
    <Prefix name="xml" IRI="http://www.w3.org/XML/1998/namespace"/>
    <Prefix name="xsd" IRI="http://www.w3.org/2001/XMLSchema#"/>
    <Prefix name="rdfs" IRI="http://www.w3.org/2000/01/rdf-schema#"/>
    <Import>http://www.w3.org/ns/oa#</Import>
    <Declaration>
        <AnnotationProperty IRI="http://www.w3.org/ns/oa#hasSource"/>
    </Declaration>
    <Declaration>
        <ObjectProperty IRI="http://www.w3.org/ns/oa#hasSelector"/>
    </Declaration>
    <Declaration>
        <NamedIndividual IRI="#exampleIndividual2"/>
    </Declaration>
    <Declaration>
        <DataProperty IRI="http://www.w3.org/ns/oa#prefix"/>
    </Declaration>
    <Declaration>
        <AnnotationProperty IRI="http://www.w3.org/ns/oa#hasTarget"/>
    </Declaration>
    <Declaration>
        <DataProperty IRI="http://www.w3.org/ns/oa#suffix"/>
    </Declaration>
    <Declaration>
        <NamedIndividual IRI="#exampleIndividual"/>
    </Declaration>
    <Declaration>
        <NamedIndividual IRI="#selector_1"/>
    </Declaration>
    <Declaration>
        <DataProperty IRI="http://www.w3.org/ns/oa#exact"/>
    </Declaration>
    <Declaration>
        <ObjectProperty IRI="#exampleProperty"/>
    </Declaration>
    <ClassAssertion>
        <Class IRI="http://www.w3.org/ns/oa#TextQuoteSelector"/>
        <NamedIndividual IRI="#selector_1"/>
    </ClassAssertion>
    <ObjectPropertyAssertion>
        <Annotation>
            <AnnotationProperty IRI="http://www.w3.org/ns/oa#hasTarget"/>
            <AnonymousIndividual nodeID="_:genid36"/>
        </Annotation>
        <ObjectProperty IRI="#exampleProperty"/>
        <NamedIndividual IRI="#exampleIndividual2"/>
        <NamedIndividual IRI="#exampleIndividual"/>
    </ObjectPropertyAssertion>
    <ObjectPropertyAssertion>
        <ObjectProperty IRI="http://www.w3.org/ns/oa#hasSelector"/>
        <AnonymousIndividual nodeID="_:genid36"/>
        <NamedIndividual IRI="#selector_1"/>
    </ObjectPropertyAssertion>
    <DataPropertyAssertion>
        <DataProperty IRI="http://www.w3.org/ns/oa#exact"/>
        <NamedIndividual IRI="#selector_1"/>
        <Literal datatypeIRI="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral">some text</Literal>
    </DataPropertyAssertion>
    <DataPropertyAssertion>
        <DataProperty IRI="http://www.w3.org/ns/oa#prefix"/>
        <NamedIndividual IRI="#selector_1"/>
        <Literal datatypeIRI="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral">some prefix</Literal>
    </DataPropertyAssertion>
    <DataPropertyAssertion>
        <DataProperty IRI="http://www.w3.org/ns/oa#suffix"/>
        <NamedIndividual IRI="#selector_1"/>
        <Literal datatypeIRI="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral">some suffix</Literal>
    </DataPropertyAssertion>
    <AnnotationAssertion>
        <AnnotationProperty IRI="http://www.w3.org/ns/oa#hasSource"/>
        <AnonymousIndividual nodeID="_:genid36"/>
        <Literal datatypeIRI="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral">source_url</Literal>
    </AnnotationAssertion>
    <AnnotationAssertion>
        <AnnotationProperty IRI="http://www.w3.org/ns/oa#hasSource"/>
        <AnonymousIndividual nodeID="_:genid37"/>
        <Literal datatypeIRI="http://www.w3.org/2001/XMLSchema#anyURI">source_url</Literal>
    </AnnotationAssertion>
</Ontology>



<!-- Generated by the OWL API (version 4.2.8.20170104-2310) https://github.com/owlcs/owlapi -->

http://www.w3.org/ns/oa#
一些文本
一些前缀
一些后缀
源地址
源地址

非常感谢您的回答。我想我找到了一个更简单的解决办法。你认为我的建议有效吗?@PantelisNatsiavas,请在你的答案中粘贴完整的本体,最好是曼彻斯特语法。我刚刚上传了一个完整的例子,使用OWL/XML格式,由protege直接导出。不幸的是,protege无法成功地以Manchester语法导出我的示例,因为它严重依赖于未声明实体(隐含目标)的注释属性,并且我得到消息“Manchester OWL语法可能会丢失未声明实体的GCI和注释等信息”那么,
oa:hasBody
在哪里?非常感谢您抽出时间。我们的方法有不同的语义。在您的方法中,RDF三元组是注释的主体。在我的方法中,RDF三元组是注释本身(没有主体的注释)。我认为您的方法的语义更适合WADM模型。然而,实际上,您的方法需要添加5条语句来创建表示RDF语句的单个语句。这不是一个小问题。我真的无法决定哪个更好。不过,我会将您的答案标记为接受,因为它是一个更适合WADM模型(在我看来)。
<?xml version="1.0"?>
<Ontology xmlns="http://www.w3.org/2002/07/owl#"
     xml:base="http://www.semanticweb.org/example"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:xml="http://www.w3.org/XML/1998/namespace"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
     ontologyIRI="http://www.semanticweb.org/example">
    <Prefix name="" IRI="http://www.semanticweb.org/example"/>
    <Prefix name="owl" IRI="http://www.w3.org/2002/07/owl#"/>
    <Prefix name="rdf" IRI="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
    <Prefix name="xml" IRI="http://www.w3.org/XML/1998/namespace"/>
    <Prefix name="xsd" IRI="http://www.w3.org/2001/XMLSchema#"/>
    <Prefix name="rdfs" IRI="http://www.w3.org/2000/01/rdf-schema#"/>
    <Import>http://www.w3.org/ns/oa#</Import>
    <Declaration>
        <AnnotationProperty IRI="http://www.w3.org/ns/oa#hasSource"/>
    </Declaration>
    <Declaration>
        <ObjectProperty IRI="http://www.w3.org/ns/oa#hasSelector"/>
    </Declaration>
    <Declaration>
        <NamedIndividual IRI="#exampleIndividual2"/>
    </Declaration>
    <Declaration>
        <DataProperty IRI="http://www.w3.org/ns/oa#prefix"/>
    </Declaration>
    <Declaration>
        <AnnotationProperty IRI="http://www.w3.org/ns/oa#hasTarget"/>
    </Declaration>
    <Declaration>
        <DataProperty IRI="http://www.w3.org/ns/oa#suffix"/>
    </Declaration>
    <Declaration>
        <NamedIndividual IRI="#exampleIndividual"/>
    </Declaration>
    <Declaration>
        <NamedIndividual IRI="#selector_1"/>
    </Declaration>
    <Declaration>
        <DataProperty IRI="http://www.w3.org/ns/oa#exact"/>
    </Declaration>
    <Declaration>
        <ObjectProperty IRI="#exampleProperty"/>
    </Declaration>
    <ClassAssertion>
        <Class IRI="http://www.w3.org/ns/oa#TextQuoteSelector"/>
        <NamedIndividual IRI="#selector_1"/>
    </ClassAssertion>
    <ObjectPropertyAssertion>
        <Annotation>
            <AnnotationProperty IRI="http://www.w3.org/ns/oa#hasTarget"/>
            <AnonymousIndividual nodeID="_:genid36"/>
        </Annotation>
        <ObjectProperty IRI="#exampleProperty"/>
        <NamedIndividual IRI="#exampleIndividual2"/>
        <NamedIndividual IRI="#exampleIndividual"/>
    </ObjectPropertyAssertion>
    <ObjectPropertyAssertion>
        <ObjectProperty IRI="http://www.w3.org/ns/oa#hasSelector"/>
        <AnonymousIndividual nodeID="_:genid36"/>
        <NamedIndividual IRI="#selector_1"/>
    </ObjectPropertyAssertion>
    <DataPropertyAssertion>
        <DataProperty IRI="http://www.w3.org/ns/oa#exact"/>
        <NamedIndividual IRI="#selector_1"/>
        <Literal datatypeIRI="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral">some text</Literal>
    </DataPropertyAssertion>
    <DataPropertyAssertion>
        <DataProperty IRI="http://www.w3.org/ns/oa#prefix"/>
        <NamedIndividual IRI="#selector_1"/>
        <Literal datatypeIRI="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral">some prefix</Literal>
    </DataPropertyAssertion>
    <DataPropertyAssertion>
        <DataProperty IRI="http://www.w3.org/ns/oa#suffix"/>
        <NamedIndividual IRI="#selector_1"/>
        <Literal datatypeIRI="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral">some suffix</Literal>
    </DataPropertyAssertion>
    <AnnotationAssertion>
        <AnnotationProperty IRI="http://www.w3.org/ns/oa#hasSource"/>
        <AnonymousIndividual nodeID="_:genid36"/>
        <Literal datatypeIRI="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral">source_url</Literal>
    </AnnotationAssertion>
    <AnnotationAssertion>
        <AnnotationProperty IRI="http://www.w3.org/ns/oa#hasSource"/>
        <AnonymousIndividual nodeID="_:genid37"/>
        <Literal datatypeIRI="http://www.w3.org/2001/XMLSchema#anyURI">source_url</Literal>
    </AnnotationAssertion>
</Ontology>



<!-- Generated by the OWL API (version 4.2.8.20170104-2310) https://github.com/owlcs/owlapi -->