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

Jena sends multiple media types in accept header when reading knowledge via a url

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Jena 4.1.0
    • Jena 4.2.0
    • RIOT
    • None
    • Windows / WSL2 / Maven / Java 14.0.2

    Description

      When I create a basic model and use the read(...) method to read a remote file, Jena includes multiple media types in the request header.

       

      Accept: text/turtle,application/n-triples;q=0.9,application/rdf+xml;q=0.7,application/trig,application/n-quads;q=0.9,application/ld+json;q=0.8,*/*;q=0.5

      The ordering and priorities of the media types does not change, even when different formats are chosen.

      i.e. the following code gives the above list of media types:

       

       

      Model model = ModelFactory.createDefaultModel();
      model.read("http://localhost:8080/sim""TURTLE");   

      However, the code below also gives the same list of media types:
       

      Model model = ModelFactory.createDefaultModel(); model.read("http://localhost:8080/sim""RDF/XML");

       
      This results in the knowledge being downloaded in the incorrect format...

      Attachments

        Activity

          People

            Unassigned Unassigned
            remcollier Rem Collier
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: