Maple Workbook URI Guide - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Create Maple Workbooks : worksheet/workbook/uri

Maple Workbook URI Guide

 

 

What is a Maple Workbook URI?

URI Syntax: Basics

URI Syntax: Relative vs Absolute Paths

URI Syntax: Referencing Files in Another Workbook

What is a Maple Workbook URI?

The Workbook URI (Uniform Resource Identifier) is used to represent the identity and location of files within a Maple workbook or files residing inside another workbook in a given file directory.

A URI  would look like this:

 exampleURIthis:///MyCode.mpl

 

URI Syntax: Basics

Using the URI mentioned above as an example,

 exampleURIthis:///MyCode.mpl

The substring, "this://" identifies this URI as a reference to the current open workbook.

The third slash represents the root directory of the Maple workbook.

Finally, "MyCode.mpl" represents the Maple code file located in the root directory of the current workbook.   

In general, the URI syntax is "this:///<path to file in workbook>/<filename>".

URI Syntax: Relative vs Absolute Paths

Consider the following URI:

this:///NewFolder/NewSubFolder/Sections.png

This URI contains an absolute path to the image file "Sections.png". In other words, the complete file path is explicitly stated.

Within the workbook that contains Sections.png, the URI could also have been defined as

this://Sections.png. This URI contains a relative file path. With respect to the current open workbook, the file can be located anywhere, at any level in the workbook directory.

Note: Using a relative file path only works if there are no other files called Section.png at any level in the workbook.

URI Syntax: Referencing Files in Another Workbook

While URIs of the form "this:///<path to file>/<filename>" are used to represent files within a workbook, it is also possible to reference files contained in other workbooks.

The syntax for such a URI is:

"maple://<file path to workbook>/<path within other workbook>/<filename>"

 

Creating a Workbook URI on Windows

The file separator on a Windows operating system is backslash "\". However, the backslash is also an escape character. So in order to use the backslash as a file separator, a second backslash is required.

A example of a workbook URI on Windows would be:

maple://C:\\foo\\bar.maple\\Images\\Image.png

 

Creating a Workbook URI on Linux or Mac OSX

The forwardslash "/" character is the valid file separator on Linux or Mac OSX.

An example of a workbook URI on Linux or Mac OSX would be:

maple:///foo/bar.maple/Images/Image.png