|
|
lnk:create(
|
|
$from as xs:string,
|
|
$to as xs:string,
|
|
$role as xs:string,
|
|
$rev-role as xs:string,
|
|
$strength as xs:string
|
| ) as empty-sequence() |
|
 |
Summary:
Create a link between the two given documents with the given role labels
and strength. An error is raised if either of the documents involved does
not exist or if the link would be invalid for some reason. This function
will replace any existing link between those two documents with the new link.
|
Parameters:
$from
:
The URI of the document at the tail of the link.
|
$to
:
The URI of the document at the head of the link.
|
$role
:
A label for the relationship of the head of the link to the tail of the
link, one of "source", "consumer", "container",
"variant", and "related".
|
$rev-role
:
A label for the reverse relationship of the tail of the link to the head of
the link.
|
$strength
:
An indicator of the strength of the relationship between the two documents,
either "strong" or "weak".
|
|
Example:
xquery version "0.9-ml"
import module namespace lnk = "http://marklogic.com/cpf/links"
at "/MarkLogic/cpf/links.xqy"
lnk:create( "/myDocs/example.xhtml", "/myDocs/example.doc",
"source", "conversion", "strong" )
|
|
|