Uploaded image for project: 'Apache Jena'
  1. Apache Jena
  2. JENA-2189

some XPath registry and function names are wrong

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Jena 3.8.0, Jena 3.9.0, Jena 3.10.0, Jena 3.11.0, Jena 3.12.0, Jena 3.13.0, Jena 3.13.1, Jena 3.14.0, Jena 3.15.0, Jena 3.16.0, Jena 3.17.0, Jena 4.0.0, Jena 4.1.0, Jena 4.2.0
    • Jena 4.3.0
    • Jena
    • None

    Description

      I came across this when trying out some code on jena 4.2 on the tarql project 
       
      [main] WARN org.apache.jena.arq.exec - URI <http://www.w3.org/2005/xpath-functions#day-from-dateTime> has no registered function factory
       
      I looked at https://github.com/apache/jena/blob/main/jena-arq/src/main/java/org/apache/jena/sparql/function/StandardFunctions.java and realised that a few functions aren't what they are described as in https://www.w3.org/TR/xpath-functions-3/ .  They appear to have a signature that uses the plural, whereas the XPath functions are singular:
       
              add(registry, xfn+"years-from-date",        FN_YearsFromDate.class) ;                                                            https://www.w3.org/TR/xpath-functions-3/#func-year-from-date
              add(registry, xfn+"months-from-date",       FN_MonthsFromDate.class) ;                                                       https://www.w3.org/TR/xpath-functions-3/#func-month-from-date
              add(registry, xfn+"days-from-date",         FN_DaysFromDate.class) ;                                                             https://www.w3.org/TR/xpath-functions-3/#func-day-from-date
       
       
              add(registry, xfn+"years-from-dateTime",    FN_YearsFromDateTime.class) ;                                                https://www.w3.org/TR/xpath-functions-31/#func-year-from-dateTime
              add(registry, xfn+"months-from-dateTime",   FN_MonthsFromDateTime.class) ;                                           https://www.w3.org/TR/xpath-functions-3/#func-month-from-dateTime
              add(registry, xfn+"days-from-dateTime",     FN_DaysFromDateTime.class) ;                                                 https://www.w3.org/TR/xpath-functions-3/#func-day-from-dateTime
       
       
       
       
      When I used the incorrect XPath function signature "days-from-dateTime()" the result was calculated as expected and there was no warning error message as above.
       
      When using the distribution of Tarql 1.2 (which, afaik, used Jena 3.11) I only got the following error:
      WARN  URI <http://www.w3.org/2005/xpath-functions#days-from-dateTime> has no registered function factory
      and using "day-from-dateTime()" worked correctly.  I looked into this by opening the jar and found that the function was correct there:
       
      ;org/apache/jena/sparql/function/library/FN_YearFromDateTime month-from-dateTime <org/apache/jena/sparql/function/library/FN_MonthFromDateTime day-from-dateTime :org/apache/jena/sparql/function/library/FN_DayFromDateTime
       
       
      So, it looks like a long-standing error that has been corrected at some point in the generation of the jars for the distro of Tarql 1.2
       

      Attachments

        Issue Links

          Activity

            People

              andy Andy Seaborne
              PedroW Peter Winstanley
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: