Skip to content

Commit 414e42e

Browse files
committed
Add prefixes to test gem
1 parent 8fe18a4 commit 414e42e

File tree

4 files changed

+26
-5
lines changed

4 files changed

+26
-5
lines changed

test/cases/prefixesInPostsWithGemTheme/_data/knowledge-base.ttl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@
33

44
<http://example.org/blog> a owl:Ontology ;
55
rdfs:label "My Jekyll RDF Blog" .
6+
7+
<http://example.org/2019/02/12/Blogpost> a owl:Ontology ;
8+
rdfs:label "My Jekyll RDF Blogpost" .

test/cases/prefixesInPostsWithGemTheme/test_prefixes.rb

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,26 @@ class TestPrefixes < Test::Unit::TestCase
88

99
content = []
1010
file = File.read(File.join(@source, "_site/2019/02/12/Blogpost.html"))
11-
content = file[/\<body\>(.|\s)*\<\/body\>/][6..-6].strip.split("\n").map do |entry|
11+
content = file[/\<body\>(.|\s)*\<\/body\>/][6..-6].strip.split("<br/>").map do |entry|
1212
entry.strip
1313
end
1414

15-
#TODO This test case has to be completed once jekyll runs successfull
16-
1715
assert_equal "<h1>My Jekyll RDF Blog</h1>", content[0]
1816
assert_equal "<p>This is a Blogpost</p>", content[1]
17+
# this line has to be uncommented once page.rdf is set in posts
18+
#assert_equal "My Jekyll RDF Blogpost", content[2]
19+
assert_equal "My Jekyll RDF Blog", content[3]
20+
21+
content = []
22+
file = File.read(File.join(@source, "_site/blog.html"))
23+
content = file[/\<body\>(.|\s)*\<\/body\>/][6..-6].strip.split("<br/>").map do |entry|
24+
entry.strip
25+
end
26+
27+
assert_equal "<h1>My Jekyll RDF Blog</h1>", content[0]
28+
assert_equal "A page", content[1]
29+
assert_equal "My Jekyll RDF Blog", content[2]
30+
assert_equal "My Jekyll RDF Blog", content[3]
1931
end
2032
end
2133
end
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
PREFIX ex: <http://example.org/>
2+
PREFIX jb: <http://jekyllrdf.biz/>
3+
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
rdf_prefix_path: "_data/prefixes.sparql"
23
---
34
<html>
45
<head>
@@ -7,7 +8,9 @@
78
<meta name="viewport" content="width=device-width, initial-scale=1.0">
89
</head>
910
<body>
10-
<h1>My Jekyll RDF Blog</h1>
11-
{{content}}
11+
<h1>My Jekyll RDF Blog</h1><br/>
12+
{{content}}<br/>
13+
{{ page.rdf | rdf_property: "rdfs:label" }}<br/>
14+
{{ "<http://example.org/blog>" | rdf_get | rdf_property: "rdfs:label" }}<br/>
1215
</body>
1316
</html>

0 commit comments

Comments
 (0)