Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Semantically correct way to add a copyright notice into a svg file?

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?

like image 611
Grienauer Avatar asked Aug 04 '16 19:08

Grienauer


People also ask

Does SVG have copyright?

SVG encourages the use of a common metadata format for inclusion of copyright information. Metadata relevant to the data copyright of the entire document should be added to metadata element of the topmost svg element. This allows the author to unambiguously state the licensing terms for the entire document.

Can I modify an SVG file?

To edit an SVG image in Office for Android, tap to select the SVG you want to edit and the Graphics tab should appear on the ribbon. Styles - These are a set of predefined styles you can add to quickly change the look of your SVG file.

How do you reference SVG?

To embed an SVG via an <img> element, you just need to reference it in the src attribute as you'd expect. You will need a height or a width attribute (or both if your SVG has no inherent aspect ratio). If you have not already done so, please read Images in HTML.


1 Answers

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.)

like image 135
unor Avatar answered Sep 29 '22 12:09

unor