Package org.eclipse.rdf4j.sail.lucene
Class SearchFields
java.lang.Object
org.eclipse.rdf4j.sail.lucene.SearchFields
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
String used to prefix BNode IDs with so that we can distinguish BNode fields from URI fields in Documents.static final String
The name of the Document field holding the context identifer(s).static final String
the null contextstatic final Pattern
static final String
static final String
static final String
The name of the Document field holding the document identifier.static final String
The name of the Document field that holds multiple text values of a Resource.static final String
The name of the Document field holding the Resource identifier. -
Method Summary
Modifier and TypeMethodDescriptionstatic Resource
createContext
(String idString) static Resource
createResource
(String idString) Parses an id-string (a serialized resource) back to a resource Inverse method ofgetResourceID(Resource)
static Literal
distanceToLiteral
(double d) static String
formIdString
(String resourceId, String contextId) static String
getContextID
(Resource resource) Get the ID for a context.static String
getLiteralPropertyValueAsString
(Statement statement) static String
getPropertyField
(IRI property) static String
getResourceID
(Resource resource) Returns the String ID corresponding with the specified Resource.static String
getSnippet
(String highlightedValue) static boolean
isPropertyField
(String fieldName) Determines whether the specified field name is a property field name.static Literal
scoreToLiteral
(float score) Returns a score value encoded as a Literal.static Literal
wktToLiteral
(String wkt)
-
Field Details
-
ID_FIELD_NAME
The name of the Document field holding the document identifier. This consists of the Resource identifier (URI or BNodeID) and the Context ID (the format is "resourceId|contextId")- See Also:
-
URI_FIELD_NAME
The name of the Document field holding the Resource identifier. The value stored in this field is either a URI or a BNode ID.- See Also:
-
TEXT_FIELD_NAME
The name of the Document field that holds multiple text values of a Resource. The field is called "text", as it contains all text, but was called "ALL" during the discussion. For each statement-literal of the resource, the object literal is stored in a field using the predicate-literal and additionally in a TEXT_FIELD_NAME-literal field.- See Also:
-
CONTEXT_FIELD_NAME
The name of the Document field holding the context identifer(s).- See Also:
-
CONTEXT_NULL
the null context- See Also:
-
BNODE_ID_PREFIX
String used to prefix BNode IDs with so that we can distinguish BNode fields from URI fields in Documents. The prefix is chosen so that it is invalid as a (part of a) URI scheme.- See Also:
-
HIGHLIGHTER_PRE_TAG
- See Also:
-
HIGHLIGHTER_POST_TAG
- See Also:
-
HIGHLIGHTER_PATTERN
-
-
Method Details
-
getResourceID
Returns the String ID corresponding with the specified Resource. The id string is either the URI or a bnode prefixed with a "!". -
getContextID
Get the ID for a context. Context can be null, then the "null" string is returned- Parameters:
resource
- the context- Returns:
- a string
-
createResource
Parses an id-string (a serialized resource) back to a resource Inverse method ofgetResourceID(Resource)
- Parameters:
idString
-- Returns:
- resource
-
createContext
-
getLiteralPropertyValueAsString
-
getPropertyField
-
isPropertyField
Determines whether the specified field name is a property field name. -
formIdString
-
scoreToLiteral
Returns a score value encoded as a Literal.- Parameters:
score
- the float score to convert- Returns:
- the score as a literal
-
wktToLiteral
-
distanceToLiteral
-
getSnippet
-