What's the meaning of # in rdf:resource

2019-02-28 20:20发布

It is unclear to me when should I precede URI inside of rdf:resource with # character. What exactly does it mean? Is it way to use relative URI, or does it have to be used with rdf:ID but not with rdf:about ?

Could you append examples of wrong and right usage of # inside rdf:resource?

标签: xml rdf
1条回答
聊天终结者
2楼-- · 2019-02-28 20:56

The rdf:resource attribute has a URI as value (= the subject of the triple).

You can use absolute URIs (e.g., http://example.com/foobar), or relative URIs (e.g., /foobar). If you use #foo as value, that would be a same-document reference.

So if you use rdf:resource="#foo" in a document which has the URI http://example.com/foobar, you are specifying the URI http://example.com/foobar#foo.


Note that many authors use the fragment to differentiate the page from the thing it represents. Example:

  • http://example.com/Buksy could represent the page about you
  • http://example.com/Buksy#i could represent you

This is known as hash URI, which is a possible solution for the httpRange-14 issue.

查看更多
登录 后发表回答