SWI-Prolog / packages-semweb

The SWI-Prolog RDF store
28 stars 14 forks source link

When passing a stream to read_rdfa/3 option base/1 does not work #70

Closed wouterbeek closed 6 years ago

wouterbeek commented 6 years ago

It is possible to parsing an RDFa file by first opening a read stream on it. However, when the source to read_rdfa/3 is a stream, the base/1 option is neglected. This means that the name of the file is used as the base URI:

:- use_module(library(semweb/rdfa)).
test(Triples) :-
  setup_call_cleanup(
    open('test.html', read, In),
    read_rdfa(In, Triples, [base('http://hdl.handle.net/1902.1/18959')]),
    close(In)
  ).

results in the following Triples:

X = [rdf('http:test.html', 'http://www.w3.org/1999/xhtml/vocab#stylesheet', 'http:/javax.faces.resource/theme.css.xhtml?ln=primefaces-bootstrap'), ...].