View source: R/wikibase-sparql.R
add_statement | R Documentation |
This function helps to add certain statements. A statement consists of a PID-QID combination that is added to a dataframe. The PID will be the column name, QID the row content.
It assumes there is a dataframe that has at least three columns: (1) statements
, (2) pid
, (3) qid
.
add_statement( data = NULL, available_statements = statements, new_statement = NULL, verbose = TRUE, qid_from_row = FALSE, col_for_row_content = NULL )
data |
dataframe to add the new column |
available_statements |
dataframe with all statements that can be added with this method. It assumes there is a dataframe that has at least three columns: (1) |
new_statement |
string of new statement. Must exist in |
verbose |
show in terminal what was added |
qid_from_row |
boolean; default |
col_for_row_content |
string; name of column in dataframe |
statements <- data.frame(statement = c("my_statement"), pid = c("P2"), qid = c("Q1")) data <- data.frame(item = "my item") data %>% add_statement(available_statements = statements, new_statement = "my_statement")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.