Package org.openjena.riot.system

Examples of org.openjena.riot.system.PrefixMap


{
    static IRIFactory factory = IRIFactory.iriImplementation() ;
   
    @Test public void prefixMap1()
    {
        PrefixMap pmap = new PrefixMap() ;
        add(pmap, "", "http://example/") ;
        String x = pmap.expand("", "x") ;
        assertEquals("http://example/x", x) ;
    }
View Full Code Here


        assertEquals("http://example/x", x) ;
    }

    @Test public void prefixMap2()
    {
        PrefixMap pmap = new PrefixMap() ;
        add(pmap, "ex", "http://example/") ;
        String x = pmap.expand("", "x") ;
        assertNull(x) ;
    }
View Full Code Here

        assertNull(x) ;
    }
   
    @Test public void prefixMap3()
    {
        PrefixMap pmap = new PrefixMap() ;
        add(pmap, "ex", "http://example/") ;
        add(pmap, "ex", "http://elsewhere/ns#") ;
        String x = pmap.expand("ex", "x") ;
        assertEquals("http://elsewhere/ns#x", x) ;
    }
View Full Code Here

     
      Tokenizer tokenizer = TokenizerFactory.makeTokenizerString(testString) ;
      Sink<Triple> sink = new SinkNull<Triple>() ;

      LangTurtle parser = RiotReader.createParserTurtle(tokenizer, "http://base/", sink) ;
      PrefixMap prefixMap = parser.getProfile().getPrologue().getPrefixMap() ;

      prefixMap.add("a", "http://host/a#") ;
        prefixMap.add("x", "http://host/a#") ;
        // Unicode 00E9 is e-acute
        // Unicode 03B1 is alpha
        prefixMap.add("\u00E9", "http://host/e-acute/") ;
        prefixMap.add("\u03B1", "http://host/alpha/") ;
        prefixMap.add("", "http://host/") ;
        prefixMap.add("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#") ;
        prefixMap.add("xsd", "http://www.w3.org/2001/XMLSchema#") ;
        parser.parse();

        tokenizer.close();
  }
View Full Code Here

TOP

Related Classes of org.openjena.riot.system.PrefixMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.