Skip to content
This repository has been archived by the owner on Nov 11, 2019. It is now read-only.

Use the same example for JSON-LD and RDFa #80

Closed
iherman opened this issue Oct 11, 2017 · 6 comments
Closed

Use the same example for JSON-LD and RDFa #80

iherman opened this issue Oct 11, 2017 · 6 comments
Assignees

Comments

@iherman
Copy link
Member

iherman commented Oct 11, 2017

I believe it would be better to use the same example for JSON-LD, RDFa (and JSON). It is better for the readability of the document...

(There may be several examples; the current RDFa example contains the itemref trick, which is great because RDFa can indeed reproduce that...)

@iherman
Copy link
Member Author

iherman commented Oct 11, 2017

I have run the RDFa Generation algorithm by hand, and this is what I got:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>My Blog</title>
    <base href="http://blog.example.com/progress-report">
</head>
<body>
    <article vocab="https://schema.org/" typeof="BlogPosting">
        <header>
            <h1 property="headline">Progress report</h1>
            <p><time property="datePublished" datetime="2013-08-29">today</time></p>
            <link property="url" href="?comments=0">
        </header>
        <p>All in all, he's doing well with his swim lessons. The biggest thing was he had trouble
        putting his head in, but we got it down.</p>
        <section>
            <h1>Comments</h1>
            <article property="comment" vocab="https://schema.org/" typeof="Comment" id="c1">
                <link property="url" href="#c1">
                <footer>
                    <p>
                        Posted by: <span property="creator" vocab="https://schema.org/" typeof="Person">
                                        <span property="name">Greg</span>
                                   </span>
                    </p>
                    <p><time property="dateCreated" datetime="2013-08-29">15 minutes ago</time></p>
                </footer>
                <p>Ha!</p>
            </article>
            <article property="comment" vocab="https://schema.org/" typeof="Comment" id="c2">
                <link property="url" href="#c2">
                <footer>
                    <p>
                        Posted by: <span property="creator" vocab="https://schema.org/" typeof="Person">
                                        <span property="name">Charlotte</span>
                                   </span>
                    </p>
                    <p><time property="dateCreated" datetime="2013-08-29">5 minutes ago</time></p>
                </footer>
                <p>When you say "we got it down"...</p>
            </article>
        </section>
    </article>
</body>
</html>

I have also run it through my RDFa converter to produce turtle. I do not think that the turtle result should be in the document, but I have put it up in a separate gist.

@iherman
Copy link
Member Author

iherman commented Oct 11, 2017

@gkellogg, can you compare the Turtle output of your JSON-LD tool with the the example in turtle via RDFa? The two graphs should be equivalent...

(B.t.w., we may want to think about a testing environment whereby the conversions to RDFa and the conversions to JSON-LD would be compared as for their RDF representations to see whether they are equivalent. If not, we have a problem...)

@iherman
Copy link
Member Author

iherman commented Oct 11, 2017

(Just a small editorial remark: in the example above I added a <base> element to the header to ensure using the right URL in the generated RDF.)

@chaals chaals self-assigned this Oct 11, 2017
@chaals
Copy link
Collaborator

chaals commented Oct 11, 2017

Think it makes sense to have several examples, and definitely work the same ones for each conversion. I've assigned myself (but please feel free to generate Pull Requests that do some of the work me ;) )...

@gkellogg
Copy link
Member

@iherman, I recommend you to my distiller for checking out different examples. It has up-to-date algorithms, and allows you to invoke the specific Microdata to RDFa and to JSON-LD algorithms (at least as I've implemented them).

chaals pushed a commit that referenced this issue Nov 12, 2017
Fix #78, #80

The JSON-LD direct conversion algorithm is harder to get right, and is
redundant in practice.

Clarify that the "JSON" conversion is explicitly for
`application/microdata+json` and mark it as obsolete but conforming
since it seems to have been removed from current versions of known
implementations.

(And update status)
danbri pushed a commit that referenced this issue Nov 23, 2017
Fix #78, #80

The JSON-LD direct conversion algorithm is harder to get right, and is
redundant in practice.

Clarify that the "JSON" conversion is explicitly for
`application/microdata+json` and mark it as obsolete but conforming
since it seems to have been removed from current versions of known
implementations.

(And update status)
@danbri
Copy link
Contributor

danbri commented Apr 20, 2018

JSON-LD section has gone, so this is no longer needed.

@danbri danbri closed this as completed Apr 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants