-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add keywords to files during creation #4625
Changes from all commits
40ad9e6
d1a25ef
540b6ac
ef6e2dd
2a1748d
6a5c2dc
6476548
5387384
cdf3c44
8fff4f7
de8f9a8
de025b7
ee364d8
b7d790f
bc5311e
ff7b9ce
a612769
2cfef15
03b922c
ea9f870
4349269
c1ec3d0
aed5448
7ab0340
e791aea
9f15932
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package ch.epfl.bluebrain.nexus.delta.kernel.utils | ||
|
||
import com.github.jknack.handlebars.{EscapingStrategy, Handlebars} | ||
|
||
import scala.jdk.CollectionConverters._ | ||
|
||
class HandlebarsExpander { | ||
|
||
private val handleBars = new Handlebars() | ||
.`with`(EscapingStrategy.NOOP) | ||
|
||
def expand(templateText: String, attributes: Map[String, Any]) = { | ||
if (attributes.isEmpty) { | ||
templateText | ||
} else { | ||
handleBars.compileInline(templateText).apply(attributes.asJava) | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,8 @@ | |
"prefLabel": "http://www.w3.org/2004/02/skos/core#prefLabel", | ||
"name": "http://schema.org/name", | ||
"label": "http://www.w3.org/2000/01/rdf-schema#label", | ||
"description": "http://schema.org/description" | ||
"description": "http://schema.org/description", | ||
"@vocab": "https://bluebrain.github.io/nexus/keywords/" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one should go with indexing-metadata too There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It can now be deleted from here |
||
}, | ||
"@id": "https://bluebrain.github.io/nexus/contexts/elasticsearch-indexing.json" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -182,6 +182,9 @@ | |
} | ||
} | ||
}, | ||
"_keywords": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. keywords.
|
||
"type": "flattened" | ||
}, | ||
"_storage": { | ||
"properties": { | ||
"_rev": { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the issue here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had previously added something else to the handlebars instance which I then removed, although I think this interface is still better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the handlebars thing is only used here, maybe the
HandleBarsExpander
can be here too ?It does not really matters though