在svg文件中添加版权声明的语义正确方法? [英] Semantically correct way to add a copyright notice into a svg file?

查看:458
本文介绍了在svg文件中添加版权声明的语义正确方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的svg文件中添加版权声明,并且该声明应仅为隐藏"文本,而不能带有水印. 这并不是真正的保护,因为如果您使用文本编辑器打开svg文件,则可以编辑所有内容并删除版权.但是我认为这将是一种简单而又很好的显示方式,显示谁制作了该文件,并且如果有一些隐藏的信息,并且如果您正在寻找它,则可以很容易地找到未经许可的图形.

我的主要问题是:应如何将版权文本放入文件中?

  • <title>元素用于辅助功能,某些用户代理将title元素显示为工具提示.
  • <desc>元素通常可以提高可访问性,您应该描述用户将会看到的内容.
  • 丑陋的方式:使用嵌入式CSS将其隐藏的文本元素.甚至不要考虑这一点! :)
  • <!--Copyright info here-->可能也是一个简单的解决方案.
  • <metadata>:这是最好的方法,但是我没有找到详细的定义以及哪些子元素可以存在于其中.另外 https://developer.mozilla.org/en-US/DOM/SVGMetadataElement给出404. 在 https://www.w3.org/TR/SVG/struct.html #MetadataElement 我们可以找到更多详细信息.但是,RDF真的有必要吗?

我认为<metadata>元素是正确的位置,但是应该使用哪些子元素,而只是RDF是可行的方式?

解决方案

我认为 metadata元素是此处的正确选择.它必须包含XML,但没有必须是RDF序列化(例如, <metadata> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:schema="http://schema.org/"> <rdf:Description rdf:about="http://example.com/my-svg-file.svg"> <schema:license rdf:resource="https://creativecommons.org/licenses/by-sa/4.0/"/> </rdf:Description> </rdf:RDF> </metadata>

about属性将IRI作为值;对于独立的SVG文档,您可以提供一个空值(=文档的基本IRI).

在此示例中,我使用Schema.org中的 license属性:

适用于此内容的许可文档,通常由URL指示.

(词汇表Schema.org得到了几个大型搜索引擎的支持.)

I want to add a copyright notice in my svg files and it should be only "hidden" text and no watermark. This is no real protection, because if you open a svg file with a text editor you can edit everything and delete the copyright. But I think this would be a simple and great way to show, who has made the file and a possible chance to find unlicensed graphics if there is some hidden information and if you are looking for it you can easily find it.

My main question is: how should the copyright text be put into the file?

  • <title> element is for accessibility purposes, some user agents display the title element as a tooltip.
  • <desc> element generally improves accessibility and you should describe what a user would see.
  • ugly way: a text element with inline CSS to hide it. Don't even think about this! :)
  • <!--Copyright info here--> could be also a simple solution.
  • <metadata>: this would the best way but I did not find a detailed definition and which child elements could live inside. Also https://developer.mozilla.org/en-US/DOM/SVGMetadataElement gives a 404. Under https://www.w3.org/TR/SVG/struct.html#MetadataElement we can find more details. But is RDF really necessary?

I think a <metadata> element is the right place, but which child elements should be used and is just RDF the way to go?

解决方案

I think the metadata element is the correct choice here. It has to contain XML, but it doesn’t have to be a RDF serialization (e.g., RDF/XML).

But I think it makes sense to use RDF here, because that’s exactly RDF’s job (providing metadata about resources, like SVG documents), and there is probably no other XML-based metadata language that has greater reach / better support.

A simple RDF statement (in RDF/XML) could look like this:

<metadata>
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:schema="http://schema.org/">
    <rdf:Description rdf:about="http://example.com/my-svg-file.svg">
      <schema:license rdf:resource="https://creativecommons.org/licenses/by-sa/4.0/"/>
    </rdf:Description>
  </rdf:RDF>
</metadata>

The about attribute takes an IRI as value; for a stand-alone SVG document, you could provide an empty value (= the base IRI of the document).

In this example I use the license property from Schema.org:

A license document that applies to this content, typically indicated by URL.

(The vocabulary Schema.org is supported by several big search engines.)

这篇关于在svg文件中添加版权声明的语义正确方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆