Hash :
ccd0b9a2
Author :
Thomas de Grivel
Date :
2024-10-29T11:28:52
defmodule Fx do
def property_index = fn (path) {
if Str.starts_with?(path, "./") do
path = Str.slice(path, 2, -1)
end
Facts.collect_with_tags(Config.db, path, p = ?, o = ?, fn (fact) {
{p, o}
})
}
def property_add = fn (path, property, value) {
Facts.add_tags(Config.db, path, property, value)
}
def property_remove = fn (path, property, value) {
Facts.remove_tags(Config.db, path, property, value)
}
def tag_index = fn (path) {
Facts.collect_with_tags(Config.db, path, :tag, tag = ?, fn (fact) {
tag
})
}
def tag_add = fn (path, tag) {
Facts.add_tags(Config.db, path, :tag, tag)
}
def tag_remove = fn (path, tag) {
Facts.remove_tags(Config.db, path, :tag, tag)
}
end