<commit_before>
\section{The \pkg{sbtools} package}
\begin{itemize}
	\item{Goal to allow programmatic access to core SB functionality}
	\item{Harmonize the SB data structures with common R interfaces}
	\item{Lightweight R package that can be quickly added to existing projects and shared broadly}
\end{itemize}


%code example
% \begin{example}
  % x <- 1:10
  % result <- myFunction(x)
% \end{example}

\subsection{Data access API}
The data access functionality of \pkg{sbtools} makes it easy to 
access any public item's data, attached files and metadata. All items
in ScienceBase have a unique identifier that can be used to directly 
access specific items. 

\begin{example}
> test_item = item_get("4f4e4b24e4b07f02db6aea14")
> test_item
<ScienceBase Item> 
  Title: Coastal-change and glaciological maps of Antarctica
  Creator/LastUpdatedBy:      / 
  Provenance (Created / Updated):  2010-10-06T04:25:43Z / 2014-07-21T17:45:42Z
  Children: FALSE
  Item ID: 4f4e4b24e4b07f02db6aea14
  Parent ID: 4f4e4771e4b07f02db47e1e4
\end{example}

For convenience, \pkg{sbtools} defines an \code{sbitem} object, which is 
returned by \pkg{sbtools} functions when referencing objects. The underlying
data structure is a list. All available metadata for an item can be listed
and accessed in the same way as a named list.

\begin{example}
names(test_item) 
item_get(test_item)$citation

\end{example}

On ScienceBase, all items are organized in a tree structure, with one 
parent and potentially many children. \pkg{sbtools} allows the user to 
easily traverse the tree structure. In some projects, the hierarchy has 
important meaning. For others, it relates only to the owner user or
organization.

\begin{example}
#parent ID always available as item attribute
parent = item_get(test_item$parentId)
parent

#getting sibling items
item_list_children(parent)
\end{example}

ScienceBase has special support for certain datatypes. 


\begin{itemize}<commit_msg>trying to add more output<commit_after>
\section{The \pkg{sbtools} package}
\begin{itemize}
	\item{Goal to allow programmatic access to core SB functionality}
	\item{Harmonize the SB data structures with common R interfaces}
	\item{Lightweight R package that can be quickly added to existing projects and shared broadly}
\end{itemize}


%code example
% \begin{example}
  % x <- 1:10
  % result <- myFunction(x)
% \end{example}

\subsection{Data access API}
The data access functionality of \pkg{sbtools} makes it easy to 
access any public item's data, attached files and metadata. All items
in ScienceBase have a unique identifier that can be used to directly 
access specific items. 

\begin{example}
> test_item = item_get("4f4e4b24e4b07f02db6aea14")
> test_item
<ScienceBase Item> 
  Title: Coastal-change and glaciological maps of Antarctica
  Creator/LastUpdatedBy:      / 
  Provenance (Created / Updated):  2010-10-06T04:25:43Z / 2014-07-21T17:45:42Z
  Children: FALSE
  Item ID: 4f4e4b24e4b07f02db6aea14
  Parent ID: 4f4e4771e4b07f02db47e1e4
\end{example}

For convenience, \pkg{sbtools} defines an \code{sbitem} object, which is 
returned by \pkg{sbtools} functions when referencing objects. The underlying
data structure is a list. All available metadata for an item can be listed
and accessed in the same way as a named list.

\begin{example}
> names(test_item) 
 [1] "link"              "relatedItems"      "id"               
 [4] "identifiers"       "title"             "citation"         
 [7] "provenance"        "hasChildren"       "parentId"         
[10] "contacts"          "webLinks"          "browseCategories" 
[13] "browseTypes"       "tags"              "dates"            
[16] "facets"            "files"             "distributionLinks"
[19] "previewImage"     
> item_get(test_item)$citation
[1] "Geological Survey (U.S.), 1999-08-05, Coastal-change 
and glaciological maps of Antarctica:  Fact SheetCoastal-change and 
glaciological maps of Antarctica."

\end{example}

On ScienceBase, all items are organized in a tree structure, with one 
parent and potentially many children. \pkg{sbtools} allows the user to 
easily traverse the tree structure. In some projects, the hierarchy has 
important meaning. For others, it relates only to the owner user or
organization.

\begin{example}
#parent ID always available as item attribute
parent = item_get(test_item$parentId)
parent

#getting sibling items
item_list_children(parent)
\end{example}

ScienceBase has special support for certain datatypes. 


\begin{itemize}
{'fraction_non_alphanumeric': 0.07873665480427046, 'fraction_numerical': 0.036476868327402136, 'mean_word_length': 4.052808988764045, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3608232', 'n_tokens_mistral': 1515, 'n_tokens_neox': 1377, 'n_words': 505}