Skip to content

Commit

Permalink
example0019
Browse files Browse the repository at this point in the history
  • Loading branch information
nbittich committed Dec 14, 2024
1 parent c4c1e1e commit 585212d
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 10 deletions.
87 changes: 87 additions & 0 deletions lib-rdfa/examples/other/example0019.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<!doctype html>
<html prefix="dc: http://purl.org/dc/elements/1.1/ schema: http://schema.org/">
<head>
<title>Complex RDFa Example with rev</title>
</head>
<body>
<article
typeof="schema:Book"
about="https://example.org/book/the-great-novel"
>
<h1 property="dc:title">The Great Novel</h1>
<p>
Written by
<span
property="schema:author"
typeof="schema:Person"
about="https://example.org/author/john-doe"
>
<span property="schema:name">John Doe</span> </span
>.
</p>
<p>
Published by
<span
property="schema:publisher"
typeof="schema:Organization"
about="https://example.org/publisher/fictional-publishers"
>
<span property="schema:name">Fictional Publishers</span>
</span>
in
<time property="schema:datePublished" datetime="2023-01-01"
>January 2023</time
>.
</p>
<p>
Reviewed by
<a
href="https://example.org/reviewer/jane-smith"
rel="schema:reviewedBy"
typeof="schema:Person"
>
<span property="schema:name">Jane Smith</span> </a
>.
</p>
<p>
<a
href="https://example.org/library/city-library"
rev="schema:hasPart"
typeof="schema:Library"
>
Part of City Library Collection
</a>
</p>
<p>
<a
href="https://example.org/book/the-sequel"
rev="schema:prequel"
typeof="schema:Book"
>
Prequel: The Sequel
</a>
</p>
</article>

<footer>
<p>
<a
href="https://example.org/book/the-great-novel"
rel="schema:hasReview"
typeof="schema:Review"
>
Read reviews for The Great Novel
</a>
</p>
<p>
<a
href="https://example.org/publisher/fictional-publishers"
rev="schema:publisher"
typeof="schema:Book"
>
Published books by Fictional Publishers
</a>
</p>
</footer>
</body>
</html>
35 changes: 35 additions & 0 deletions lib-rdfa/examples/other/example0019.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

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

<https://example.org/book/the-great-novel>
rdf:type schema:Book;
rdf:type schema:Review;
<http://purl.org/dc/elements/1.1/title> "The Great Novel";
schema:datePublished "2023-01-01"^^xsd:date;
schema:reviewedBy <https://example.org/reviewer/jane-smith> .
<https://example.org/author/john-doe>
rdf:type schema:Person;
schema:author """
John Doe """;
schema:name "John Doe" .
<https://example.org/publisher/fictional-publishers>
rdf:type schema:Organization;
rdf:type schema:Book;
schema:publisher """
Fictional Publishers
""";
schema:publisher <http://rdfa.info/test-suite/test-cases/rdfa1.1/html5/>;
schema:name "Fictional Publishers" .
<https://example.org/reviewer/jane-smith>
rdf:type schema:Person;
schema:name "Jane Smith" .
<https://example.org/library/city-library>
rdf:type schema:Library;
schema:hasPart <https://example.org/book/the-great-novel> .
<https://example.org/book/the-sequel>
rdf:type schema:Book;
schema:prequel <https://example.org/book/the-great-novel> .
<http://rdfa.info/test-suite/test-cases/rdfa1.1/html5/>
schema:hasReview <https://example.org/book/the-great-novel> .
2 changes: 1 addition & 1 deletion lib-rdfa/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mod earl_html5;
mod other;
mod rdfa_core;
mod rdfa_primer;
const DEBUG: bool = false;
const DEBUG: bool = true;
const WRITE_RESULT_TO_FILE: bool = true;
const WRITE_DIFF_TO_FILE: bool = true;

Expand Down
19 changes: 10 additions & 9 deletions lib-rdfa/src/tests/other.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ const INPUT_OUTPUT_DIR: &str = "examples/other";
#[test_case("example0007" ; "test with plain literal content : other_0007 ")]
#[test_case("example0008" ; "test with plain literal content and href : other_0008 ")]
#[test_case("example0009" ; "test with html content and href : other_0009 ")]
#[test_case("example0010" ; "Generated by chatgpt #1 (Rel) : other_0010 ")]
#[test_case("example0011" ; "Generated by chatgpt #2 (Rel) : other_0011 ")]
#[test_case("example0012" ; "Generated by chatgpt #3 (Rel) : other_0012 ")]
#[test_case("example0013" ; "Generated by chatgpt #4 (Rel) : other_0013 ")]
#[test_case("example0014" ; "Generated by chatgpt #5 (Rel) : other_0014 ")]
#[test_case("example0015" ; "Generated by chatgpt #6 (Rel) : other_0015 ")]
#[test_case("example0016" ; "Generated by chatgpt #7 (Rev) : other_0016 ")]
#[test_case("example0017" ; "Generated by chatgpt #8 (Rev) : other_0017 ")]
#[test_case("example0018" ; "Generated by chatgpt #9 (Rel) : other_0018 ")]
#[test_case("example0010" ; "Generated by chatgpt #01 (Rel) : other_0010 ")]
#[test_case("example0011" ; "Generated by chatgpt #02 (Rel) : other_0011 ")]
#[test_case("example0012" ; "Generated by chatgpt #03 (Rel) : other_0012 ")]
#[test_case("example0013" ; "Generated by chatgpt #04 (Rel) : other_0013 ")]
#[test_case("example0014" ; "Generated by chatgpt #05 (Rel) : other_0014 ")]
#[test_case("example0015" ; "Generated by chatgpt #06 (Rel) : other_0015 ")]
#[test_case("example0016" ; "Generated by chatgpt #07 (Rev) : other_0016 ")]
#[test_case("example0017" ; "Generated by chatgpt #08 (Rev) : other_0017 ")]
#[test_case("example0018" ; "Generated by chatgpt #09 (Rel) : other_0018 ")]
#[test_case("example0019" ; "Generated by chatgpt #10 : other_0019 ")]
#[serial]
fn test(test_name: &str) {
cmp_files(
Expand Down

0 comments on commit 585212d

Please sign in to comment.