16

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?

Grienauer
  • 389
  • 3
  • 10
  • I agree that `` is where this kind of info should go. I think the XML Schema allows you to just use text inside this element without additinal markup, be it RDF or anything else. But for accessibility reasons, I think it's a good idea to use some standardized markup for making explicit that you are encoding copyright information. – Thomas W Aug 04 '16 at 20:31
  • "But is RDF really necessary?" -- Sounds like you think this would be a problem … why? – unor Aug 05 '16 at 02:12
  • I don't think it is a problem to use RDF, but I think it is a little bit overruled for "just" a copyright info... @unor, which RDF property should I use? – Grienauer Aug 09 '16 at 15:56
  • Do note that if unor's answer helped you, you can vote on it by clicking the arrows or accept it as correct by clicking the checkmark. – Kyll Sep 24 '16 at 21:03

1 Answers1

8

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

Community
  • 1
  • 1
unor
  • 92,415
  • 26
  • 211
  • 360
  • Not sure if useful to you, but in SVG Tiny, [you can use RDFa attributes](http://stackoverflow.com/a/23181532/1591669) on the SVG elements directly (i.e., not just as XHTML+RDFa inside of `metadata`). – unor Aug 10 '16 at 20:26
  • 1
    How would I extend this with a list of the work's author(s)? – posfan12 May 21 '18 at 04:40
  • Having the same question as in the previous comment, I ended up looking how Inkscape stores author and license information in RDF tags (can be set in the document properties). – user3107036 Jun 05 '20 at 20:01