Skip to content

Commit

Permalink
example0018
Browse files Browse the repository at this point in the history
  • Loading branch information
nbittich committed Dec 14, 2024
1 parent 840e3c7 commit c4c1e1e
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lib-rdfa/examples/other/example0018.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title></title>
<link href="css/style.css" rel="stylesheet" />
</head>
<body>
<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>
</body>
</html>
9 changes: 9 additions & 0 deletions lib-rdfa/examples/other/example0018.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

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

<https://example.org/reviewer/jane-smith>
rdf:type schema:Person;
schema:name "Jane Smith"@en .
<http://rdfa.info/test-suite/test-cases/rdfa1.1/html5/>
schema:reviewedBy <https://example.org/reviewer/jane-smith> .
4 changes: 4 additions & 0 deletions lib-rdfa/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,9 @@ fn traverse_element<'a, 'b>(
push_triples(stmts, &src_or_href, &pred, &to);
}
}
//example0018
current_node = src_or_href.clone();
rels.take();
}
// example0012
if revs.is_some() {
Expand Down Expand Up @@ -445,6 +448,7 @@ fn traverse_element<'a, 'b>(
push_triples(stmts, &current_node, &predicates, &node);
} else if rels.is_some() {
current_node = make_bnode();

for to in type_ofs.take().into_iter().flatten() {
stmts.push(Statement {
subject: current_node.clone(),
Expand Down
1 change: 1 addition & 0 deletions lib-rdfa/src/tests/other.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const INPUT_OUTPUT_DIR: &str = "examples/other";
#[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 ")]
#[serial]
fn test(test_name: &str) {
cmp_files(
Expand Down

0 comments on commit c4c1e1e

Please sign in to comment.