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

RDFDataMgr.loadGraph( "http://site.org/doc.ttl#anchor") fails

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • Jena 3.6.0
    • Jena 3.7.0
    • RIOT
    • None
    • Ubuntu 17.10, probably any Environment

    Description

      Riot could remove the URL anchor before sending the HTTP request.
      It's better in Jena code than in my code !

      Here is an interactive session to demonstrate the problem:

       scala> import org.apache.jena.riot._
       import org.apache.jena.riot._
      
      scala> RDFDataMgr.loadGraph( "http://raw.githubusercontent.com/jmvanel/semantic_forms/master/scala/forms/form_specs/login.form.ttl#registerForm")
       ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. Set system property 'log4j2.debug' to show Log4j2 internal initialization logging.
       org.apache.jena.riot.RiotException: Failed to determine the content type: (URI=[http://raw.githubusercontent.com/jmvanel/semantic_forms/master/scala/forms/form_specs/login.form.ttl#registerForm] : stream=text/plain)
         at org.apache.jena.riot.RDFParser.parseURI(RDFParser.java:298)
         at org.apache.jena.riot.RDFParser.parse(RDFParser.java:277)
         at org.apache.jena.riot.RDFParserBuilder.parse(RDFParserBuilder.java:498)
         at org.apache.jena.riot.RDFDataMgr.parseFromURI(RDFDataMgr.java:890)
         at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:221)
         at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:102)
         at org.apache.jena.riot.RDFDataMgr.loadGraph(RDFDataMgr.java:353)
         ... 42 elided
      
      // But this works:
       scala> RDFDataMgr.loadGraph( "http://raw.githubusercontent.com/jmvanel/semantic_forms/master/scala/forms/form_specs/login.form.ttl")
       res1: org.apache.jena.graph.Graph = 
      
      {forms:loginForm @:showProperties c9d4c3e8-9713-4d91-ac6c-4e06248956a8; forms:loginForm @rdfs:label "Authentication"@en; forms:loginForm @rdfs:label "Authentification"@fr; forms:loginForm @:classDomain :AuthenticationAttempt; forms:loginForm @[http://www.w3.org/1999/02/22-rdf-syntax-ns#type] :specification; c9d4c3e8-9713-4d91-ac6c-4e06248956a8 @[http://www.w3.org/1999/02/22-rdf-syntax-ns#rest] 6d6ec6aa-4208-431a-a588-0fbbe7f6e335; c9d4c3e8-9713-4d91-ac6c-4e06248956a8 @[http://www.w3.org/1999/02/22-rdf-syntax-ns#first] :userid; 8a6a4d8e-ac4f-43ef-a4c4-af6ff1fbe1d8 @[http://www.w3.org/1999/02/22-rdf-syntax-ns#rest] [http://www.w3.org/1999/02/22-rdf-syntax-ns#nil]; 8a6a4d8e-ac4f-43ef-a4c4-af6ff1fbe1d8 @[http://www.w3.org/1999/02/22-rdf-syntax-ns#first] :confirmPass...
      

       

      Attachments

        Issue Links

          Activity

            People

              andy Andy Seaborne
              jmvanel Jean-Marc Vanel
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: