You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2023/02/19 09:40:58 UTC

[jena-site] branch script-setting updated (65a40504d -> e4e8361a9)

This is an automated email from the ASF dual-hosted git repository.

andy pushed a change to branch script-setting
in repository https://gitbox.apache.org/repos/asf/jena-site.git


 discard 65a40504d Update javascript-functions for setup documentation
    omit 475dd25dd Add basic search with Fuse.js (search engine), Mark.js (word highlighter) and Hugo (search index)
     new e4e8361a9 Update javascript-functions for setup documentation

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (65a40504d)
            \
             N -- N -- N   refs/heads/script-setting (e4e8361a9)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 config.toml                  |   3 -
 layouts/_default/baseof.html |   9 +--
 layouts/_default/index.json  |   5 --
 layouts/_default/search.html | 164 -------------------------------------------
 source/search/__index.md     |   7 --
 static/js/fuse.min.js        |   9 ---
 static/js/mark.min.js        |   7 --
 7 files changed, 1 insertion(+), 203 deletions(-)
 delete mode 100644 layouts/_default/index.json
 delete mode 100644 layouts/_default/search.html
 delete mode 100644 source/search/__index.md
 delete mode 100644 static/js/fuse.min.js
 delete mode 100644 static/js/mark.min.js


[jena-site] 01/01: Update javascript-functions for setup documentation

Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

andy pushed a commit to branch script-setting
in repository https://gitbox.apache.org/repos/asf/jena-site.git

commit e4e8361a99a56ce670f92223c9282275687c3d98
Author: Andy Seaborne <an...@apache.org>
AuthorDate: Sun Feb 19 09:28:48 2023 +0000

    Update javascript-functions for setup documentation
---
 source/documentation/query/javascript-functions.md | 27 +++++++++++++---------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/source/documentation/query/javascript-functions.md b/source/documentation/query/javascript-functions.md
index 9d079d45c..1d95a3702 100644
--- a/source/documentation/query/javascript-functions.md
+++ b/source/documentation/query/javascript-functions.md
@@ -35,21 +35,30 @@ be added to the classpath.
       <version>${ver.graalvm}/version>
     </dependency>
 ```
-    
-## Loading JavaScript functions
+
+## Enabling and Loading JavaScript functions
 
 JavaScript is loaded from an external file using the context setting
 "http://jena.apache.org/ARQ#js-library". This can be written as
 `arq:js-library` for commands and Fuseki configuration files.
 
+Access to the script engine must be enabled at runtime.
+The Java system property to do this is `jena:scripting`.
+
 Example:
 
+    export JVM_ARGS=-Djena:scripting=true
+    sparql --set arq:js-library=SomeFile.js --data ... --query ...
+
+and for MS Windows:
+
+    set JVM_ARGS=-Djena:scripting=true
     sparql --set arq:js-library=SomeFile.js --data ... --query ...
 
 will execute on the data with the JavaScript functions from file
 "SomeFile.js" available.
 
-JavScript functions can also be set from a string directly from within Java using constant
+JavaScript functions can also be set from a string directly from within Java using constant
 `ARQ.symJavaScriptFunctions` ("http://jena.apache.org/ARQ#js-functions").
 
 ## Using JavaScript functions
@@ -97,9 +106,7 @@ For example, "some words to process " becomes "someWordsToProcess".
     // Words to be combined are separated by a space in the string.
     
     function toCamelCase(str) {
-        return str.split(' ')
-    	.map(cc)
-    	.join('');
+        return str.split(' ').map(cc).join('');
     }
     
     function ucFirst(word)    {
@@ -123,11 +130,7 @@ and the query `Q.rq`
         VALUES ?input { "some woRDs to PROCESS" }
     }
 
-which can be executed with:
-
-    sparql --set arq:js-library=functions.js --query Q.rq
-
-and it results in:
+which results in:
 
     --------------------------------------------------
     | input                   | X                    |
@@ -140,6 +143,7 @@ and it results in:
 The context setting can be provided on the command line starting the
 server, for example:
 
+    export JVM_ARGS=-Djena:scripting=true
     fuseki --set arq:js-library=functions.js --mem /ds
 
 or it can be specified in the server configuration file `config.ttl`:
@@ -171,4 +175,5 @@ or it can be specified in the server configuration file `config.ttl`:
 
 and used as:
 
+    export JVM_ARGS=-Djena:scripting=true    
     fuseki --conf config.ttl