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

Add a convenient method to create a typed literal without lang tag

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Done
    • None
    • Jena 2.11.0
    • Jena

    Description

      It is possible to create typed literal from the Node class by calling Node createLiteral(String lex, String lang, RDFDatatype dtype). However, as stated in the documentation (c.f. http://openjena.org/how-to/typedLiterals.html#lang) "Thus for almost all typed literals there is no xml:Lang tag". It would be nice to provide a Node createLiteral(String lex, RDFDatatype dtype) method that delegates the call to Node createLiteral(String lex, String lang, RDFDatatype dtype) with the right value for the lang parameter. Indeed, when I use the existing method to create typed literal without lang tag, I put null for the lang parameter and it works but I don't know if it is the right value (in the jena source code it seems that an empty String is used) and whether it can break something (the documentation give no information). Moreover it is really annoying to have to specify the useless lang parameter when we don't need it.

      Attachments

        1. JENA-83-r1148711.patch
          1 kB
          Laurent Pellegrino

        Activity

          People

            andy Andy Seaborne
            laurent.pellegrino Laurent Pellegrino
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 5m
                5m
                Remaining:
                Remaining Estimate - 5m
                5m
                Logged:
                Time Spent - Not Specified
                Not Specified