jekyll-rdf 3.0.0.pre.develop.333 → 3.0.0.pre.develop.334
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/jekyll/filters/rdf_sparql_query.rb +9 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce8e81b3aea49215c65e58422e36b970864e8a9153dee42925f613a61177e96c
|
4
|
+
data.tar.gz: 7177863c59f5b96c0315f24b47b5b0a6ef49fd22fc891e23cd9803c4891a0652
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 511e8c2eaebbf388f504fea3931bb7ae5d9dbc0d0ad9bef851b52821fa7155552c4ff2500c724ffe8d8963b6a3027892d41b133f088e5bef7b84623859169a63
|
7
|
+
data.tar.gz: 6030083f2482f27450c8823a9bfb34bd7a2b4110261a7ee4e8ff85c3eca816b68096b445c8781385397f7e95580623e1a238c14ce017a7043fa82903fdb0077d
|
@@ -29,7 +29,7 @@ module Jekyll
|
|
29
29
|
# Internal module to hold the medthod #sparql_query
|
30
30
|
#
|
31
31
|
module RdfSparqlQuery
|
32
|
-
|
32
|
+
include Jekyll::RdfPrefixResolver
|
33
33
|
##
|
34
34
|
# Executes a SPARQL query. The supplied query is augmented by replacing each occurence of '?resourceUri' by the URI of the context RDF resource.
|
35
35
|
# Returns an Array of bindings. Each binding is a Hash mapping variables to their values.
|
@@ -40,6 +40,14 @@ module Jekyll
|
|
40
40
|
def sparql_query(resource = nil, query)
|
41
41
|
if(resource.nil? || resource.class <= (Jekyll::RdfPageData))
|
42
42
|
query.gsub!('?resourceUri', "<#{Jekyll::RdfHelper::page.data['rdf'].term}>")
|
43
|
+
elsif(resource.class <= Array)
|
44
|
+
resource.each_with_index do |uri, index|
|
45
|
+
if(uri.class <= Jekyll::Drops::RdfResource)
|
46
|
+
query.gsub!("?resourceUri_#{index}", uri.term.to_ntriples)
|
47
|
+
else
|
48
|
+
query.gsub!("?resourceUri_#{index}", "<#{rdf_resolve_prefix(uri.to_s)}>")
|
49
|
+
end
|
50
|
+
end
|
43
51
|
else
|
44
52
|
query.gsub!('?resourceUri', "<#{resource}>")
|
45
53
|
end
|