Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML Markup stripped from RDFa using datatype="HTML" on http://easyrdf.org/converter #303

Open
BigBlueHat opened this issue Sep 21, 2018 · 4 comments

Comments

@BigBlueHat
Copy link

For example:

<article typeof="schema:ScholarlyArticle" resource="#">
  <div property="schema:articleBody" datatype="rdf:HTML">
    <h1>Amazing Science!</h1>
    <p>...like...<strong>really</strong> amazing science!</p>
  </div>
</article>

results in:

@prefix schema: <http://schema.org/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

<http://njh.me/#>
  a schema:ScholarlyArticle ;
  schema:articleBody """
    Amazing Science!
    ...like...really amazing science!
  """^^rdf:HTML .

However, if the datatype is changed to rdf:XMLLiteral the markup is kept:

@prefix schema: <http://schema.org/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

<http://njh.me/#>
  a schema:ScholarlyArticle ;
  schema:articleBody """
    <h1>Amazing Science!</h1>
    <p>...like...<strong>really</strong> amazing science!</p>
  """^^rdf:XMLLiteral 

Not sure if this is a bug or a missing feature, but it would be super great to have it working. 😄

You can test the same RDFa markup in the Ruby Distiller to see the correct rdf:HTML Turtle output:
http://rdf.greggkellogg.net/distiller?command=serialize&format=rdfa&output_format=turtle

Let me know how I can help!
🎩

@BigBlueHat BigBlueHat changed the title HTML Markup stripped from RDFa using datatype="HTML" HTML Markup stripped from RDFa using datatype="HTML" on http://easyrdf.org/converter Sep 21, 2018
@BigBlueHat
Copy link
Author

I renamed the topic to narrow the focus. This happens when using the http://easyrdf.org/converter which means this is probably the wrong repo...and I should file it over here https://github.com/njh/www.easyrdf.org/

That said, having the stripTags() feature seems to remove the value of using rdf:HTML datatype with this parser--which may throw out the markup. If that's what the person encoding the graph into RDFa wanted, they wouldn't have used the rdf:HTML datatype.

Thoughts?

@njh
Copy link
Collaborator

njh commented Sep 21, 2018

Yeah, this is a known missing feature. Implementing the whole of RDFa is hard!

@BigBlueHat
Copy link
Author

Thanks for the reply!

@njh can you point me at what things still need doing for this?

There's renewing interest in RDFa (see also https://github.com/awwright/node-rdfa/), and I'd love to help get this (and other) tools closer to RDFa 1.1 Core compatibility.

@njh
Copy link
Collaborator

njh commented Sep 22, 2018

The RDFa test suite shows how much EasyRdf currently supports:
http://rdfa.info/test-suite/

But yes, I need to do a new release and deploy it to easyrdf.org.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants