public final class Utility extends Object
Constructor and Description |
---|
Utility() |
Modifier and Type | Method and Description |
---|---|
static boolean |
areEquals(List<Record> expResult,
List<Record> result)
the 2 input Lists must be sorted.
|
static boolean |
areEquals(Record exp,
Record res)
checks if the 2 Records contains the same Properties : Values.
|
static org.elasticsearch.index.query.FilterBuilder |
buildRangeFilter(String elKey,
Range item,
MappingHandler mapper,
URIHandler handler)
Tries to build a Filter: the specified property (elKey) must match the Range item.
|
static org.elasticsearch.index.query.FilterBuilder |
buildTermFilter(String elKey,
Object item,
MappingHandler mapper,
URIHandler handler) |
static Record |
deserialize(org.elasticsearch.action.get.GetResponse response,
MappingHandler mapper,
URIHandler handler)
Transforms the GetResponse object into a Record.
|
static Record |
deserialize(org.elasticsearch.search.SearchHit response,
MappingHandler mapper,
URIHandler handler)
Transforms the SearchHit object into a Record.
|
protected static String |
literalToString(org.openrdf.model.Literal obj)
transforms a Literal in a String
|
static org.elasticsearch.common.xcontent.XContentBuilder |
serialize(Record record,
URIHandler handler) |
protected static org.openrdf.model.Literal |
stringToLiteral(String s)
transforms the given String in a Value.
|
public static boolean areEquals(Record exp, Record res)
exp
- res
- public static boolean areEquals(List<Record> expResult, List<Record> result)
expResult
- result
- public static org.elasticsearch.index.query.FilterBuilder buildTermFilter(String elKey, Object item, MappingHandler mapper, URIHandler handler) throws IOException
elKey
- string that rapresents the property name (string of the URI)item
- value that the record must have in the field of the elKeymapper
- mapping of the properties in ES. can not make filters on byteArray.IOException
public static org.elasticsearch.index.query.FilterBuilder buildRangeFilter(String elKey, Range item, MappingHandler mapper, URIHandler handler) throws IOException
elKey
- property name.item
- Range object.mapper
- IOException
public static org.elasticsearch.common.xcontent.XContentBuilder serialize(Record record, URIHandler handler) throws IOException
record
- record to serialize in the XContentBuilderhandler
- IOException
public static Record deserialize(org.elasticsearch.action.get.GetResponse response, MappingHandler mapper, URIHandler handler) throws IOException
response
- GetResponse object that contains a document of the query's result.mapper
- mapping of the types.IOException
public static Record deserialize(org.elasticsearch.search.SearchHit response, MappingHandler mapper, URIHandler handler) throws IOException
response
- SearchHit object that contains a document of the query's result.mapper
- IOException
protected static String literalToString(org.openrdf.model.Literal obj)
obj
- object to transform in Stringprotected static org.openrdf.model.Literal stringToLiteral(String s) throws IOException
s
- String to transform in a ValueIOException
Copyright © 2015–2016 FBK-irst. All rights reserved.