AKSW / jekyll-rdf

📃 A Jekyll plugin to include RDF data in your static site or build a complete site for your RDF graph
http://aksw.org/Projects/JekyllRDF
Other
57 stars 10 forks source link

page.rdf is over used #109

Closed Simaris closed 6 years ago

Simaris commented 7 years ago

most filters in jekyll-rdf are currently used in the form {{page.rdf | rdf_our_filter: main_parameter, other_parameter...}} the usage of page.rdf in seemingly unrelated filters looks awkward and is probably confusing to newcomers

108 contains approaches to use filters in the form

{{main_parameter | rdf_our_filter: other_parameter...}}

this should be the form all filters except rdf_property utilize from 3.0.0 onwards

white-gecko commented 7 years ago

Could you please add some example, how the liquid code would look now and how you intend it to be.

Simaris commented 7 years ago

the only real example of this would be

{% assign query = 'SELECT ?sub ?pre WHERE { ?sub ?pre ?resourceUri }' %}
{% assign resultset = page.rdf | sparql_query: query %}

=>

{% assign resultset = 'SELECT ?sub ?pre WHERE { ?sub ?pre <http://page.rdfs/uri> }' | sparql_query %}

If we have to keep ?resourceUri we should use

{% assign resultset = 'SELECT ?sub ?pre WHERE { ?sub ?pre <http://page.rdfs/uri>}' | sparql_query: page.rdf%}

the problems in other filters are that they rely too much on variables provided by page.rdf and other resources, making it easy to compromise them by mistake and creating the need to provide all resources with these variables.