SemanticSearchImplementation
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
SemanticSearchImplementation.ElasticsearchIndexMapper Class Reference

Contains methods to create, change and handle the current Elasticsearch index. More...

Public Member Functions

 ElasticsearchIndexMapper (RdfClient RDFClient, IDictionary< string, string > mapping=null)
 
void ReplaceMapping (IDictionary< string, string > mapping)
 Replaces the current mapping. More...
 
JObject CreateIndex (string alias=null)
 Creates the JSON object which contains all information (settings, mappings and aliases) for a new index. More...
 
string GetLabelOfProperty (string property)
 
string GetTypeOfProperty (string property)
 
string GetSearchType (ApplicationProfileType type)
 Maps application profile type to corresponding Elasticsearch type. More...
 

Static Public Attributes

const string TEXT = "text"
 
const string KEYWORD = "keyword"
 
const string BOOLEAN = "boolean"
 
const string INTEGER = "integer"
 
const string DATE = "date"
 
const string YEAR_EXTENSION = "_year"
 
const string MONTH_EXTENSION = "_month"
 
const string DAY_EXTENSION = "_day"
 
const string BOOLEAN_EXTENSION = "_written"
 
const string LABEL_APPLICATION_PROFILE = "applicationProfile"
 
const string LABEL_BELONGS_TO_PROJECT = "belongsToProject"
 
const string LABEL_GRAPHNAME = "graphName"
 
const string LABEL_IS_PUBLIC = "isPublic"
 
const string DEFAULT_ALIAS_NAME = "final_index"
 

Private Member Functions

IDictionary< string, string > CreateLabelOfProps (IEnumerable< string > properties)
 Creates the labels (field names) for all properties. More...
 
string CreateLabelOfProperty (string property)
 Creates the label of a property. More...
 
IDictionary< string, string > CreateTypeOfProps (IEnumerable< string > properties)
 Creates the type for all properties. More...
 

Private Attributes

readonly RdfClient _RDFClient
 
readonly IEnumerable< string > _properties
 
readonly IDictionary< string, string > _labelOfProperties
 
readonly IDictionary< string, string > _generalAdditionalTripleLabels
 
IDictionary< string, string > _typeOfProperties
 

Detailed Description

Contains methods to create, change and handle the current Elasticsearch index.

Constructor & Destructor Documentation

◆ ElasticsearchIndexMapper()

SemanticSearchImplementation.ElasticsearchIndexMapper.ElasticsearchIndexMapper ( RdfClient  RDFClient,
IDictionary< string, string >  mapping = null 
)
inline

Member Function Documentation

◆ CreateIndex()

JObject SemanticSearchImplementation.ElasticsearchIndexMapper.CreateIndex ( string  alias = null)
inline

Creates the JSON object which contains all information (settings, mappings and aliases) for a new index.

Parameters
aliasThe name of the alias if it should be set directly at the beginning (only in case of initial indexing).
Returns
A JSON object for the request to create a new index.

◆ CreateLabelOfProperty()

string SemanticSearchImplementation.ElasticsearchIndexMapper.CreateLabelOfProperty ( string  property)
inlineprivate

Creates the label of a property.

Parameters
propertyThe property as URI.
Returns
The created label.

◆ CreateLabelOfProps()

IDictionary<string, string> SemanticSearchImplementation.ElasticsearchIndexMapper.CreateLabelOfProps ( IEnumerable< string >  properties)
inlineprivate

Creates the labels (field names) for all properties.

Parameters
propertiesAn enumerator containing all properties (metadata fields) as URIs.
Returns
A dictionary containing properties (key) and corresponding labels (value).

◆ CreateTypeOfProps()

IDictionary<string, string> SemanticSearchImplementation.ElasticsearchIndexMapper.CreateTypeOfProps ( IEnumerable< string >  properties)
inlineprivate

Creates the type for all properties.

Parameters
propertiesAn enumerator containing all properties (metadata fields) as URIs.
Returns
A dictionary containing properties (key) and corresponding type (value).

◆ GetLabelOfProperty()

string SemanticSearchImplementation.ElasticsearchIndexMapper.GetLabelOfProperty ( string  property)
inline

◆ GetSearchType()

string SemanticSearchImplementation.ElasticsearchIndexMapper.GetSearchType ( ApplicationProfileType  type)
inline

Maps application profile type to corresponding Elasticsearch type.

Parameters
typeThe application profile type.
Returns
An Elasticsearch type.

◆ GetTypeOfProperty()

string SemanticSearchImplementation.ElasticsearchIndexMapper.GetTypeOfProperty ( string  property)
inline

◆ ReplaceMapping()

void SemanticSearchImplementation.ElasticsearchIndexMapper.ReplaceMapping ( IDictionary< string, string >  mapping)
inline

Replaces the current mapping.

At first the mappig contains the uniformly generated data types based on the application profiles, later the types of Elasticsearch.

Parameters
mapping

Member Data Documentation

◆ _generalAdditionalTripleLabels

readonly IDictionary<string, string> SemanticSearchImplementation.ElasticsearchIndexMapper._generalAdditionalTripleLabels
private
Initial value:
= new Dictionary<string, string>()
{
{ Uris.COSCINE_SEARCH_APPLICATION_PROFILE, LABEL_APPLICATION_PROFILE },
{ Uris.COSCINE_SEARCH_BELONGS_TO_PROJECT, LABEL_BELONGS_TO_PROJECT },
{ Uris.COSCINE_SEARCH_GRAPHNAME, LABEL_GRAPHNAME },
{ Uris.COSCINE_PROJECTSTRUCTURE_IS_PUBLIC_LONG, LABEL_IS_PUBLIC }
}

◆ _labelOfProperties

readonly IDictionary<string, string> SemanticSearchImplementation.ElasticsearchIndexMapper._labelOfProperties
private

◆ _properties

readonly IEnumerable<string> SemanticSearchImplementation.ElasticsearchIndexMapper._properties
private

◆ _RDFClient

readonly RdfClient SemanticSearchImplementation.ElasticsearchIndexMapper._RDFClient
private

◆ _typeOfProperties

IDictionary<string, string> SemanticSearchImplementation.ElasticsearchIndexMapper._typeOfProperties
private

◆ BOOLEAN

const string SemanticSearchImplementation.ElasticsearchIndexMapper.BOOLEAN = "boolean"
static

◆ BOOLEAN_EXTENSION

const string SemanticSearchImplementation.ElasticsearchIndexMapper.BOOLEAN_EXTENSION = "_written"
static

◆ DATE

const string SemanticSearchImplementation.ElasticsearchIndexMapper.DATE = "date"
static

◆ DAY_EXTENSION

const string SemanticSearchImplementation.ElasticsearchIndexMapper.DAY_EXTENSION = "_day"
static

◆ DEFAULT_ALIAS_NAME

const string SemanticSearchImplementation.ElasticsearchIndexMapper.DEFAULT_ALIAS_NAME = "final_index"
static

◆ INTEGER

const string SemanticSearchImplementation.ElasticsearchIndexMapper.INTEGER = "integer"
static

◆ KEYWORD

const string SemanticSearchImplementation.ElasticsearchIndexMapper.KEYWORD = "keyword"
static

◆ LABEL_APPLICATION_PROFILE

const string SemanticSearchImplementation.ElasticsearchIndexMapper.LABEL_APPLICATION_PROFILE = "applicationProfile"
static

◆ LABEL_BELONGS_TO_PROJECT

const string SemanticSearchImplementation.ElasticsearchIndexMapper.LABEL_BELONGS_TO_PROJECT = "belongsToProject"
static

◆ LABEL_GRAPHNAME

const string SemanticSearchImplementation.ElasticsearchIndexMapper.LABEL_GRAPHNAME = "graphName"
static

◆ LABEL_IS_PUBLIC

const string SemanticSearchImplementation.ElasticsearchIndexMapper.LABEL_IS_PUBLIC = "isPublic"
static

◆ MONTH_EXTENSION

const string SemanticSearchImplementation.ElasticsearchIndexMapper.MONTH_EXTENSION = "_month"
static

◆ TEXT

const string SemanticSearchImplementation.ElasticsearchIndexMapper.TEXT = "text"
static

◆ YEAR_EXTENSION

const string SemanticSearchImplementation.ElasticsearchIndexMapper.YEAR_EXTENSION = "_year"
static

The documentation for this class was generated from the following file:
SemanticSearchImplementation.ElasticsearchIndexMapper.LABEL_APPLICATION_PROFILE
const string LABEL_APPLICATION_PROFILE
Definition: ElasticsearchIndexMapper.cs:28
SemanticSearchImplementation.ElasticsearchIndexMapper.LABEL_IS_PUBLIC
const string LABEL_IS_PUBLIC
Definition: ElasticsearchIndexMapper.cs:31
SemanticSearchImplementation.ElasticsearchIndexMapper.LABEL_BELONGS_TO_PROJECT
const string LABEL_BELONGS_TO_PROJECT
Definition: ElasticsearchIndexMapper.cs:29
SemanticSearchImplementation.ElasticsearchIndexMapper.LABEL_GRAPHNAME
const string LABEL_GRAPHNAME
Definition: ElasticsearchIndexMapper.cs:30