Re: SVG document types

Hi Olaf, all,

Thanks, Olaf, for your thoughts. I've taken a look at RDFa, but can't 
see how to use it to define a simple container structure in SVG. Maybe I 
should look a bit harder, but RDFa seems to be just about adding more 
powerful attributes. Possibly the attributes could then say that a 
particular element belongs to a particular container, but I think it 
would be easier to parse the file (and it could be kept smaller and 
simpler) if it really had a known structure.
One of the main use-cases for such files is the extraction of music 
examples. These are much easier to locate, both for software and for 
humans, if the file has a known container structure.
I'm also a bit wary of depending on standards that are not guaranteed to 
work in all versions of SVG...

Here's another strategy, that occurred to me just before getting your 
reply. Maybe its related to your alternative c). Comments welcome of course!

The SVG score file should declare a pseudo-namespace in its header. This 
would look exactly like an ordinary namespace declaration, but the 
declared namespace would not actually be used in the file.
For example:
     xmlns:musicSVG1="http://www...."

Browsers would simply treat this declaration as being superfluous (since 
the namespace is never mentioned again in the file), and display the 
file as usual.
Applications designed for working with music notation can, however, read 
the declaration to mean that the file conforms to a particular, standard 
container and element class structure called musicSVG1. Those 
applications can then accept or reject the file, depending on whether 
they are expecting to parse files having that type.
There could also be a standard *verifier* application (like the W3C HTML 
verifier) that would read the file and report any inconsistencies. This 
would be used by the *writers* of musicSVG1 files to check that the file 
is being written correctly. Writing a verifier application for musicSVG1 
(and other possible music formats) would be quite straightforward. (I 
could do it myself.)

Namespaces and file types are closely related concepts, but I'd prefer 
not to have to override the namespace declaration. Is there a better 
alternative?

All the best,
James


Am 22.11.2016 um 12:15 schrieb Dr. Olaf Hoffmann:
> Hello,
>
> this sounds like metainformation.
> My idea would be to use something like RDF(a) to provide a defined semantic
> meaning.
> In SVG tiny 1.2 you can use both the attribute role and RDFa attributes within
> the SVG namespace for this.
> In SVG 1.1 there is no RDFa - this seems to apply unfortunately for the SVG 2
> working draft as well. In the SVG 2 working draft the role attribute seems to
> be restricted to another purpose, therefore not applicable to provide defined
> semantic information from an own namespace unfortunately, this feature is
> borked by the draft.
>
> Therefore here you have other options to consider for SVG 1.1 (maybe in the
> future for SVG 2 as well, if this is not improved at least to the level of SVG
> tiny 1.2 anymore):
> a) Use RDFa attributes from the XHTML namespace
> b) Use RDF within an element metadata for each element you want to provide
> semantic metainformation. Obviously it is slightly more complex to extract
> such information and the file size gets bigger.
> c) Of course, if you provide a role attribute from you own namespace, it can
> contain defined information as well. For example this approach is used in the
> standard for digital books EPUB 3 (only for the XHTML part of the content, no
> idea why not for the SVG part as well).
>
> Olaf
>


-- 
http://james-ingram-act-two.de
https://github.com/notator

Received on Tuesday, 22 November 2016 13:59:57 UTC