Focal Point
[SHARING] WebFOCUS – Scripting Language Integration

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7877062886

November 08, 2017, 10:14 AM
Kathleen Butler
[SHARING] WebFOCUS – Scripting Language Integration
Hi Focal Pointers!

Information Builders is adding scripting language support to WebFOCUS and we want to hear from you. Do you use or plan to use Python, R, JavaScript, or any other open source scripting language in your business intelligence applications?

Please take a few minutes to complete our brief survey. We appreciate your feedback!

Scripting languages are a gateway to artificial intelligence, data science, statistics, and other knowledge domains for business intelligence. Perfect for prototyping and rapid development, numerous open source scripting languages are featured in the TIOBE Index.


Sincerely,
Kathleen Butler
Senior Customer Care and Communications Manager
Information Builders

This message has been edited. Last edited by: FP Mod Chuck,
November 08, 2017, 02:16 PM
Frans
This is a great initiative!


Test: WF 8.2
Prod: WF 8.2
DB: Progress, REST, IBM UniVerse/UniData, SQLServer, MySQL, PostgreSQL, Oracle, Greenplum, Athena.
November 08, 2017, 03:55 PM
Waz
Ditto to that


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

November 09, 2017, 07:08 PM
Michael L Meagher
This may be the final piece needed to get campus-wide adoption of WebFOCUS. Right now the science side is python and R centric while the finance side is WebFOCUS and PeopleSoft centric. If we can embed python or R into our WebFOCUS reports it would be magic!


WebFOCUS 8.2.03 - Production
WebFOCUS 8.2.04 - Sand Box
Windows 2012 R2 Server
HTML, PDF, Excel
In FOCUS since 1980
November 10, 2017, 02:10 AM
Dave
just a stupid question...

How?

a hold file a made with Webfocus request and on the hold file scripting can be "unleashed" and the results end up in a new hold file?

something like that?


_____________________
WF: 8.0.0.9 > going 8.2.0.5
November 10, 2017, 03:13 PM
Ira Kaplan
Hi Dave,

There are numerous ways a scripting language can access a hold file and then make the results available in a new hold file. This is why Kathleen Butler and I have posted the survey, so Information Builders can speak with our customers and partners and learn how they would like WebFOCUS to integrate with scripting languages.

There are a few methods we are evaluating. Here is one:
When a WebFOCUS call is made to, say, Python or R, the following information is explicitly included in the call:
- the name of the script file residing in the app folder
- the name of the input app folder and the hold file
- the name of the output app folder and the hold file

The app name/folder name is automatically converted to a physical file path on the Reporting Server. The script reads the file and then writes the results to the physical hold file.
After the output hold file has been written to and closed then an internal CREATE SYNONYM command is executed. The file is now available to the WebFOCUS user.

Another way to access WebFOCUS data does not require a HOLD file at all. I wrote a Python wrapper for the WebFOCUS REST service and execute a report or an ad hoc fex which returns the data in the format I choose to use in Python, e.g., CSV, JSON, or XML. I will be demonstrating this at Summit 2018, How to Build a WebFOCUS for Amazon Alexa app.

Regards,
Ira
November 13, 2017, 05:00 PM
David Briars
Thanks for the Q & A, Dave and Ira.

This sounds like a worthwhile IB initiative, and I've responded to Kathleen's survey accordingly.

Thanks again all.
November 17, 2017, 03:13 PM
CoolGuy
YES! DO THIS!! haha All for it! Would be a very good thing! Taking survey next.


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
December 12, 2017, 09:51 PM
Kathleen Butler
Thanks Everyone! Just a reminder that the survey is still open and we appreciate your feedback.

Sincerely,

Kathleen Butler
Information Builders
December 15, 2017, 04:49 PM
MathematicalRob
This sounds very interesting! I can always use more tools in my toolbox. . .


WebFocus 8201m on Windows; App Studio 8201; Procedures: WebFocus with SQL; HTML Parameter Pages & Dashboard; Output: Excel, HTML, & PDF.
December 17, 2017, 03:16 PM
Waz
Hoping that out of this we will get something like:

ON TABLE HOLD AS X FORMAT Y EXECUTE SCRIPT Z


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

January 02, 2018, 02:50 PM
Ira Kaplan
Dear FocalPoint Community,

David Glick and I appreciate the many views, comments, completed surveys, and follow up conversations. We will give your comments careful consideration.

We have already begun work to integrate R with WebFOCUS and Python is next. I am following this post so please feel free to comment in the future.

See you at Summit 2018.


Regards,

Ira Kaplan
WebFOCUS Product Research
Information Builders
October 02, 2018, 09:29 AM
jfr99
Any progress/update on integrating R and Python into the WebFocus environment?


WebFocus 8.201M, Windows, App Studio
October 02, 2018, 09:52 AM
BabakNYC
I believe 8.205 will have both a Python as well as an R Serve adapter. The Python adapter will let you create synonym for a Python Script.


WebFOCUS 8206, Unix, Windows
October 02, 2018, 11:26 AM
CoolGuy
Good to know. Thank you BabakNYC.

I wonder if there will be a "SQLOUT" for those languages as well...


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
October 02, 2018, 12:57 PM
BabakNYC
I doubt it because you're really creating a master file for a script.


WebFOCUS 8206, Unix, Windows
October 02, 2018, 01:35 PM
CoolGuy
I just wasn't sure the breadth and depth of support for Python and R that was coming. Would we be able to use it in ways beyond just connecting to data with? Like using it inline with WebFOCUS for analytical preprocessing, etc. instead of relying on what masters dictate.


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
October 11, 2018, 08:55 AM
jfr99
Is there a projected date when a Python adapter would be available? Does IBI have any information on how the adapter will work and what capabilities will it give developers?


WebFocus 8.201M, Windows, App Studio
October 11, 2018, 12:03 PM
FP Mod Chuck
Jfr99

I downloaded a pre-release of the 8.2.05 reporting server and there is a Python adapter available. I'm not sure of the real release date of this version but at least you know it is coming soon. You can contact techsupport to see when it will be released.

Just to be clear you will have to license the adapter in order to use it.

This message has been edited. Last edited by: FP Mod Chuck,


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
October 11, 2018, 03:43 PM
Ira Kaplan
Hi. I appreciate our customers' interest in the new WebFOCUS scripting language integration. The adapter for R scripts, the "Rserve adapter", is available beginning with WebFOCUS Reporting Server 8203 and is described in the manual "WebFOCUS Adapter Administration: WebFOCUS Reporting Server Release 8203", available at: https://webfocusinfocenter.inf...adapteradmin7708.pdf

The Rserve and the upcoming Python adapter (in development) are available as part of the "WebFOCUS Data Science and Predictive Analytics Bundle." For licensing information please contact your Information Builders account executive; the feature code is WDSP.

As a manager in the WebFOCUS Product Research group I can answer your technical questions about the adapters. Please post public questions to this message chain and I will respond. For private messages please contact me directly: ira_kaplan at ibi.com

Next week I will post a longer message describing how the adapters work. For a user's perspective the adapter are used in COMPUTEs.


For example, to run the R script below, using a regular expression to extract an email address from a longer sentence, the fex is:

-* consume_regex.fex

TABLE FILE SENTENCES
PRINT
SENTENCE
COMPUTE Email/A100 MISSING ON ALL = RSERVE(regex/regex_run, sentence, email); AS 'Email'
END

--------------------
The R script is:

# regex_run.R

args <- commandArgs[trailingOnly=TRUE)
input_file <- file.path[args[1])
output_file <- file.path[args[2])

sentences <- read.csv[input_file, stringsAsFactors = FALSE)

pattern <- '\\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}\\b'

m <- regexpr[pattern, sentences$sentence, ignore.case = TRUE, perl=TRUE)

# keep non-matches as NA
no_match <- -1

# create a vector of NA's, results, length is the number of sentences
results <- rep[NA, nrow[sentences))
results[m != no_match] <- regmatches[sentences$sentence, m)

sentences_and_emails <- cbind[sentences, results)
names(sentences_and_emails) <- c['sentence','email')

write.csv(sentences_and_emails, output_file, row.names = FALSE)

--------------------

And the input and output appear as (report formatting was lost in the cut and paste):
sentence Email
Lorem ipsum XXXX dolor sit amet, consectetur adipiscing elit. NA
Lorem ipsum JohnNTorres@dayrep.com dolor sit amet, consectetur adipiscing elit. JohnNTorres@dayrep.com
Integer non velit CarlosKSettle@dayrep.com ex. CarlosKSettle@dayrep.com
Nullam viverra mauris ac metus semper CharlesKSolomon@armyspy.com dapibus. CharlesKSolomon@armyspy.com
Donec congue vitae nisi MichaelMBriggs@fleckens.hu convallis maximus. MichaelMBriggs@fleckens.hu
Vestibulum at KristinHJames@dayrep.com ornare nibh. KristinHJames@dayrep.com
Aenean eu ChristinaDSchwartz@gustr.com venenatis justo. ChristinaDSchwartz@gustr.com
Nam porttitor enim sed justo MarieLCausey@einrot.com semper, ac tempor erat aliquam. MarieLCausey@einrot.com
Donec fermentum, eros ut dignissim sollicitudin, ex magna interdum mauris, GeraldineRWilliams@cuvox.de et auctor justo mauris eget metus. GeraldineRWilliams@cuvox.de

---------------

Regards,
Ira
October 15, 2018, 03:30 PM
Ira Kaplan
News flash! The Python adapter is now available in WebFOCUS 8205. More information to follow.

Regards,
Ira
November 14, 2018, 09:08 AM
Ira Kaplan
Hello Focal Pointers. I want to hear from you. I plan to give the following sessions at Summit 2019 (also to be presented as webinars) and I want to know what you think.

#1: Introduction to Programming with Python (lecture)

#2: What We Can Do with WebFOCUS and Python (lecture)

#3: Hands-on with the Python Adapter (lab)


Regards,

Ira Kaplan
Manager, WebFOCUS Product Research
November 15, 2018, 11:43 AM
tcwillden
Those sound great! I'm looking to see in Python in action


WebFOCUS: 8.2.02, OS: Windows 10
November 15, 2018, 11:50 AM
CoolGuy
These would be great Summit presentations and webinars. Always up for language-oriented sessions.


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
November 16, 2018, 11:22 AM
Michael L Meagher
Ira - Please do present these. I will be at each one for sure!


WebFOCUS 8.2.03 - Production
WebFOCUS 8.2.04 - Sand Box
Windows 2012 R2 Server
HTML, PDF, Excel
In FOCUS since 1980