This group of functions generates a symbolic representation of a query that can then be translated to different interface languages. A query is built by specifying, for each required concept, a list of concept terms (e.g. synonyms), as well as the relationship between the concepts (normally they all have to occur; sometimes there are also a number of terms to exclude).

query_conceptTerms(..., conceptName = NULL, operator = "OR")

# S3 method for mbf_query_conceptTerms
print(x, ...)

query_full(inclusion, exclusion = NULL, queryName = "query")

# S3 method for mbf_query_full
print(x, ...)

query_requiredConcepts(..., conceptName = NULL)

# S3 method for mbf_query_requiredConcepts
print(x, ...)

query_toInterfaceLang(queryObject, fields = "title", exclude = NULL)

# S3 method for mbf_query_toInterfaceLang
print(x, headingLevel = 3, ...)

Arguments

...

For the query building functions, the concepts or terms to combine; for the print methods, the object to print.

operator

The operator to use to combining concept terms.

x

The query object to print.

inclusion

The result of a call to query_requiredConcepts.

exclusion

The result of a call to query_conceptTerms.

queryName, conceptName

The name of the query or concept.

queryObject

The query object.

fields

The fields in which to search; can currently only include 'title', 'abstract', or both.

exclude

Any terms to exclude as a character vector.

headingLevel

The level of the headings to use when printing.

Value

query_full returns an mbf_query_full object; query_requiredConcepts returns an mbf_query_requiredConcepts

object; query_conceptTerms returns an mbf_query_conceptTerms object; query_toInterfaceLang returns an mbf_query_toInterfaceLang

object; and the print methods return x invisibly.

Details

query_full combines required concepts with a concept to exclude using the NOT operator. query_requiredConcepts combines sets of concept terms for each concept using the AND operator. query_conceptTerms combines terms within one concept using the OR operator. A query can be translated to one or more interface languages with query_toInterfaceLang.

Examples

query_full(
  inclusion =
    query_requiredConcepts(
      conceptName = "inclusion",
      query_conceptTerms(
        conceptName="fluffiness",
        "fluffy",
        "hairy",
        "soft"),
      query_conceptTerms(
        conceptName="aggression",
        "aggressi*",
        "predator*",
        "kill*")),
  exclusion = 
    query_conceptTerms(
      conceptName = "exclude non-empirical work",
      "review",
      "meta-analysis"));
#>                         levelName
#> 1  query                         
#> 2   ¦--inclusion                 
#> 3   ¦   ¦--fluffiness            
#> 4   ¦   ¦   ¦--fluffy            
#> 5   ¦   ¦   ¦--hairy             
#> 6   ¦   ¦   °--soft              
#> 7   ¦   °--aggression            
#> 8   ¦       ¦--aggressi*         
#> 9   ¦       ¦--predator*         
#> 10  ¦       °--kill*             
#> 11  °--exclude non-empirical work
#> 12      ¦--review                
#> 13      °--meta-analysis