@@ -211,6 +211,21 @@ abc`)).rejects.toBeTruthy();
211211 expect ( parser . valueToUri ( 'xyz' , { baseIRI : 'http://aa/././a' } ) )
212212 . toEqual ( DF . namedNode ( 'http://aa/xyz' ) ) ;
213213 } ) ;
214+
215+ it ( 'create a named node from a relative IRI with a slash before the colon' , ( ) => {
216+ expect ( parser . valueToUri ( 'x/y:z' , { baseIRI : 'http://base.org/path/' } ) )
217+ . toEqual ( DF . namedNode ( 'http://base.org/path/x/y:z' ) ) ;
218+ } ) ;
219+
220+ it ( 'create a named node from a relative IRI with a slash before the colon and no trailing slash on base' , ( ) => {
221+ expect ( parser . valueToUri ( 'x/y:z' , { baseIRI : 'http://base.org/path' } ) )
222+ . toEqual ( DF . namedNode ( 'http://base.org/x/y:z' ) ) ;
223+ } ) ;
224+
225+ it ( 'create a named node from a relative IRI with multiple colons after a slash' , ( ) => {
226+ expect ( parser . valueToUri ( 'x/y:z:w' , { baseIRI : 'http://base.org/path/' } ) )
227+ . toEqual ( DF . namedNode ( 'http://base.org/path/x/y:z:w' ) ) ;
228+ } ) ;
214229 } ) ;
215230
216231 describe ( 'should error with line numbers' , ( ) => {
@@ -2100,6 +2115,21 @@ abc`)).rejects.toBeTruthy();
21002115 ] ) ;
21012116 } ) ;
21022117
2118+ // 2.14 - relative IRI with a colon after a slash
2119+ it ( 'relative IRI containing a slash before a colon should be resolved against the base IRI' , async ( ) => {
2120+ const parserThis = new RdfXmlParser ( { baseIRI : 'https://example.com/base/' } ) ;
2121+ const array = await parse ( parserThis , `<?xml version="1.0" encoding="UTF-8"?>
2122+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
2123+ xmlns:default="https://example.com/default/">
2124+ <default:C rdf:about="x/y:z"/>
2125+ </rdf:RDF>` ) ;
2126+ return expect ( array )
2127+ . toBeRdfIsomorphic ( [
2128+ quad ( 'https://example.com/base/x/y:z' , 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type' ,
2129+ 'https://example.com/default/C' ) ,
2130+ ] ) ;
2131+ } ) ;
2132+
21032133 // 2.15
21042134 it ( 'rdf:li properties' , async ( ) => {
21052135 const array = await parse ( parser , `<?xml version="1.0"?>
0 commit comments