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

Question: Jekyll-RDF Variable Comparison #72

Closed FTeichmann closed 7 years ago

FTeichmann commented 7 years ago

I encountered a bug when I tried to compare an assigned Jekyll Variable to Jekyll-RDF Page Variables.

example Graph: https://gist.github.com/FTeichmann/790a65370e40582867cb9f8eb1c13672

example Layout: https://gist.github.com/FTeichmann/062e7ac585e3daca6e6ad532d24b1518

As the workaround with {% assign variable1 = page.rdf.iri | downcase %} suggests, there may be a problem with the datatype.

white-gecko commented 7 years ago

@Simaris can you reproduce this behavior with the latest develop branch?

Simaris commented 7 years ago

@FTeichmann you guess about datatypes is correct. result.resource has the same object type as page.rdf, while page.rdf.iri is a string. A better workaround would be

{% if page.rdf.iri == result.resource.iri %}
  This is me!
{% endif %}
white-gecko commented 7 years ago

If I understand it correctly

{% if page.rdf == result.resource %}
  This is me!
{% endif %}

should work as well?

Simaris commented 7 years ago

No that wouldn't work because we didn't implement a .equal? method.

white-gecko commented 7 years ago

Ok, so we could implement an .equal? method in some future release.