rfml (version 0.1.0)

ml.data.frame: Creates a ml.data.frame object

Description

A ml.data.frame object is an abstraction layer of data stored in a MarkLogic Server database. It is created based on the provided query, collection, directory and/or fiedlFilter parameters. For query and fieldFilter parameters see details section. It present data in MarkLogic Server in a tabular format. The ml.data.frame object enables many of the operations that can be used with a data.frame object.

Usage

ml.data.frame(conn, query = "", fieldFilter = "", ns = "NA", collection = c(), directory = c(), relevanceScores = FALSE, docUri = FALSE)

Arguments

conn
A ml.conn-class object created by ml.connect
query
The query string used to define the result, see details for more information about syntax.
fieldFilter
Field level filtering. Multiple field filters are separated by , See details for limitations.
ns
A character with the namespace URI to be used with fieldFilter, default is none
collection
A list of collection URI:s to filter on.
directory
A list of directory URI:s to filter on.
relevanceScores
TRUE/FALSE. If the result attributes score, confidence and fitness should be included. Default is FALSE
docUri
TRUE/FALSE. If the uri of the documents in the results should be included. Default is FALSE.

Value

A ml.data.frame object.

Details

The query parameter are using the string search grammar for searching for data, all of the syntax is supported except contstraints. This enables searches such as "dog AND cat" or "dog NEAR cat". The search is always done on all fields in the data, for a more precise search use the fieldFilter.

fieldFilter enables filtering on a specific field using comparison operators can be used. For the ">" "<" "!=" " <=" ">=" operators there muset exist a element range index on the source field or a error will be raised, element range index can be created using the ml.add.index function. "==" operator will always work since it does not depend of range indexes.

See Also

as.data.frame for pulling data, as.ml.data.frame for uploading data, rm.ml.data.frame for delete uploaded data

Examples

Run this code
## Not run: 
#  library(rfml)
#  localConn <- ml.connect()
#  # create a ml.data.frame based on a search
#  mlIris <- ml.data.frame(localConn, "setosa")
#  # using search and collection filtering
#  mlIris <- ml.data.frame(localConn, "setosa", collection = "iris")
#  # using field filter
#  mlIris <- ml.data.frame(localConn, fieldFilter = "Species == setosa")
# ## End(Not run)

Run the code above in your browser using DataLab