在 RDFa 中使用 @rev 和 @property 是否合法

发布于 2025-01-07 04:19:54 字数 782 浏览 0 评论 0原文

在下面的 RDFa 片段中:

<span about="example.com/subjectURI" rel="example.com/predicateURI" property="literalText"></span>

about= 属性中的 URI 是主语(好吧,URI 引用的实体,但你明白了),rel 表示谓词,property 表示文字对象。我知道使用谓词的 rev 属性会颠倒主语和宾语,因此 about= now 引用 RDF 语句的宾语。然而,从我读到的内容来看,似乎不允许文字作为主语。那么,以下行为合法吗?

<span about="example.com/objectURI" rev="example.com/predicateURI" property="literal-text-as-a-subject"></span>

现在,人们可能会争辩说,文字文本可以成为陈述的主题。例如,Steven Colbert 可能会编写以下 RDFa 行:

<span about="www.stevencolbert.com/verytruthy" rev="www.stevencolbert.com/truthyness" property="Only geeks would care about whether one could use @rev with @property, whatever the hell that means."></span>

In the following snippet of RDFa:

<span about="example.com/subjectURI" rel="example.com/predicateURI" property="literalText"></span>

the URI in the about= attribute is the subject (OK the entity referred to by the URI, but you get the idea), rel indicates the predicate and property indicates a literal object. I know that using the rev attribute for the predicate reverses the subject and the object so that about= now refers to the object of the RDF statement. However, from what I have read, it doesn't seem that literals are allowed to be subjects. So, would the following be legal?

<span about="example.com/objectURI" rev="example.com/predicateURI" property="literal-text-as-a-subject"></span>

Now one could argue that literal text could be a subject of a statement. For instance Steven Colbert may write the following line of RDFa:

<span about="www.stevencolbert.com/verytruthy" rev="www.stevencolbert.com/truthyness" property="Only geeks would care about whether one could use @rev with @property, whatever the hell that means."></span>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

[浮城] 2025-01-14 04:19:54

回答你的具体问题:是的,这是合法的。有用吗?很少(如果有的话),而且它不会按照你的想法做。

从您的示例来看,存在一些混乱:

首先(次要)您没有使用绝对 URI。我的假设是您的意思是 http://example.com/subjectURI 而不是 example.com/subjectURI 等,但它们不是同一件事。

其次,您使用的是 property="literalText"。我的猜测是这是属性内容的合并。您想要的是这样的:

<html xmlns:ns="http://example.com/">
...
<span about="http://example.com/subjectURI" 
      property="ns:predicateURI"
      content="literalText"></span>

其结果是:

<http://example.com/subjectURI> <http://example.com/predicateURI> "literalText" .

或者具有等效结果(假设 xmlns):

<span about="http://example.com/subjectURI" 
      property="ns:predicateURI">literalText</span>

relrev 用于关联两个 URI,not< /em> 到文字的 URI;这就是property 的作用。而且由于没有属性的逆,所以你不能创建一个字面主题。

In answer to your specific question: yes, it is legal. Is it useful? Rarely (if ever), and it doesn't do what you are thinking.

From your examples there is some confusion:

Firstly (minor) you're not using absolute URIs. My assumption is that you mean http://example.com/subjectURI rather than example.com/subjectURI etc, but they're not the same thing.

Secondly you're using property="literalText". My guess is that's a conflation of property and content. What you want is something like:

<html xmlns:ns="http://example.com/">
...
<span about="http://example.com/subjectURI" 
      property="ns:predicateURI"
      content="literalText"></span>

Which results in:

<http://example.com/subjectURI> <http://example.com/predicateURI> "literalText" .

Or with the equivalent result (assuming xmlns):

<span about="http://example.com/subjectURI" 
      property="ns:predicateURI">literalText</span>

rel and rev are used to relate two URIs, not URIs to literals; that's what property does. And since there's no inverse of property you can't make a literal subject.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文