Open chiarcos opened 2 years ago
This is not a bug but a missing feature. The CoNLLRDFUpdater was never designed to work with in-line Updates. Instead it was always meant to be used with references to script files. However, Leo will look into it and see if she can find an elegant way to handle this.
This issue appears to be fixed in main.
Using
run.sh CoNLLRDFUpdater -custom -updates "PREFIX conll: <http://ufal.mff.cuni.cz/conll2009-st/task-description.html#> INSERT { ?a conll:WORD ?b } WHERE { ?a conll:FORM ?b}; INSERT { ?a conll:POS ?b } WHERE { ?a conll:XPOS ?b}; "
and the input
@prefix : <http://example.org#>
@prefix conll: <http://ufal.mff.cuni.cz/conll2009-st/task-description.html#> .
:1 conll:FORM :2
@prefix : <http://example.org#>
@prefix conll: <http://ufal.mff.cuni.cz/conll2009-st/task-description.html#> .
:3 conll:FORM :4
I got
@prefix : <http://example.org#> .
@prefix conll: <http://ufal.mff.cuni.cz/conll2009-st/task-description.html#> .
:1 conll:FORM :2 ;
conll:WORD :2 .
@prefix : <http://example.org#> .
@prefix conll: <http://ufal.mff.cuni.cz/conll2009-st/task-description.html#> .
:3 conll:FORM :4 ;
conll:WORD :4 .
Using bash, direct updates are split into separate substrings, and there is not a real workaround. In the following script, the query string is parsed into individual tokens, and the Updater tries to execute each single one as a SPARQL script.
msg:
There doesn't seem to be a way to escape that in Bash.
TODO: When reading the argument vector, concatenate arguments of
-updates
as soon as a any of them is not a file. (Note: leading-
is not expected to occur in SPARQL.)