简体   繁体   English

如何将URI中的结尾字符从#更改为/ <rdf:RDF xmlns=“”> -猫头鹰API

[英]How do you change the trailing character in a URI from # to / in <rdf:RDF xmlns=“”> - owl api

I am using OWL API 4.0.1 and whenever I export OWL I end up with a hash at the end of a URI in the rdf:RDF xmlns section, example below. 我使用的是OWL API 4.0.1,每当导出OWL时,我都会在rdf:RDF xmlns部分的URI末尾添加一个哈希,如下例所示。

 <rdf:RDF xmlns="http://www.example.com/example/Example#">

However I don't want the hash, I want to use the 303 URI separator of '/' from Cool URIs for the Semantic Web and look like: 但是我不需要哈希,我想使用来自Cool URI的'/'的303 URI分隔符作为语义Web ,如下所示:

 <rdf:RDF xmlns="http://www.example.com/example/Example/">

What would I need to do to change the trailing character from # to / in the rdf:RDF xmlns="" section? 在rdf:RDF xmlns =“”部分中,如何将尾随字符从#更改为/?

The RDF/XML namespaces are used as prefixes in URIs in that particular serialization. RDF / XML名称空间在该特定序列化中用作URI中的前缀。 Even if the empty namespace defined with xmlns="...#" happens to end with a # , it doesn't matter unless there's something in the document that actually uses the empty namespace. 即使与定义的空命名空间xmlns="...#"发生了结束# ,不要紧,除非有一些实际使用空命名空间在文档中。 Eg, the following RDF/XML document has a namespace like the one that you describe: 例如,以下RDF / XML文档具有与您描述的名称空间类似的名称空间:

<rdf:RDF
    xmlns="http://example.com/example#"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:ex="http://example.com/example/">
  <ex:Thing rdf:about="http://example.com/example/Example"/>
</rdf:RDF>

That said, the document only has one triple, and neither of the "example" URIs have a # in them: 也就是说,该文档只有一个三元组,并且两个“ example” URI中都没有一个#

<http://example.com/example/Example> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/example/Thing> .

I'd suggest that you try writing out your model using the N-Triples serialization so that all the URIs are written out in full. 我建议您尝试使用N-Triples序列化写出您的模型,以便将所有URI完整写出。 Then you can do a plain text search for the problematic URI, ...# , and see whether it's actually occurring somewhere in the model or not. 然后,您可以对有问题的URI ...#进行纯文本搜索,并查看它是否实际上在模型中的某个位置发生。 Just because it's defined as a prefix in the RDF/XML serialization doesn't mean that there's actually a URI starting with that prefix in the model. 仅仅因为在RDF / XML序列化中将其定义为前缀并不意味着实际上在模型中就有一个以该前缀开头的URI。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM