Package org.apache.stanbol.commons.namespaceprefix.service

Examples of org.apache.stanbol.commons.namespaceprefix.service.StanbolNamespacePrefixService


                "# where:",
                "#   {prefix} ... [0..9A..Za..z-_]",
                "#   {namespace} ... must end with '#' or '/' for URLs and ':' for URNs",
                "# one mapping per line, multiple prefixes for the same namespace allowed"));
        }
        namespacePrefixService = new StanbolNamespacePrefixService(nsPrefixMappings);
    }
View Full Code Here


            }
            //Assert.assertTrue(mappingFile.isFile());
        } else {
            mappingFile = new File("testnamespaceprefix.mappings");
        }
        NamespacePrefixService service = new StanbolNamespacePrefixService(mappingFile);
        //assertMappings
        Assert.assertEquals(foaf_pf, service.getPrefix(foaf_ns));
        Assert.assertEquals(foaf_ns, service.getNamespace(foaf_pf));
       
    }
View Full Code Here

          mappingFile = new File(mappingURL.toURI());
        } catch(URISyntaxException e) {
          mappingFile = new File(mappingURL.getPath());
        }
        Assert.assertTrue(mappingFile.isFile());
        service = new StanbolNamespacePrefixService(mappingFile);
    }
View Full Code Here

        Assert.assertTrue(mappingFile.isFile());
        service = new StanbolNamespacePrefixService(mappingFile);
    }
    @Test
    public void testInitialisationWithoutLocalMappingFIle() throws IOException {
        StanbolNamespacePrefixService service = new StanbolNamespacePrefixService(null);
        service.setPrefix("dummy", "http://www.dummy.org/dummy#");
        Assert.assertEquals("http://www.dummy.org/dummy#", service.getNamespace("dummy"));
        service.importPrefixMappings(new ByteArrayInputStream(
            "dummy2\thttp://www.dummy.org/dummy2#".getBytes(Charset.forName("UTF-8"))));
        Assert.assertEquals("http://www.dummy.org/dummy2#", service.getNamespace("dummy2"));
       
    }
View Full Code Here

            }
            //Assert.assertTrue(mappingFile.isFile());
        } else {
            mappingFile = new File("testnamespaceprefix.mappings");
        }
        service = new StanbolNamespacePrefixService(mappingFile);
    }
View Full Code Here

    protected MultiThreadedTestBase(String... assertEngines) {
        super(null,assertEngines);
        //set the endpoint to the default
        setEndpoint(null, ENABLE_EXECUTION_METADATA);
        try {
            nsPrefixService = new StanbolNamespacePrefixService(null);
        } catch (IOException e) {
            log.warn("Unable to initialise NamespacePrefixService. '{prefix}:{localname}' type "
                + "will not be supported and cause IllegalArgumentExceptions when used!",e);
        }
    }
View Full Code Here

                "# where:",
                "#   {prefix} ... [0..9A..Za..z-_]",
                "#   {namespace} ... must end with '#' or '/' for URLs and ':' for URNs",
                "# one mapping per line, multiple prefixes for the same namespace allowed"));
        }
        namespacePrefixService = new StanbolNamespacePrefixService(nsPrefixMappings);
    }
View Full Code Here

            }
            //Assert.assertTrue(mappingFile.isFile());
        } else {
            mappingFile = new File("testnamespaceprefix.mappings");
        }
        NamespacePrefixService service = new StanbolNamespacePrefixService(mappingFile);
        //assertMappings
        Assert.assertEquals(foaf_pf, service.getPrefix(foaf_ns));
        Assert.assertEquals(foaf_ns, service.getNamespace(foaf_pf));
       
    }
View Full Code Here

          mappingFile = new File(mappingURL.toURI());
        } catch(URISyntaxException e) {
          mappingFile = new File(mappingURL.getPath());
        }
        Assert.assertTrue(mappingFile.isFile());
        service = new StanbolNamespacePrefixService(mappingFile);
    }
View Full Code Here

TOP

Related Classes of org.apache.stanbol.commons.namespaceprefix.service.StanbolNamespacePrefixService

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.