AndreasMeier12 opened a new issue, #3180:
URL: https://github.com/apache/jena/issues/3180

   ### Version
   
   5.0.0
   
   ### Question
   
   ## Situation
   Version 5.0.0, although I have also seen it with 5.3.0
   
   I am dealing with the following situation: 
   In a file, I encounter an RDF identifier containing a percent encoded `|`, 
`%7C`. When I try to get the local name, the string is much shorter than I 
would expect. 
   
   
   ## Observed Behavior
   For the resource 
`resource:LOL-123.345.678-example-Quantity-ASDF%7C323-20-mg`, the local name is 
`mg` 
   
   ## Expected Behavior
   
   For the resource 
`resource:LOL-123.345.678-example-Quantity-ASDF%7C323-20-mg`, the local name is 
`LOL-123.345.678-example-Quantity-ASDF|23-20-mg`  
   
   
   ## Questions
   
   Is this a problem in the way I use Jena? 
   If so, what is the correct way to read these names?
   
   If no, what is the best way to approach this? 
   
   
   ## Example
   As a minimal example, i have the following TTL file that results in the 
local name `mg`. 
   ```ttl
   @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
   @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
   @prefix myprefix: <https://example.org/rdf/schema/example#> .
   @prefix resource: <https://example.org/rdf/resource/> .
   
   
   resource:LOL-123.345.678-example-Quantity-ASDF%7C323-20-mg a myprefix:Class;
     myprefix:hasValue 2.0E1 .
   
   ```
   
   And a small Java program to read it, path to the TTL file provided as the 
first argument:
   ```java
   import org.apache.jena.rdf.model.Model;  
   import org.apache.jena.rdf.model.ModelFactory;  
   import org.apache.jena.riot.Lang;  
   import org.apache.jena.riot.RDFDataMgr;  
     
   public class ReadMinimalExample  
   {  
     
       public static void main(String[] args)  
       {  
           String path = args[0];  
           Model model = ModelFactory.createDefaultModel();  
           RDFDataMgr.read(model, path, Lang.TTL);  
           
System.out.println(model.listStatements().toList().get(0).getSubject().getLocalName());
  
   
       }  
   }
   
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to