[ 
https://issues.apache.org/jira/browse/JENA-1893?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17098364#comment-17098364
 ] 

Marco Neumann commented on JENA-1893:
-------------------------------------

Thank you for the reference Andy. I presume ARQ applies the semantics to 
afn:substr (afn:substring) .  Since I was experimenting with both I have 
noticed here that if the index is out of (upper)bounds afn:substr doesn't 
report results while fn:substring does.

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX lotico: <http://www.lotico.com/resource/>
PREFIX loticoowl: <http://www.lotico.com/ontology/>
PREFIX afn: <http://jena.apache.org/ARQ/function#>
PREFIX fn:<http://www.w3.org/2005/xpath-functions#>

SELECT (afn:substring(?cc,0,3) AS ?spc) WHERE{
  BIND("DE" AS ?cc)  .
}               

vs

SELECT (afn:substring(?cc,0,2) AS ?spc) WHERE{
  BIND("DE" AS ?cc)  .
}               
 

> Variable not in scope for property function 
> --------------------------------------------
>
>                 Key: JENA-1893
>                 URL: https://issues.apache.org/jira/browse/JENA-1893
>             Project: Apache Jena
>          Issue Type: Question
>          Components: ARQ
>    Affects Versions: Jena 3.14.0
>         Environment: ubunutu 19.10
> java 13
>            Reporter: Marco Neumann
>            Priority: Trivial
>
> following query doesn't produce results for ?subpop
> PREFIX loticoowl: <http://www.lotico.com/ontology/>
> PREFIX fn:<http://www.w3.org/2005/xpath-functions#>
> SELECT ?pop (fn:substring(?pop ,0,4) AS ?subpop) WHERE{
>        ?x loticoowl:memberCount ?pop
> }
> http://query.lotico.com/#PREFIX%20loticoowl%3A%20%3Chttp%3A%2F%2Fwww.lotico.com%2Fontology%2F%3E%0APREFIX%20afn%3A%20%3Chttp%3A%2F%2Fjena.apache.org%2FARQ%2Ffunction%23%3E%0APREFIX%20fn%3A%3Chttp%3A%2F%2Fwww.w3.org%2F2005%2Fxpath-functions%23%3E%0A%0ASELECT%20%3Fpop%20%28fn%3Asubstring%28%3Fpop%20%2C0%2C4%29%20AS%20%3Fsubpop%29%20WHERE%7B%0A%20%20%20%20%20%20%20%3Fx%20loticoowl%3AmemberCount%20%3Fpop%0A%7D%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20
> a similar query on wikidata.org produces results as expected 
> https://query.wikidata.org/#PREFIX%20loticoowl%3A%20%3Chttp%3A%2F%2Fwww.lotico.com%2Fontology%2F%3E%0APREFIX%20afn%3A%20%3Chttp%3A%2F%2Fjena.apache.org%2FARQ%2Ffunction%23%3E%0APREFIX%20fn%3A%3Chttp%3A%2F%2Fwww.w3.org%2F2005%2Fxpath-functions%23%3E%0A%0ASELECT%20%3Fx%20%3Fpop%20%28fn%3Asubstring%28%3Fpop%20%2C0%2C3%29%20AS%20%3Fsubpop%29%20WHERE%7B%0A%20%20%20%20%20%20%20%3Fx%20wdt%3AP1082%20%3Fpop.%0A%20%20%20%20%20%20%20%3Fx%20wdt%3AP31%20wd%3AQ6256%0A%7D%20LIMIT%2010



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to