use of org.eclipse.rdf4j.model.impl.NamespaceImpl in project rdf4j by eclipse.
the class CustomTurtleParserTest method testParsingNamespacesWithOption.
@Test
public void testParsingNamespacesWithOption() throws Exception {
ParserConfig aConfig = new ParserConfig();
aConfig.set(BasicParserSettings.NAMESPACES, Collections.<Namespace>singleton(new NamespaceImpl("foo", SKOS.NAMESPACE)));
Model model = Rio.parse(new StringReader("<urn:a> foo:broader <urn:b>."), "", RDFFormat.TURTLE, aConfig, vf, new ParseErrorLogger());
assertEquals(1, model.size());
assertTrue(model.contains(vf.createURI("urn:a"), SKOS.BROADER, vf.createURI("urn:b")));
}
use of org.eclipse.rdf4j.model.impl.NamespaceImpl in project rdf4j by eclipse.
the class CustomTurtleParserTest method testParsingNamespacesWithOverride.
@Test
public void testParsingNamespacesWithOverride() throws Exception {
ParserConfig aConfig = new ParserConfig();
aConfig.set(BasicParserSettings.NAMESPACES, Collections.<Namespace>singleton(new NamespaceImpl("foo", SKOS.NAMESPACE)));
Model model = Rio.parse(new StringReader("@prefix skos : <urn:not_skos:> ." + "<urn:a> skos:broader <urn:b>."), "", RDFFormat.TURTLE, aConfig, vf, new ParseErrorLogger());
assertEquals(1, model.size());
assertTrue(model.contains(vf.createIRI("urn:a"), vf.createIRI("urn:not_skos:broader"), vf.createIRI("urn:b")));
}
Aggregations