OpenEHR ADLParser error using se.acode.openehr.parser.ADLParser and org.openehr.adl.parser.AdlDeserializer - argument-dependent-lookup

We are trying to deserialize an ADL file (ADMIN-ENTRY), but an error occurs when using both ADLParser and ADLDeserializer.
Using se.acode.openehr.parser.ADLParser return this error message:
se.acode.openehr.parser.ParseException: Encountered " <V_LOCAL_CODE> "\"at0108\" "" at line 109, column 112.
Was expecting:
"}" ...
at se.acode.openehr.parser.ADLParser.generateParseException(ADLParser.java:7327)
at se.acode.openehr.parser.ADLParser.jj_consume_token(ADLParser.java:7191)
at se.acode.openehr.parser.ADLParser.c_attribute(ADLParser.java:2832)
at se.acode.openehr.parser.ADLParser.c_complex_object_body(ADLParser.java:2604)
at se.acode.openehr.parser.ADLParser.c_complex_object(ADLParser.java:2587)
at se.acode.openehr.parser.ADLParser.c_object(ADLParser.java:2632)
at se.acode.openehr.parser.ADLParser.c_attr_values(ADLParser.java:2868)
at se.acode.openehr.parser.ADLParser.c_attribute(ADLParser.java:2831)
at se.acode.openehr.parser.ADLParser.c_complex_object_body(ADLParser.java:2604)
at se.acode.openehr.parser.ADLParser.c_complex_object(ADLParser.java:2587)
at se.acode.openehr.parser.ADLParser.c_object(ADLParser.java:2632)
at se.acode.openehr.parser.ADLParser.c_attr_values(ADLParser.java:2868)
at se.acode.openehr.parser.ADLParser.c_attribute(ADLParser.java:2831)
at se.acode.openehr.parser.ADLParser.c_complex_object_body(ADLParser.java:2604)
at se.acode.openehr.parser.ADLParser.c_complex_object(ADLParser.java:2587)
at se.acode.openehr.parser.ADLParser.c_object(ADLParser.java:2632)
at se.acode.openehr.parser.ADLParser.c_attr_values(ADLParser.java:2868)
at se.acode.openehr.parser.ADLParser.c_attribute(ADLParser.java:2831)
at se.acode.openehr.parser.ADLParser.c_complex_object_body(ADLParser.java:2604)
at se.acode.openehr.parser.ADLParser.c_complex_object(ADLParser.java:2587)
at se.acode.openehr.parser.ADLParser.c_object(ADLParser.java:2632)
at se.acode.openehr.parser.ADLParser.c_attr_values(ADLParser.java:2868)
at se.acode.openehr.parser.ADLParser.c_attribute(ADLParser.java:2831)
at se.acode.openehr.parser.ADLParser.c_complex_object_body(ADLParser.java:2604)
at se.acode.openehr.parser.ADLParser.c_complex_object(ADLParser.java:2587)
at se.acode.openehr.parser.ADLParser.c_object(ADLParser.java:2632)
at se.acode.openehr.parser.ADLParser.c_attr_values(ADLParser.java:2868)
at se.acode.openehr.parser.ADLParser.c_attribute(ADLParser.java:2831)
at se.acode.openehr.parser.ADLParser.c_complex_object_body(ADLParser.java:2604)
at se.acode.openehr.parser.ADLParser.c_complex_object(ADLParser.java:2587)
at se.acode.openehr.parser.ADLParser.cadl_text(ADLParser.java:2553)
at se.acode.openehr.parser.ADLParser.arch_definition(ADLParser.java:738)
at se.acode.openehr.parser.ADLParser.archetype(ADLParser.java:295)
Using org.openehr.adl.parser.AdlDeserializer return this error message:
org.openehr.adl.parser.AdlParserException: 1:0 extraneous input '' expecting {ARCHETYPE, TEMPLATE, TEMPLATE_OVERLAY}
335:0 mismatched input 'ontology' expecting <EOF>
at org.openehr.adl.parser.AdlDeserializer.parse(AdlDeserializer.java:68)
at org.openehr.adl.parser.AdlDeserializer.parse(AdlDeserializer.java:51)
This is the ADL file:
https://drive.google.com/file/d/1m7vQ7fw7EvQI58t3kbL73Py713DYV-Q9/view?usp=sharing
Does anyone know how do I solve this?

I think the construct with DV_TEXT is illegal on line 109.
The same construct is used a few line below this one, try removing this one and see if you get the error on that location.
What are you trying to achieve? Is it meant to be a regular expression?

Related

Specific type code is invalid and Method Invocation impex.exportItemsFlexibleSearch error

Asking for your help, I don't know why I'm still getting these errors :(
20.06.25 18:47:40:992 ERROR line 3 at main script: Flexiblesearch error: type code 'StockLevel ' invalid
20.06.25 18:47:40:992 ERROR line 3 at main script: query was 'SELECT DISTINCT {sl.pk} AS PK, {sl.productCode} AS SKU, {p.name} AS Brand_Name, {aas.code} AS Approval_Status, {p.onlineDate} AS Online_From_Date, {p.offlineDate} AS Online_To_Date, {cv.version} as Catalog_Version, {sl.available} AS Available_Stocks, {sl.reserved} AS Reserved_Stocks FROM {StockLevel AS sl}, {Product AS p}, {ArticleApprovalStatus AS aas}, {CatalogVersion AS cv} WHERE {p.code}={sl.productCode} AND {aas.pk}={p.approvalStatus} AND {cv.pk}={p.catalogVersion} AND {cv.version}='online' AND {aas.code}='approved' ORDER BY {sl.pk}'
20.06.25 18:47:41:173 ERROR line 3 at main script: error executing code line at 3 : Sourced file: inline evaluation of: ``impex.exportItemsFlexibleSearch("SELECT DISTINCT {sl.pk} AS PK, {sl.productCode} . . . '' : Method Invocation impex.exportItemsFlexibleSearch
Here is my Impex for exporting data:
INSERT_UPDATE StockLevel;pk[unique=true];product(code);product(name[lang=en]);product(approvalStatus(code));product(onlineDate[dateformat=MM-dd-yyyy]);product(offlineDate[dateformat=MM-dd-yyyy]);product(catalogVersion(version));available[allownull=true];reserved[allownull=true]
"#% impex.exportItemsFlexibleSearch(""SELECT DISTINCT {sl.pk} AS PK, {sl.productCode} AS SKU, {p.name} AS Brand_Name, {aas.code} AS Approval_Status, {p.onlineDate} AS Online_From_Date, {p.offlineDate} AS Online_To_Date, {cv.version} as Catalog_Version, {sl.available} AS Available_Stocks, {sl.reserved} AS Reserved_Stocks FROM {StockLevel AS sl}, {Product AS p}, {ArticleApprovalStatus AS aas}, {CatalogVersion AS cv} WHERE {p.code}={sl.productCode} AND {aas.pk}={p.approvalStatus} AND {cv.pk}={p.catalogVersion} AND {cv.version}='online' AND {aas.code}='approved' ORDER BY {sl.pk}"");"
Thank you. :)
I tried to run your script in my local machine and it exported data. Did you check if the StockLevel type exists? It's part of the basecommerce extension.
Also, try this refactored impex. It will work when there's no result:
INSERT_UPDATE StockLevel;pk[unique=true];product(code);product(name[lang=en]);product(approvalStatus(code));product(onlineDate[dateformat=MM-dd-yyyy]);product(offlineDate[dateformat=MM-dd-yyyy]);product(catalogVersion(version));available[allownull=true];reserved[allownull=true]
"#% impex.exportItemsFlexibleSearch(""SELECT DISTINCT {sl.pk} FROM {StockLevel AS sl JOIN Product AS p ON {p.code}={sl.productCode} JOIN ArticleApprovalStatus AS aas ON {aas.pk}={p.approvalStatus} JOIN CatalogVersion AS cv ON {cv.pk}={p.catalogVersion}} WHERE {cv.version}='online' AND {aas.code}='approved'"");"

Error during parsing. Encountered " <IDENTIFIER> "Error "" at line 1, column 2

I have a simple pig script used to import data file.
My data file is located in : /home/fs188
It's a csv file which contains data as :
011958029,00000024,,1,20100209,1
011951228,00000036,,1,20100209,1
011964431,00000814,,1,20100227,1
003526500,00000863,,1,20080122,1
011950864,00001478,,1,20100209,1
011999168,00002495,X0,1,20100331,0
001684881,00002641,,1,19861126,1
001677981,00003165,,1,19861119,1
001677457,00003311,,1,19870114,1
001677161,00003440,,1,19870116,1
002594705,00003475,,1,19870122,1
011958074,00004327,,1,20100210,1
I just want to execute my script pig named PigScript and test it in local mode.
It contains this code :
ENEE_ENR_FILTER = LOAD '/home/fs188/DataExempleUdf.csv' USING PigStorage(',') AS (idt_gcp:chararray,idt_ent_pse:chararray,cd_not:chararray,idc_pse_pci:chararray,da_pram_ett:chararray,idc_cd_not:chararray);
DUMP ENEE_ENR_FILTER;
So I call my script :
pig -x local PigScript.pig
I get this error :
2019-08-07 12:03:14,277 [main] ERROR org.apache.pig.tools.grunt.Grunt
- ERROR 1000: Error during parsing. Encountered " "-x "" at line 1, column 2.
This is weird because I don't have any synthax error

End of line anchor $ throwing error in Hue Pig Editor

Shen I use the below regex from Hue's pig editor I get an error.
REGEX_EXTRACT(cs, '((;|^)u=(.*?)([^0-9a-z-A-Z]|\\$))', 3)
It looks like an old issue with prior version of Hue but looks like they have resolved in 3.6 version.
https://issues.cloudera.org/browse/HUE-1958
I am running Hue 3.6 and pig 0.12 but still getting the same error. Can someone help out. Thx.
Error:
2014-11-20 08:18:29,282 [main] ERROR org.apache.pig.impl.PigContext - Encountered " <OTHER> ")=$ "" at line 1, column 1.
Was expecting one of:
<EOF>
<IDENTIFIER> ...
<COMMENT> ...
2014-11-20 08:18:29,289 [main] ERROR org.apache.pig.Main - ERROR 2997: Encountered IOException. org.apache.pig.tools.parameters.ParseException: Encountered " <OTHER> ")=$ "" at line 1, column 1.
Was expecting one of:
<EOF>
<IDENTIFIER> ...
<COMMENT> ...

Pig Filter Syntax error, unexpected symbol

inputData = LOAD '$input' AS (line:chararray);
statusLineFilter = FILTER smallData BY (line MATHCES '^.* AppWrite-Dispatcher: Status code: [0-9]+$');
This code, when I run it, yields this error: ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: Syntax error, unexpected symbol at or near 'line'
The log file says the exact same thing. I'm at a loss, because the exact same syntax is working in other scripts I've written.
In order to avoid misspelling of key words I recommend you to use an IDE or a Text-Editor like emacs with the pig-mode.el which add syntax highlight ;)

Syntax error when storing Pig output

I am having some issues with storing my pig output to a file. This is what I am using to store:
'STORE rel INTO 'simple'; '
If I Dump 'rel' I get:
>(car,0.5,(door,tire,jello,truck,random))
(toy,0.5,(jeep,bunny toy))
(door,0.5,(car,jello,random))
>(jeep,0.5,(toy,bunny toy))
What I get in the file is:
<Yulias-MacBook-Pro:~ yuliatolskaya$ /Users/yuliatolskaya/Documents/misc/pig_clustering/simple/part-r-00000 ; exit;
/Users/yuliatolskaya/Documents/misc/pig_clustering/simple/part-r-00000: line 1: syntax error near unexpected token `('
/Users/yuliatolskaya/Documents/misc/pig_clustering/simple/part-r-00000: line 1: `car 0.5 (door,tire,jello,truck,random)'
logout
[Process completed] >
I am really not sure what the problem is, as there are no errors in the logfiles...Please Help!