jekyll-rdf 3.0.1.pre.develop.597 → 3.0.1.pre.develop.603
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69e331abb5f5d77a0ff200969d3a243f6de1e7cc8bce1b7c50c631b901a75e4b
|
4
|
+
data.tar.gz: 90420ef9c6886f68ebb125a92db4cf45b8a61ca7af662e4665cfcd0e211f761a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75b24f1cef6ef4ba1001472b20fddf541284bd50a8ff57742032c72f4df0114dbc81306214ea4bf99a1a281f36052dfda07704946219695c4939935c6e2c1a4c
|
7
|
+
data.tar.gz: dbfef75a4cb81f215148369bccd58a5c48f9a1628ac2eb851ed6b75b87d5720889a17788cd3939542d1c0620300da3ec2f1d311617d3819a15695fa7e79e9d90
|
@@ -25,7 +25,7 @@
|
|
25
25
|
|
26
26
|
module Jekyll
|
27
27
|
module JekyllRdf
|
28
|
-
module
|
28
|
+
module ResolvePrefixes
|
29
29
|
private
|
30
30
|
def rdf_resolve_prefix(predicate)
|
31
31
|
if(predicate[0] == "<" && predicate[-1] == ">")
|
@@ -50,3 +50,11 @@ module Jekyll
|
|
50
50
|
end
|
51
51
|
end
|
52
52
|
end
|
53
|
+
|
54
|
+
module Jekyll
|
55
|
+
module JekyllRdf
|
56
|
+
module Filter
|
57
|
+
include Jekyll::JekyllRdf::ResolvePrefixes
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -121,6 +121,17 @@ module Jekyll
|
|
121
121
|
end.uniq
|
122
122
|
end
|
123
123
|
|
124
|
+
def extract_list_resources path
|
125
|
+
file = File.open(path, "r")
|
126
|
+
result = []
|
127
|
+
file.each_line {|line|
|
128
|
+
line = line.strip
|
129
|
+
result.push(RDF::URI(line[1..-2])) if (line[0].eql? "<" )&& (line[-1].eql? ">")
|
130
|
+
}
|
131
|
+
file.close
|
132
|
+
result
|
133
|
+
end
|
134
|
+
|
124
135
|
def create_page(site, resource, mapper)
|
125
136
|
Jekyll::JekyllRdf::Helper::RdfPageHelper.prepare_resource resource, mapper
|
126
137
|
page = Jekyll::Page.new(site, site.source, resource.filedir, resource.filename)
|
@@ -33,6 +33,7 @@ module Jekyll
|
|
33
33
|
safe true
|
34
34
|
priority :highest
|
35
35
|
include Jekyll::JekyllRdf::Helper::RdfGeneratorHelper
|
36
|
+
include Jekyll::JekyllRdf::ResolvePrefixes
|
36
37
|
|
37
38
|
##
|
38
39
|
# #generate performs the enrichment of a Jekyll::Site with rdf triples
|
@@ -67,7 +68,11 @@ module Jekyll
|
|
67
68
|
Jekyll::JekyllRdf::Helper::RdfHelper::prefixes = File.join(site.source, @config['prefixes'].strip) unless @config['prefixes'].nil?
|
68
69
|
|
69
70
|
# restrict RDF graph with restriction
|
70
|
-
resources =
|
71
|
+
resources = []
|
72
|
+
resources = resources + extract_resources(@config['restriction'], @config['include_blank'], sparql) unless @config['restriction'].nil?
|
73
|
+
resources = resources + extract_list_resources(File.join(site.config['source'], @config['restriction_file'])) unless @config['restriction_file'].nil?
|
74
|
+
resources = resources + extract_resources(nil, @config['include_blank'], sparql) if resources.length == 0 # subject + predicate + object should only be extracted if there is neither a restriction or restriction_file
|
75
|
+
resources.uniq! unless @config['restriction'].nil? || @config['restriction_file'].nil?
|
71
76
|
site.data['sparql'] = sparql
|
72
77
|
site.data['resources'] = []
|
73
78
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-rdf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.1.pre.develop.
|
4
|
+
version: 3.0.1.pre.develop.603
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elias Saalmann
|
@@ -18,7 +18,7 @@ authors:
|
|
18
18
|
autorequire:
|
19
19
|
bindir: bin
|
20
20
|
cert_chain: []
|
21
|
-
date: 2018-11-
|
21
|
+
date: 2018-11-20 00:00:00.000000000 Z
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
24
24
|
name: net-http-persistent
|