Uploaded image for project: 'Apache Commons RDF'
  1. Apache Commons RDF
  2. COMMONSRDF-54

overloaded versions of RDF4J#asRDFTerm(org.eclipse.rdf4j.model.Value)

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.5.0
    • Component/s: rdf4j
    • Labels:
      None

      Description

      In the class org.apache.commons.rdf.rdf4j.RDF4J, there is a method

      public RDF4JTerm asRDFTerm(final Value value)

      Suppose that we declare a variable iri of the type org.eclipse.rdf4j.model.IRI, then asRDFTerm(iri) returns RDF4JTerm but not RDF4JIRI. To use the result as RDF4JIRI, I always need to explicitly cast.

      Therefore, I would like to add three overloaded versions of this method:

      • RDF4JBlankNode asRDFTerm(final org.eclipse.rdf4j.model.BNode value)
      • RDF4JLiteral asRDFTerm(final org.eclipse.rdf4j.model.Literal value)
      • RDF4JIRI asRDFTerm(final org.eclipse.rdf4j.model.IRI value)

      So that we can avoid unnecessary casts.

      There is also a similar situation in org.apache.commons.rdf.jena.JenaRDF#asRDFTerm(org.apache.jena.graph.Node)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                stain Stian Soiland-Reyes
                Reporter:
                ghxiao Guohui Xiao
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 1h
                  1h
                  Remaining:
                  Remaining Estimate - 1h
                  1h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified