Main Entry Points

These global objects serve as main entry point into the API. See https://archive.topquadrant.com/doc/latest/scripting/index.html for background and more details on ADS.

Main Entry Points
Static Members
graph
dataset

Graph Nodes API

These classes are instantiated by the graph API to represent RDF nodes. The root class GraphNode has the two subclasses NamedNode (for URIs and blank nodes) and LiteralNode (for literal values such as xsd:date nodes). Note that the most common literal types (xsd:string, xsd:boolean and numeric types) are typically represented by simple JavaScript values (strings, booleans and numbers).

Graph Nodes API
Static Members
new GraphNode(obj)
new LiteralNode()
new NamedNode(obj)
Triple
new GraphNodeArray()

System-level API

System-level API
Static Members
new GraphType(uri)

Utilities

Utilities
Static Members
GraphNodeUtil
new ResultSet(object)
sparql(strings, values)

Uploaded Files and I/O API

Uploaded Files and I/O API
Static Members
IO
new UploadedFile(fileId)
new UploadedSpreadsheet(__spreadsheet)
new SpreadsheetIterator(__iterator)
new XMLNode(zzzNode)
SQL
HttpResponse

Advanced

These are part of the API that you may rarely need directly.

Advanced
Static Members
DataViewers
new GraphChanges()
GraphViewerProps
JSONTableViewerProps
NextPageProps
ValidationResult
WizardParameterDefinition

LiteralNodeInput

An input object used to create a new RDF literal.

LiteralNodeInput

Type: Object

Properties
lex (string) : the lexical form of the literal
datatype ((string | NamedNode)?) : the datatype, defaulting to xsd.string
lang (string?) : the language tag for rdf:langString literals

TripleTermNode

The class of graph nodes that are representing RDF 1.2 triple terms.

new TripleTermNode()

Extends GraphNode

Instance Members
triple

The base type for the properties of all NamedNodes, declaring the uri property.

Properties
uri (!string) : the URI serving as unique identifier of the resource in the graph

GraphNodeMap

A Map with GraphNode instances as keys, using .equals() semantics. Note that plain JS objects (boolean, number, string) can be added but will be converted to LiteralNodes internally.

new GraphNodeMap(entries: any)
Parameters
entries (any)
Instance Members
size
clear()
delete(node)
entries()
forEach(callback, thisArg?)
get(node)
has(node)
keys()
set(node, value)
values()

GraphNodeSet

A Set of GraphNode instances, using .equals() semantics. Note that plain JS objects (boolean, number, string) can be added but will be converted to LiteralNodes internally.

new GraphNodeSet(nodes: any)
Parameters
nodes (any)
Instance Members
size
add(node)
clear()
delete(node)
forEach(callback, thisArg?)
has(node)

GitIntegrationProps

GitIntegrationProps

Type: Object

Properties
excludedURIs (Array<string>) : An array of URI resources for which any triple that mentions them shall be excluded from the mapping (e.g. the DataIntegration instance itself).

GitIntegration

GitIntegration

Type: Object

Properties
addFile (function (string, string, String)) : For a given repository URL, file path and content string, create a new file with the given content and add it under Git control.
checkout (function (string, string)) : For a given repository URL and branch, checkout the branch on the repository.
clone (function (string)) : For a given repository URL, perform a clone operation into a local copy. Cloning will be implicitly performed if necessary by any other operation that requires a local copy.
commit (function (string, string)) : For a given repository URL and message, perform a commit to the local clone of the repository.
currentUserHasAccess (function (string)) : Return true if the current user has access to a given repository URL.
deleteFile (function (string, string)) : For a given repository URL and file path delete the file and remove it from Git control.
getBranch (function (string): string) : For a given repository URL return the currently active branch.
getFileContent (function (string, string): string) : For a given repository URL and file path, return the content of the file.
getFiles (function (string, string): Array<string>) : For a given repository URL and directory path, return the contained file and directory names. Directories start with a slash ('/').
getLinkToFile (function (string, string): string) : For a given repository URL and file path, return a URL for a web view of the file. Currently only supported for GitHub repositories, returns null otherwise.
getRepositories (function (): Array<string>) : Gets the list of URLs of all configured git repositories that the current user can access.
isCloned (function (string)) : For a given repository URL, return true if the repo has been cloned to a local copy.
pull (function (string)) : For a given repository URL, perform a pull operation.
push (function (string)) : For a given repository URL, perform a push.
readBaseURI (function (string, string): string) : For a given repository URL and file path try to read the base URI from the # baseURI comment.
readCollectionId (function (string, string): string) : For a given repository URL and file path try to read the collection id (e.g. 'geo') from the # collectionId comment.
readCollectionType (function (string, string): string) : For a given repository URL and file path try to read the collection type label (e.g. 'Taxonomy') from the # collectionType comment.
readGraph (function (string, string, string, GitIntegrationProps): number) : For a given repository URL, file path and graph URI, import the graph from the TTL file and update the currently active graph. The props object is used for example to avoid changing certain excluded resources. Typically called from transactions. Returns the number of changed triples.
removeClone (function (string)) : For a given repository URL, delete the locally cloned copy.
reset (function (string, string)) : For a given repository URL and ref, reset the repository to the given ref.
updateProject (function (string, string)) : For a given repository URL and folder path, replace the namesake project in the TopBraid workspace. Available to admins only.
writeGraph (function (string, string, string, GitIntegrationProps): boolean) : For a given repository URL, file path and graph URI, export the graph as sorted TTL file, adding it when necessary. The props object is used to pre-process the graph before it is written, for example to hide certain resources that are deemed internal. Returns true if file was different at all, false if no-op.

CellRange

CellRange

Type: Object

Properties
getColumnCount (function (): number) : Gets the number of columns in the range.
getRowCount (function (): number) : Gets the number of rows in the range.
getValue (function (number, [number]): any) : Gets the value (boolean, number or string) in a given cell with column index and optional row index.
toObject (function (): object) : Returns a JS object with A1 keys and the values as booleans, numbers or strings.

CellStyle

CellStyle

Type: Object

Properties
bold (boolean) : True to make the font style bold.
fontSize (number) : The font size, e.g. 10.
horizontalAlignment (string) : Either "left", "center", "right" or "justify".
verticalAlignment (string) : Either "bottom", "middle" or "top".
wrapStrategy (string) : Either "wrap", "overflow" or "clip".

ColumnStyle

ColumnStyle

Type: Object

Properties
datatype (string) : The URI of a datatype such as xsd.boolean.uri. Currently not supported for Excel.
enumRange (string) : A cell range for the enumerated values. Currently not supported for Excel.
enumValues (Array<any>) : An enumeration of permitted values (usually strings). Currently not supported for Excel.
width (number) : The width in pixel.

Worksheet

Worksheet

Type: Object

Properties
addProtectedRange (function (string): string) : Marks the cells in the given range (in A1 notation) as protected, i.e. not editable by end users. Does not support unlimited ranges. Returns an ID that can be used as input to removeProtectedRange later. NOTE: For Excel this will not have effects unless the worksheet is also protected.
delete (function ()) : Deletes the worksheet from the workbook.
getCellRange (function (string): CellRange) : Gets the cell values in a given range, using A1 notation such as "A1:C4".
getCellValue (function (string): any) : Gets the cell value (boolean, number or string) in a given cell, using A1 notation such as "B3".
getColumnCount (function (): number) : Gets the maximum index of columns that may have values in the grid (base is 1).
getRowCount (function (): number) : Gets the maximum index of rows that may have values in the grid (base is 1).
getSheetIndex (function (): number) : Gets the index of this Worksheet within the Workbook, starting at zero.
getTitle (function (): string) : Gets the title of this Worksheet.
getWorkbook (function (): Workbook) : Gets the Workbook that this is part of.
removeProtectedRange (function (string)) : Reverse operation of addProtectedRange, using the result of that function as argument (NOT a cell range!). NOTE: For Excel this will not have effects unless the worksheet is also protected.
setCellStyle (function (string, CellStyle)) : Sets the style of a range of cells (in A1 notation).
setColumns (function (Array<ColumnStyle>)) : Adjusts all columns (ordered by their column index) using provided heuristics.
setSheetIndex (function (number)) : Sets the index of this Worksheet within the Workbook, starting at zero.
setTitle (function (string)) : Sets the title of this WorkSheet.
toA1 (function (number, [number]): string) : Converts a column index and optional row index to a string in A1 notation, e.g. (0,1) becomes "A2".
toNativeDate (function (string): any) : Converts an xsd:date lexical form to the native format expected by the worksheet.
toXSDDateLex (function (any): string) : Converts a native date as returned by the worksheet to the lexical form of an xsd:date literal.
update (function (object)) : Updates cell values using an input mapping from cell names to boolean, number and strings, e.g. { 'A1': 'Value1', 'A1': 42, 'A1': null }.
updateNotes (function (object)) : Updates notes and potentially the background color of certain cells, for example to display SHACL violations. The argument is an object with a mapping from cell ranges to their notes, e.g. { 'A1': 'Missing value', 'B1:E1': null }. Ranges will be executed before individual cells and null will delete any note. Notes starting with 'Violation:', 'Warning:' or 'Info:' get different background color. NOTE: For Excel stored on SharePoint this operation can only set the background color since the Microsoft API does not offer programmatic access to notes.

Workbook

Workbook

Type: Object

Properties
createSheet (function (string, [number], [number]): Worksheet) : Creates a new WorkSheet with a given title and (optional) column count and row count (which are only supported by Google Sheets).
delete (function ()) : Deletes the workbook. Obviously, use with care!
getId (function (): string) : Gets the id that can later be used to access the workbook using getWorkbook.
getLocale (function (): string) : Gets the language code of the workbook, e.g. to convert dates correctly.
getSheetByIndex (function (number): Worksheet) : Gets a sheet with a given index, which must be < sheetCount.
getSheetByTitle (function (string): Worksheet) : Gets a sheet with a given title, or null.
getSheetCount (function (): number) : Gets the number of sheets in this workbook.
getTitle (function (): string) : Gets the title of this Workbook.
getURL (function (): string) : Gets the URL under which this workbook can be opened by users.

Workbooks

Workbooks

Type: Object

Properties
createExcelWorkbook (function (string, string): Workbook) : Creates a new Microsoft365 Excel Workbook with a given title and within a SharePoint drive with a given id.
createGoogleWorkbook (function (string, string, string): Workbook) : Creates a new Google Workbook with a given title, a given Google Workspace name (which must be configured in the Product Configuration) and an email address of the initial owner of this spreadsheet.
createMemoryWorkbook (function (): Workbook) : Creates a new in-memory Workbook that can be used within the current ADS session, e.g. for testing purposes.
getWorkbook (function (string): Workbook) : Gets a Workbook with a given id as returned by Workbook.getId(). For Excel, the ids have the format "Excel:{microsoftDriveId}:{excelFileId}". For Google sheets, the format is "GoogleSheets:{Project Label}:{Document Id}". For uploaded files (in-memory workbooks), the format is "UploadedFile:{uploadedFileId}".

SendEmailParams

SendEmailParams

Type: Object

Properties
subject (string) : The subject line
body (string) : The body text of the email, may contain HTML.
to (string?) : The receiver(s) of the email, supports RFC822 format.
cc (string?) : The ccs of the email, supports RFC822 format.
bcc (string?) : The receiver(s) of the email, supports RFC822 format.
from (string?) : The email of the sender, defaults to the globally configured email.
fromUserName (string?) : The display name of the sender.
attachments (Array<SendEmailAttachment>?) : The attachments.

SendEmailAttachment

SendEmailAttachment

Type: Object

Properties
text (string) : The text content of the attachment (binary attachments are not supported at this stage).
contentType (string?) : The mime type, defaulting to 'text/plain'. Should include the charset if text should not use the Java default char set,
fileName (string?) : The (optional) file name.

HttpRequestPart

HttpRequestPart

Type: Object

Properties
contentType (string?) : The content type, derived from uploaded file if not provided.
uploadedFile (string?) : The id of an uploaded file that shall be sent.
text (string?) : The text body for string parts (only used if uploadedFile is not provided).

Neo4jConnection

A connection to a neo4j instance, as retrieved using IO.neo4j(localName)

new Neo4jConnection(neo4j: any)
Parameters
neo4j (any)
Instance Members
query(queryString, params)
transaction(callback)
update(queryString, params)

Threads

Provides access to ADS-based threads.

Threads
Static Members
start(sourceCode)
startFunction(func, args)