createphp / rdf-mappings and html5+rdfa 1.1

51 views
Skip to first unread message

Christian Ruttorf

unread,
Dec 9, 2014, 4:29:53 AM12/9/14
to symfony-...@googlegroups.com
Hello,

I am still kind of struggling to understand the XML/RDFa 1.1 specs but from what I gather it's correct to use the xmlns:prefix definition in the rdf mappgins but it should not be rendered in html5 as it is right now, as the use of the xmlns: attribute is pretty much restricted in html elements like <div>. It appears to me, that the right way to define a prefix and/or a namespace in html5 is through the prefix or the vocab attribute, which are simply ignored by the RdfDriverXml::loadType() function in the midgard/createphp bundle. 

As far as I understand the passages found at the following link, it is still kind of okay to use xmlns: as it will be processed but my problem with that is, that the w3c validator tells me, that the rendered pages aren't valid html5.


I ended up forking createphp and adding some kind of q&d fix to allow the vocab and prefix attributes in the rdf-mapping files (https://github.com/oafx/createphp/commit/e5ea89b7ca46e845ab813f764543d0a4e3846290) but I'm not sure if adding the vocab or prefix attribute to the type definition of the rdf-mapping doesn't screw the mapping up.. semantically.

As I repeatedly said, I'm not quite sure I understand everything so I'd like to hear your opinions if this needs to be fixed and if so what the best way to do this would be (translate the xmlns:<prefix>="<url>" in the rdf-mapping simply to prefix="<prefix>: <url>"? on the page) before creating an issue/PR.

Thanks for the read!
Chris

Christian Ruttorf

unread,
Dec 11, 2014, 4:58:06 AM12/11/14
to symfony-...@googlegroups.com
okay, to whom it may concern: i figured out that the above commit is faulty. you can't simply add the prefix and vocab attribute without setting the right vocabulary. 

Lukas Kahwe Smith

unread,
Dec 11, 2014, 4:59:08 AM12/11/14
to symfony-...@googlegroups.com

> On 11 Dec 2014, at 10:58, Christian Ruttorf <h3rz...@gmail.com> wrote:
>
> okay, to whom it may concern: i figured out that the above commit is faulty. you can't simply add the prefix and vocab attribute without setting the right vocabulary.

maybe you can tweak the docs a bit?

regards,
Lukas Kahwe Smith
sm...@pooteeweet.org



signature.asc

Christian Ruttorf

unread,
Dec 11, 2014, 5:20:29 AM12/11/14
to symfony-...@googlegroups.com
Hi Lukas,

as those changes mentioned above are just regarding my own fork and more like a quick test i'm not quite sure what I should tweak about the docs. I'm kind of still waiting for feedback if the topic is even a real issue or i'm simply too nooby with the cmf, hehe. But i certainly would take the required steps if somebody confirms that this is a real issue. 

greetings


David Buchmann

unread,
Dec 11, 2014, 10:05:57 AM12/11/14
to symfony-...@googlegroups.com
hi christian,

unfortunately i think nobody at the cmf can claim to be an expert on
rdfa. we rely on createjs to work the way it does...

i am even unsure what problem you are describing. if its about the html
tags we use, those can be configured in the mapping or (preferred) you
write the tag in twig and let createphp just render the attributes.

or is it about declaring some additional namespaces to make HTML5 happy?

maybe try to open an issue on the createphp repository to see if flack
has input on the issue?
if there is a validation problem, we should indeed fix that the correct way.

cheers,david

On 09.12.2014 10:29, Christian Ruttorf wrote:
> Hello,
>
> I am still kind of struggling to understand the XML/RDFa 1.1 specs but
> from what I gather it's correct to use the xmlns:prefix definition in
> the rdf mappgins but it /should not/ be rendered in html5 as it is right
> now, as the use of the xmlns: attribute is pretty much restricted in
> html elements like <div>. It appears to me, that the right way to define
> a prefix and/or a namespace in html5 is through the prefix or the vocab
> attribute, which are simply ignored by the RdfDriverXml::loadType()
> function in the midgard/createphp bundle.
>
> As far as I understand the passages found at the following link, it is
> still /kind of/ okay to use xmlns: as it will be processed but my
> problem with that is, that the w3c validator tells me, that the rendered
> pages aren't valid html5.
>
> See: http://www.w3.org/TR/rdfa-in-html/#backwards-compatibility
>
> I ended up forking createphp and adding some kind of q&d fix to allow
> the vocab and prefix attributes in the rdf-mapping files
> (https://github.com/oafx/createphp/commit/e5ea89b7ca46e845ab813f764543d0a4e3846290)
> but I'm not sure if adding the vocab or prefix attribute to the type
> definition of the rdf-mapping doesn't screw the mapping up.. semantically.
>
> As I repeatedly said, I'm not quite sure I understand everything so I'd
> like to hear your opinions if this needs to be fixed and if so what the
> best way to do this would be (translate the xmlns:<prefix>="<url>" in
> the rdf-mapping simply to prefix="<prefix>: <url>"? on the page) before
> creating an issue/PR.
>
> Thanks for the read!
> Chris
>
> --
> You received this message because you are subscribed to the Google
> Groups "symfony-cmf-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to symfony-cmf-us...@googlegroups.com
> <mailto:symfony-cmf-us...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

--
Liip AG // Agile Web Development // T +41 43 500 39 80
CH-8005 Zurich // PGP 0xA581808B // www.liip.ch

Christian Ruttorf

unread,
Dec 11, 2014, 11:10:47 AM12/11/14
to symfony-...@googlegroups.com

thanks, for your time/responses.
Reply all
Reply to author
Forward
0 new messages