To link texts to separate resources (external or internal), it is required to store arbitrary data in meta data fields including arbitrary descriptions in a conventional way, to give clients retrieving the data some hints about how to handle the data.
To make it easy and to introduce some advanced formalisms of KoralQuery, I would argue the field should be indexed and returned as a koral:field with type:attachement, as exemplified in Krawfish.
The key can be an arbitrary name field, like "Wikipedia-Link", the value needs to follow the data uri scheme.
{
"@type":"koral:field",
"key":"Wikipedia",
"value":"data:application/x.korap-link,https://de.wikipedia.org/wiki/Beispiel",
"type":"type:attachement"
},
{
"@type":"koral:field",
"key":"Reference",
"value":"data:text/plain,This is a reference string",
"type":"type:attachement"
}
This makes it possible to store arbitrary data like text or images (base64 encoded) as well as references in the value. It may seem unintuitive to use the data uri scheme for hyperlinks, as they already are scheme prefixed. The reason we use data for all attachements and the new application/x.korap-link media type is that data uris support parameters, that can be used to describe the resource and give the KoralQuery consumer a hint how to handle the resource. E.g. for links that will be embedded in Kalamar, the parameter can give a link title to view instead of the URI. Or if Kalamar has a plugin to embed images, a parameter can give hints about title tags of the image.
data:image/png;title=Palimpsest;base64,...
To link texts to separate resources (external or internal), it is required to store arbitrary data in meta data fields including arbitrary descriptions in a conventional way, to give clients retrieving the data some hints about how to handle the data. To make it easy and to introduce some advanced formalisms of KoralQuery, I would argue the field should be indexed and returned as a
koral:field
withtype:attachement
, as exemplified in Krawfish. The key can be an arbitrary name field, like "Wikipedia-Link", the value needs to follow the data uri scheme.This makes it possible to store arbitrary data like text or images (base64 encoded) as well as references in the value. It may seem unintuitive to use the data uri scheme for hyperlinks, as they already are scheme prefixed. The reason we use data for all attachements and the new
application/x.korap-link
media type is that data uris support parameters, that can be used to describe the resource and give the KoralQuery consumer a hint how to handle the resource. E.g. for links that will be embedded in Kalamar, the parameter can give a link title to view instead of the URI. Or if Kalamar has a plugin to embed images, a parameter can give hints about title tags of the image.data:image/png;title=Palimpsest;base64,...