在 RDFa 中使用 @rev 和 @property 是否合法
在下面的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
回答你的具体问题:是的,这是合法的。有用吗?很少(如果有的话),而且它不会按照你的想法做。
从您的示例来看,存在一些混乱:
首先(次要)您没有使用绝对 URI。我的假设是您的意思是
http://example.com/subjectURI
而不是example.com/subjectURI
等,但它们不是同一件事。其次,您使用的是
property="literalText"
。我的猜测是这是属性
和内容
的合并。您想要的是这样的:其结果是:
或者具有等效结果(假设 xmlns):
rel
和rev
用于关联两个 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 thanexample.com/subjectURI
etc, but they're not the same thing.Secondly you're using
property="literalText"
. My guess is that's a conflation ofproperty
andcontent
. What you want is something like:Which results in:
Or with the equivalent result (assuming xmlns):
rel
andrev
are used to relate two URIs, not URIs to literals; that's whatproperty
does. And since there's no inverse ofproperty
you can't make a literal subject.