Skip to content

Commit 61b5914

Browse files
committed
Merge branch 'develop'
2 parents 48189df + d290a9d commit 61b5914

File tree

118 files changed

+1746
-331
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+1746
-331
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
*.rbc
33
*.swp
44
.sass-cache/
5+
.jekyll-cache/
6+
.vendor/
57
/.config
68
/coverage/
79
/InstalledFiles

.travis.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
sudo: required
21
language: ruby
32
services:
43
- docker
54
rvm:
6-
- 2.2.4
7-
- 2.3.0
5+
- 2.3.8
6+
- 2.5.3
7+
- 2.7.0
88
- ruby-head
99
matrix:
1010
allow_failures:
1111
- rvm: ruby-head
1212
before_install:
13-
- docker pull stain/jena-fuseki
14-
- docker build -t remote_sparql .
15-
- docker run -p 3030:3030 -e ADMIN_PASSWORD=admin -d remote_sparql:latest
13+
- docker run -p 3030:3030 -d stain/jena-fuseki:latest ./fuseki-server --mem /remote
14+
- cd test/theme-gem
15+
- bundle install
16+
- cd ../..
1617
script:
1718
- bundle exec rake test
1819
deploy:
@@ -21,10 +22,12 @@ deploy:
2122
secure: D8rx4lfdlvWFjXPrHTOXudIrUpjBHu++4ebWzNcXNdk8ccNtRbkWCqK7vOp7BAXu8NXGQOT/XoHmcwuzOpaLMiPL6B+eNTPWnC2wqeQUlZcZak6btFXwMivKXRT5oyIP/UjciucLDN9jq+54fdr5M7+nJ+3D7upUA2P3ymb+69U0l0bXl9WA+c92LRi/wXXeyxdpImHym8PxBagS6GPiHswcHoeRRq5vNEmo/E9RYV5F0Kzyj8vOchO/83cDeqeQEPX969AtO0AKZczWfNx2qOBgcYcUmxfOdAooOnFYjw3A9QZgI3B/T7LC1137mCLQCcb/e0cFPiwQYxDXS8SEEd1t4t/4Tw/zUh+TFuSAbCPJz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htk0uhJCIQMm8Jri1o5600szSW+lG20KSkg=
2830
gem: jekyll-rdf
2931
on:
32+
condition: $TRAVIS_RUBY_VERSION = 2.7.0
3033
branch: develop

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## [3.2.0] - 2022-02-28
8+
### Added
9+
- Support for Ruby 3
10+
- New `resource.rendered` attribute to check if a page is rendered in the present site for this resource.
11+
12+
### Changed
13+
- Repository moved from https://github.com/white-gecko/jekyll-rdf/ to https://github.com/AKSW/jekyll-rdf/
14+
- Add possibility to specify the default graph on a SPARQL endpoint
15+
- Update class-template selection to be straightforward
16+
- Update dependencies
17+
- Minor code cleanup
18+
- Some updates in the test/build system
19+
- Remove some warnings
20+
721
## [3.1.0] - 2018-11-27
822
### Added
923
- Allow building sites from a (remote) SPARQL endpoint by setting `remote:\n endpoint: <endpointuri>` in the `_config.yml`. (Currently only querying the default default-graph ;-). Specifying the default graph, with `FROM` resp. `default-graph-uri` will come in the future, https://github.com/white-gecko/jekyll-rdf/pull/220.)

Dockerfile

Lines changed: 0 additions & 4 deletions
This file was deleted.

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
source 'https://rubygems.org'
22

3+
4+
gem "theme-gem", :path => 'test/theme-gem'
35
gemspec
6+

LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
MIT License
22

3+
Copyright (c) 2016-2019 Sebastian Zänker, Natanael Arndt
34
Copyright (c) 2016 Elias Saalmann, Christian Frommert, Simon Jakobi,
45
Arne Jonas Präger, Maxi Bornmann, Georg Hackel, Eric Füg
56

README.md

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# jekyll-rdf
1+
# Jekyll RDF
22

33
A [Jekyll plugin](https://jekyllrb.com/docs/plugins/) for including RDF data in your static site.
44

55
[![Gem Version](https://badge.fury.io/rb/jekyll-rdf.svg)](https://badge.fury.io/rb/jekyll-rdf)
6-
[![Build Status](https://travis-ci.org/white-gecko/jekyll-rdf.svg?branch=develop)](https://travis-ci.org/white-gecko/jekyll-rdf)
7-
[![Coverage Status](https://coveralls.io/repos/github/white-gecko/jekyll-rdf/badge.svg?branch=develop)](https://coveralls.io/github/white-gecko/jekyll-rdf?branch=develop)
6+
[![Build Status](https://travis-ci.org/AKSW/jekyll-rdf.svg?branch=develop)](https://travis-ci.org/AKSW/jekyll-rdf)
7+
[![Coverage Status](https://coveralls.io/repos/github/AKSW/jekyll-rdf/badge.svg?branch=develop)](https://coveralls.io/github/AKSW/jekyll-rdf?branch=develop)
88

99
The API Documentation is available at [RubyDoc.info](http://www.rubydoc.info/gems/jekyll-rdf/).
1010

@@ -27,15 +27,12 @@ The API Documentation is available at [RubyDoc.info](http://www.rubydoc.info/gem
2727
As a prerequisite for *Jekyll RDF* you of course need to install [*Jekyll*](https://jekyllrb.com/).
2828
Please take a look at the installations instructions at https://jekyllrb.com/docs/installation/.
2929

30-
If you already have a working Jekyll installation you can add the the Jekyll-RDF plugin.
30+
If you already have a working Jekyll installation you can add the Jekyll-RDF plugin.
3131
Probably you already using [Bundler](https://bundler.io/) and there is a [`Gemfile`](https://bundler.io/gemfile.html) in your Jekyll directory.
3232
Add Jekyll-RDF to the plugins section:
3333

3434
```
35-
group :jekyll_plugins do
36-
gem "jekyll-rdf", '~> 3.0.0.pre.a'
37-
38-
end
35+
gem "jekyll-rdf", "~> 3.2"
3936
```
4037

4138
Replace the version string with the currently available stable release as listed on [rubygems.org](https://rubygems.org/gems/jekyll-rdf).
@@ -66,7 +63,7 @@ jekyll new my_page
6663
cd my_page
6764
```
6865

69-
Further there are some parameters required in your `_config.yml` for `jekyll-rdf`. I.e. the `url` and `baseurl` parameters are used for including the resource pages into the root of the site, the plug-in has to be configured, and the path to the RDF file has to be present.
66+
Further, there are some parameters required in your `_config.yml` for `jekyll-rdf`. I.e. the `url` and `baseurl` parameters are used for including the resource pages into the root of the site, the plug-in has to be configured, and the path to the RDF file has to be present.
7067

7168
```yaml
7269
baseurl: "/simpsons"
@@ -85,6 +82,20 @@ jekyll_rdf:
8582
"http://example.org/simpsons/Abraham": "abraham.html"
8683
```
8784
85+
### Base Path Specification
86+
The `url` + `baseurl` are used by Jekyll RDF to identify relative to which URL it should build the RDF resource pages.
87+
In the example above this means that a resource with the IRI `<http://example.org/simpsons/Bart>` is rendered to the path `/Bart.html`.
88+
Also other features and plugins for Jekyll depend on these two parameters.
89+
If for any case the two parameters differ from the base path that Jekyll RDF should assume, it is possible to set the parameter `baseiri` in the `jekyll_rdf` section.
90+
91+
```yaml
92+
baseurl: "/simpsons"
93+
url: "https://beispiel.com"
94+
95+
jekyll_rdf:
96+
baseiri: "http://example.org/"
97+
```
98+
8899
### Map resources to templates
89100
It is possible to map a specific class (resp. RDF-type) or individual resources to a template.
90101
```yaml
@@ -110,7 +121,7 @@ You can restrict the resources selected to be built by adding a SPARQL query as
110121
restriction: "SELECT ?resourceUri WHERE { ?resourceUri <http://www.ifi.uio.no/INF3580/family#hasFather> <http://www.ifi.uio.no/INF3580/simpsons#Homer> }"
111122
```
112123

113-
There are 3 pre-defined keywords for restrictions implemented:
124+
There are 3 predefined keywords for restrictions implemented:
114125
* `subjects` will load all subject URIs
115126
* `predicates` will load all predicate URIs
116127
* `objects` will load all object URIs
@@ -127,7 +138,7 @@ A file `_data/restriction.txt` cool have the following content:
127138
```
128139

129140
In the `_config.yml` you specify the file with the key `restriction_file`.
130-
If both, a `restriction_file` and a `restriction`, are specified JekyllRDF will build pages for the union of the both.
141+
If both, a `restriction_file` and a `restriction`, are specified Jekyll RDF will build pages for the union of the both.
131142

132143
### Blank Nodes
133144
Furthermore you can decide if you want to render blank nodes or not. You just need to add `include_blank`to `_config.yml`:
@@ -146,7 +157,7 @@ jekyll_rdf:
146157
## Building the Jekyll Site
147158

148159
Running `jekyll build` will render the RDF resources to the `_site/…` directory. Running `jekyll serve` will render the RDF resources and provide you with an instant HTTP-Server usually accessible at `http://localhost:4000/`.
149-
RDF resources whose IRIs don't start with the configured jekyll `url` and `baseurl` are rendered to the `_site/rdfsites/…` subdirectory.
160+
RDF resources whose IRIs don't start with the configured Jekyll `url` and `baseurl` (resp. `baseiri`) are rendered to the `_site/rdfsites/…` sub directory.
150161

151162
## Defining Templates
152163
To make use of the RDF data, create one or more files (e.g `rdf_index.html` or `person.html`) in the `_layouts`-directory. For each resource a page will be rendered. See example below:
@@ -271,8 +282,8 @@ The template for `ex:Resource`:
271282
```
272283

273284
### Custom SPARQL Query
274-
We implemented a liquid filter `sparql_query` to run custom SPARQL queries. Each occurence of `?resourceUri` gets replaced with the current URI.
275-
*Caution:* You have to separate query and resultset variables because of Liquids concepts. Example:
285+
We implemented a liquid filter `sparql_query` to run custom SPARQL queries. Each occurrence of `?resourceUri` gets replaced with the current URI.
286+
*Caution:* You have to separate query and result set variables because of Liquids concepts. Example:
276287
```html
277288
{% assign query = 'SELECT ?sub ?pre WHERE { ?sub ?pre ?resourceUri }' %}
278289
{% assign resultset = page.rdf | sparql_query: query %}
@@ -342,8 +353,12 @@ Return the URL of the page representing this RdfResource.
342353
Return the path to the page representing this RdfResource. Use it with care.
343354

344355
### Resource.covered
345-
This method is relevant for rendering pages for IRIs containing a fragment identifier (`http://superresource#anchor`).
346-
This method returns true for the super-resource (`http://superresource`) if it is actually described in the given knowledgebase.
356+
This attribute is relevant for rendering pages for IRIs containing a fragment identifier (`http://superresource#anchor`).
357+
This attribute is true for the super-resource (`http://superresource`) if it is actually described in the given knowledge base.
358+
359+
### Resource.rendered
360+
This attribute tells if the respective instance of a resource is rendered within the context of the current site generation.
361+
Usage: `{% if resource.rendered? %}…{% endif %}`.
347362

348363
### Resource.inspect
349364
Returns a verbose String representing this resource.
@@ -379,7 +394,7 @@ http://www.ifi.uio.no/INF3580/simpsons
379394
- `<list>` is a boolean value (`true`, `false`).
380395

381396
**Description:** Returns the object, of the triple `<rdf_resource> <predicate> ?object`.
382-
The returned object can by any of the kind, resource, literal, or blanknode.
397+
The returned object can by any of the kind, resource, literal, or blank node.
383398

384399
**Example (default):**
385400
```
@@ -436,7 +451,7 @@ The returned object can by any of the kind, resource, literal, or blanknode.
436451

437452
**Description:** Same as rdf_property, but in inverse direction.
438453
It returns the subject, of the triple `?subject <predicate> <rdf_resource>`.
439-
The returned object can by any of the kind, resource, or blanknode.
454+
The returned object can by any of the kind, resource, or blank node.
440455

441456
**Examples (default):**
442457
```
@@ -489,7 +504,7 @@ You can use `?resourceUri` inside the query to reference the resource which is g
489504
```
490505
<!--Rendering the page of resource Lisa -->
491506
{% assign query = 'SELECT ?sub ?pre WHERE { ?sub ?pre ?resourceUri }' %}
492-
{% assign resultset = page | sparql_query: query %}
507+
{% assign resultset = page.rdf | sparql_query: query %}
493508
<table>
494509
{% for result in resultset %}
495510
<tr><td>{{ result.sub }}</td><td>{{ result.pre }}</td></tr>
@@ -649,8 +664,9 @@ http://www.ifi.uio.no/INF3580/simpsons#Maggie
649664
|Name|Parameter|Default|Description|Example|
650665
|--- |--- |--- |--- |--- |
651666
|path|Relative path to the RDF-File|no default|Specifies the path to the RDF file from where you want to render the website|```path: "rdf-data/simpsons.ttl"```|
652-
|remote|Section to specify a remote data source|no default|Has to contain the `endpoint` key. The `remote` paramter overrides the `path` parameter.||
667+
|remote|Section to specify a remote data source|no default|Has to contain the `endpoint` key. The `remote` parameter overrides the `path` parameter.||
653668
|remote > endpoint|SPARQL endpoint to get the data from|no default|Specifies the URL to the SPARQL endpoint from where you want to render the website|```remote: endpoint: "http://localhost:5000/sparql/"```|
669+
|remote > default_graph|Select a named graph on the endpoint to use in place of the endpoint default graph|no default|Specifies the IRI to the named graph to select from the SPARQL endpoint|```remote: endpoint: "http://localhost:5000/sparql/" default_graph: "http://example.org/"```|
654670
|language|Language-Tag as String|no default|Specifies the preferred language when you select objects using our Liquid filters|```language: "en"```|
655671
|include_blank|Boolean-Expression|false|Specifies whether blank nodes should also be rendered or not|```include_blank: true```|
656672
|restriction|SPARQL-Query as String or subjects/objects/predicates|no default|Restricts the resource-selection with a given SPARQL-Query to the results bound to the special variable `?resourceUri` or the three keywords `subjects` (only subject URIs), `objects`, `predicates`|```restriction: "SELECT ?resourceUri WHERE { ?resourceUri <http://www.ifi.uio.no/INF3580/family#hasFather> <http://www.ifi.uio.no/INF3580/simpsons#Homer> }"```|
@@ -664,7 +680,7 @@ http://www.ifi.uio.no/INF3580/simpsons#Maggie
664680
## Installation from source
665681
To install the project with the git-repository you will need `git` on your system. The first step is just cloning the repository:
666682
```
667-
git clone git@github.com:white-gecko/jekyll-rdf.git
683+
git clone git@github.com:AKSW/jekyll-rdf.git
668684
```
669685
A folder named `jekyll-rdf` will be automatically generated. You need to switch into this folder and compile the ruby gem to finish the installation:
670686
```
@@ -679,7 +695,7 @@ bundle exec rake test
679695
```
680696

681697
## Test page
682-
Everytime the tests are executed, the Jekyll page inside of `test/source` gets processed. Start a slim web server to watch the results in web browser, e.g. Pythons `SimpleHTTPServer` (Python 2, for Python 3 it's `http.server`):
698+
Every time the tests are executed, the Jekyll page inside of `test/source` gets processed. Start a slim web server to watch the results in web browser, e.g. Pythons `SimpleHTTPServer` (Python 2, for Python 3 it's `http.server`):
683699
```
684700
cd test/source/_site
685701
python -m SimpleHTTPServer 8000

Rakefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@ require 'rdoc/task'
2020
RDoc::Task.new do |rdoc|
2121
rdoc.rdoc_files.include("lib/**/*.rb")
2222
end
23-

jekyll-rdf.gemspec

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
VERSION = '3.1.0'
1+
# coding: utf-8
2+
VERSION = '3.2.0'
23
RELEASE_VERSION = case
34
when ENV['TRAVIS'] && ENV['TRAVIS_BRANCH'].match(/^master$/i) then "#{VERSION}"
45
when ENV['TRAVIS'] && ENV['TRAVIS_BRANCH'].match(/^develop$/i) then "#{VERSION}-#{ENV['TRAVIS_BRANCH']}.#{ENV['TRAVIS_BUILD_NUMBER']}"
@@ -13,18 +14,19 @@ Gem::Specification.new do |s|
1314
s.authors = ['Elias Saalmann', 'Christian Frommert', 'Simon Jakobi', 'Arne Jonas Präger', 'Maxi Bornmann', 'Georg Hackel', 'Eric Füg', 'Sebastian Zänker', 'Natanael Arndt', 'Simon Bin', 'Jan Beckert']
1415
s.email = 'arndt@informatik.uni-leipzig.de'
1516
s.files = Dir['lib/**/*.rb']
16-
s.homepage = 'https://github.com/white-gecko/jekyll-rdf'
17+
s.homepage = 'https://github.com/AKSW/jekyll-rdf'
1718
s.license = 'MIT'
18-
s.add_runtime_dependency 'net-http-persistent', '~> 2.9' # https://github.com/white-gecko/jekyll-rdf/issues/197
19-
s.add_runtime_dependency 'linkeddata', '~> 2.0'
20-
s.add_runtime_dependency 'sparql', '~> 2.2', '>= 2.2.1'
21-
s.add_runtime_dependency 'jekyll', '~> 3.1'
22-
s.add_development_dependency 'rake', '~> 10.4'
23-
s.add_development_dependency 'rest-client', '~> 1.8'
19+
s.add_runtime_dependency 'linkeddata', '~> 3.2', '>= 3.2.0'
20+
s.add_runtime_dependency 'sparql-client', '~> 3.2', '>= 3.2.0'
21+
s.add_runtime_dependency 'jekyll', '>= 3.1'
22+
s.add_development_dependency 'rake', '~> 13.0'
23+
s.add_development_dependency 'rest-client', '~> 2.0', '>= 2.0.1'
2424
s.add_development_dependency 'coveralls', '~> 0.8'
2525
s.add_development_dependency 'test-unit', '~> 3.0'
2626
s.add_development_dependency 'shoulda-context', '~> 1.1'
2727
s.add_development_dependency 'rspec', '~> 3.0'
2828
s.add_development_dependency 'pry-byebug', '~> 3.4'
29+
s.add_development_dependency 'rdoc', '~> 6.2', '>= 6.2.1'
2930
s.add_development_dependency 'jekyll-theme-jod', '~> 0.1.5'
31+
s.add_development_dependency 'kramdown-parser-gfm', '~> 1.1'
3032
end

lib/jekyll-rdf.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
require 'jekyll/drops/rdf_literal'
4444
require 'jekyll/drops/rdf_resource'
4545
require 'jekyll/drops/rdf_resource_class'
46+
require 'jekyll/drops/rdf_graph'
4647
require 'jekyll/exceptions/NoPrefixMapped'
4748
require 'jekyll/exceptions/NoPrefixesDefined'
4849
require 'jekyll/exceptions/UnMarkedUri'
@@ -51,15 +52,15 @@
5152
require 'jekyll/helper/rdf_class_extraction'
5253
require 'jekyll/helper/rdf_page_helper'
5354
require 'jekyll/helper/rdf_generator_helper'
55+
require 'jekyll/helper/rdf_filter_helper'
56+
require 'jekyll/helper/rdf_hook_helper'
5457
require 'jekyll/hooks/rdf_page_pointer'
55-
require 'jekyll/filters/rdf_resolve_prefix'
5658
require 'jekyll/filters/rdf_sparql_query'
5759
require 'jekyll/filters/rdf_property'
5860
require 'jekyll/filters/rdf_collection'
5961
require 'jekyll/filters/rdf_container'
6062
require 'jekyll/filters/rdf_get'
6163
require 'jekyll/filters/rdf_debug_message'
62-
require 'jekyll/filters/rdf_page_to_resource'
6364

6465

6566
Liquid::Template.register_filter(Jekyll::JekyllRdf::Filter)

0 commit comments

Comments
 (0)